My App
Workflows

User Onboarding Data Flow

Data flow and sequence for onboarding new users and influencers

Workflow Overview: User Onboarding

This document details how user profile data moves through the system during initial registration and onboarding. It specifically covers the interaction between the frontend client, the authentication service, and the main database.

1. Initial Registration

  1. User Action: The user signs up via Email/Password or a Supported Social Provider (e.g., Google, X).
  2. System Action: The Authentication Service generates a session and creates a base User record with the default role of GUEST.
  3. Data Flow: Client -> POST /api/auth/register -> Better-Auth Service -> Database (User Table)

2. Profile Completion

  1. User Action: The user completes the mandatory onboarding questionnaire (saving basic profile information, investment interests, and risk tolerance).
  2. System Action: The API updates the User profile fields and assigns default notification preferences inside the UserSettings table.

3. Influencer Upgrade Path (Optional)

  1. User Action: The user submits an Influencer Application.
  2. System Action: The system inserts an InfluencerApplication record with a PENDING status.
  3. Async Processing: A background worker is triggered to fetch the user's current social metrics from external APIs (e.g., Twitter, YouTube) and cache them in the application record.
  4. Admin Action: An Admin logs into the dashboard, reviews the queued application, and executes the approval command.
  5. Role Change: The system mutates the base User record role from GUEST to CREATOR, granting the appropriate access controls to the publishing tools.

System Flow Diagram