# Key components

**Note: this modules depends of other modules ( authorization, health, place-code, user, user-login )**

**Key Components in `client/auth`**

* **Controllers**:
  * `sign-up.controller.ts`: Manages user registration requests.
  * `email-check.controller.ts`: Handles email verification for new users.
  * `google.controller.ts`: Manages the Google OAuth login flow.
  * `traffic-channel.controller.ts`: Manages the addition of social media traffic channels.
  * `user-preference.controller.ts`: Handles user preferences during registration.
* **Services**:
  * `sign-up.service.ts`: Handles the logic of generating tokens, creating temporary accounts, and confirming users.
  * `email-check.service.ts`: Verifies the email address by sending and validating a verification code.
  * `o-auth.service.ts`: Manages Google OAuth authentication.
  * `traffic-channel.service.ts`: Handles the addition of traffic channels (e.g., Facebook, Instagram).
  * `user-preference.service.ts`: Manages user preferences during registration.
  * `validation-code-register.service.ts`: Verifies the registration code for email validation.
* **Strategies**:
  * `google.strategy.ts`: Strategy for authenticating users with Google OAuth.
  * `jwt-refresh.strategy.ts`: Strategy for refreshing JWT tokens.
  * `jwt-sign-up.strategy.ts`: Handles JWT-based authentication during the sign-up process.

**Normal Registration Flow in `client/auth`:**

1. **Initiate Registration (`sign-up.controller.ts`)**:
   * The user submits their email and password to create a temporary account.
   * The `sign-up.service.ts` generates a **temporary token** and sends a verification email.
2. **Verify Email (`email-check.controller.ts` and `email-check.service.ts`)**:
   * The user receives an email with a **verification code**.
   * The `validation-code-register.service.ts` validates the code entered by the user.
3. **User Type and Social Media Configuration (`user-preference.controller.ts` and `traffic-channel.controller.ts`)**:
   * The user selects their type and adds social media traffic channels (e.g., Facebook, Instagram).
4. **Confirm Registration**:
   * Once the verification is complete and preferences are configured, the user account is **confirmed** and becomes fully active.

**Google OAuth Registration Flow:**

1. **Initiate Google Registration (`google.controller.ts`)**:
   * The user selects **Google OAuth** as their registration method.
   * The `o-auth.service.ts` authenticates the user via Google.
2. **Automatic Account Creation**:
   * The system automatically creates a **permanent user account** based on the data retrieved from Google, skipping the verification and configuration steps.


---

# Agent Instructions: 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:

```
GET https://docs-affiliates.inlaze.com/architecture/initial-folders-estructure/modules/client/auth-user-registration/folder-estructure/key-components.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
