> For the complete documentation index, see [llms.txt](https://docs.digit.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digit.org/sandbox/platform/architecture/sandbox-ui/low-level-design/modules/user-app.md).

# User App

## **Overview**

The User Module handles the user authentication process, including signup, sign-in, OTP verification, and redirection to appropriate screens based on user actions and authentication status. This module also manages tenant information fetched from the host app.

<div align="left"><figure><img src="https://383170073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLTNzsJMDGVoewNjC1V95%2Fuploads%2FKwgjlmqbobYwc36TwTct%2FUI%20Tech%20Designs%20-%20User%20Module.jpg?alt=media&amp;token=c534b834-174a-4a94-89c4-0594fcfbf94a" alt=""><figcaption><p>User Module</p></figcaption></figure></div>

## **Components**

1. **Signup**: Handles new user registration.
2. **Enter OTP**: Manages OTP entry for verification.
3. **Successful Signup**: Confirmation screen after successful signup.
4. **SignIn**: Manages user login.
5. **Home Screen**: Displays after successful sign-in or signup.
6. **App Home Screen**: Main application screen for authenticated users.

## **Flow**

1. **Signup Process**:
   * The user enters signup details.
   * On form submission, the user is redirected to the OTP entry screen.
2. **OTP Verification**:
   * The user enters OTP.
   * On successful OTP verification, the user is redirected to the successful signup screen.
3. **SignIn Process**:
   * The user enters login credentials.
   * On form submission, the user is redirected to the OTP entry screen for verification.
4. **Post Authentication**:
   * After successful signup or sign-in, the user is redirected to the home screen.
   * The home screen displays the setup for the sandbox app drawer and a help/tutorial video based on BFF (Backend for Frontend) response.
5. **Main Application**:
   * Fetches application states from BFF.
   * Redirects authenticated users to the app home screen.

### Web API sequence Diagrams

The following screens based on the default Tenant

{% tabs %}
{% tab title="Sign Up" %}

<figure><img src="https://383170073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLTNzsJMDGVoewNjC1V95%2Fuploads%2FdRyiMYDC3PIOIjF42P0a%2FScreenshot%202024-08-08%20at%202.52.29%20PM.png?alt=media&amp;token=e5c83ad6-58eb-435a-936c-75f82852f2dd" alt=""><figcaption><p>SIgn Up Flow</p></figcaption></figure>
{% endtab %}

{% tab title="Enter OTP screen" %}

<figure><img src="https://383170073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLTNzsJMDGVoewNjC1V95%2Fuploads%2FzRVvLFB6UED32jYkABci%2FScreenshot%202024-08-08%20at%203.52.13%20PM.png?alt=media&amp;token=ed383d40-272e-41ad-93b4-d1289fe5c3d6" alt=""><figcaption><p>OTP Screen</p></figcaption></figure>

{% endtab %}

{% tab title="Response Screen" %}
Response screen will have the Client Sandbox Admin Portal Link
{% endtab %}
{% endtabs %}

The following screens based on the Account/Client Tenant

{% tabs %}
{% tab title="Sign In" %}

<figure><img src="https://383170073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLTNzsJMDGVoewNjC1V95%2Fuploads%2FlSQ0UsprwzZrFG9sQWMs%2FScreenshot%202024-08-08%20at%205.12.54%20PM.png?alt=media&amp;token=142677ae-2829-4196-8a2d-7ef6156e7553" alt=""><figcaption><p>SignIn</p></figcaption></figure>
{% endtab %}

{% tab title="OTP" %}

<figure><img src="https://383170073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLTNzsJMDGVoewNjC1V95%2Fuploads%2FTXHhNj5NXO3MjsVj6gRL%2FScreenshot%202024-08-08%20at%205.16.56%20PM.png?alt=media&amp;token=55c5a5ad-429e-4cc2-b188-923d06c1b78f" alt=""><figcaption><p>OTP Screen</p></figcaption></figure>
{% endtab %}

{% tab title="Home" %}

<figure><img src="https://383170073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLTNzsJMDGVoewNjC1V95%2Fuploads%2FiuusecNmNQ5Vm6HNkV10%2FScreenshot%202024-08-08%20at%206.12.10%20PM.png?alt=media&amp;token=70817f44-69a7-4315-86e5-32a07a335009" alt=""><figcaption><p>Sandbox Home</p></figcaption></figure>
{% endtab %}

{% tab title="Sidebar(Component)" %}

<figure><img src="https://383170073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLTNzsJMDGVoewNjC1V95%2Fuploads%2FIbn0ok1o4F61TuXcWAHm%2FScreenshot%202024-08-08%20at%206.24.48%20PM.png?alt=media&amp;token=eddc2cfe-c77e-4d53-909f-8b67cee56db6" alt=""><figcaption><p>Sidebar Component</p></figcaption></figure>
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.digit.org/sandbox/platform/architecture/sandbox-ui/low-level-design/modules/user-app.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
