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
- User Action: The user signs up via Email/Password or a Supported Social Provider (e.g., Google, X).
- System Action: The Authentication Service generates a session and creates a base
Userrecord with the default role ofGUEST. - Data Flow:
Client -> POST /api/auth/register -> Better-Auth Service -> Database (User Table)
2. Profile Completion
- User Action: The user completes the mandatory onboarding questionnaire (saving basic profile information, investment interests, and risk tolerance).
- System Action: The API updates the
Userprofile fields and assigns default notification preferences inside theUserSettingstable.
3. Influencer Upgrade Path (Optional)
- User Action: The user submits an Influencer Application.
- System Action: The system inserts an
InfluencerApplicationrecord with aPENDINGstatus. - 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.
- Admin Action: An Admin logs into the dashboard, reviews the queued application, and executes the approval command.
- Role Change: The system mutates the base
Userrecord role fromGUESTtoCREATOR, granting the appropriate access controls to the publishing tools.