User Acquisition & Onboarding Flows

Developer reference for all user type flows in the ReferralFlow platform

Studio Owner Flow
platform_role: studio_owner

Acquisition Sources

  • Home page → "Start Free Trial" button
  • Pricing page → "Start Free Trial" button
  • Direct URL to StudioOnboarding

Onboarding Flow

1

Authentication Check

Page: StudioOnboarding

If not logged in → redirect to base44.auth.redirectToLogin()

After login → automatically return to StudioOnboarding

2

Multi-Step Onboarding

Component: StudioOnboarding (6 steps)

  • • Step 1: Account Creation (AccountCreationStep) - Studio name, owner info, address
  • • Step 2: Brand Setup (BrandSetupStep) - Logo, colors, brand voice
  • • Step 3: Referral Program (ReferralProgramStep) - Reward structure
  • • Step 4: Member Import (MemberImportStep) - CSV upload or manual entry
  • • Step 5: Asset Library (AssetLibraryStep) - Marketing materials
  • • Step 6: Review & Activate (ReviewActivationStep)
3

Account Creation

Entities Created:

  • • Studio - Business entity (owner, branding, settings)
  • • Campaign - Default active campaign
  • • Member records (if imported)
  • • AuditLog - Tracks studio creation

User Update: platform_role: "studio_owner", studio_id

Post-Onboarding Redirect

Destination: StudioDashboard

Key Files:

  • • pages/StudioOnboarding.js
  • • components/onboarding/*.jsx
  • • pages/StudioDashboard.js
Studio Staff Flow
platform_role: studio_staff

Acquisition Source

  • Invited by Studio Owner via base44.users.inviteUser(email, "user")
  • Email invitation with signup link

Onboarding Flow

1

Email Invitation

Staff receives email with signup link from studio owner

2

Account Creation

User creates account via Base44 signup flow

Role automatically assigned: platform_role: "user" (default)

3

Manual Role Assignment

Studio owner manually updates user role to studio_staff

Also assigns: studio_id

Access Dashboard

After role assignment → access StudioDashboard

Note: Staff onboarding is currently manual. No dedicated onboarding flow exists. Staff role must be assigned by studio owner after user signup.

Member Flow
platform_role: member

Acquisition Sources

  • Imported during studio onboarding (CSV or manual entry)
  • Added by studio staff via Members page
  • Converted from Referral entity
  • Invited via email by studio owner/staff

Onboarding Flow

1

Member Record Created

Entity: Member

Initial state: user_id: null (not connected to User account yet)

Auto-generated: referral_code

2

Email Invitation (Optional)

Member receives email invitation to join referral program

Contains signup link

3

User Account Creation

Member signs up via Base44 authentication

Default role: platform_role: "user"

4

Opt-In Flow

Page: MemberOptIn

Member reviews:

  • • How referral program works
  • • Reward structure (from active Campaign)
  • • Data tracking consent
  • • Terms & conditions

Required consents:

  • • Terms acceptance (required)
  • • Referral tracking (required)
  • • Email communications (optional)
5

Role & Data Update

User entity updated:

  • • platform_role: "member"
  • • organization_id
  • • studio_id
  • • preferences.email_notifications

Member entity linked: user_id populated

Post-Onboarding Redirect

Destination: MemberDashboard

Member can now:

  • • View unique referral link
  • • Access marketing assets
  • • Track referrals and rewards
  • • Share on social media

Key Files:

  • • pages/MemberOptIn.js
  • • pages/MemberDashboard.js
  • • pages/MyReferrals.js
  • • components/member/*.jsx
Lead Flow
platform_role: lead

Acquisition Source

  • Clicks member referral link with unique referral_code
  • Lands on ReferralLanding page

Onboarding Flow

1

Click Tracking

Entities Created:

  • • ReferralClick - Tracks click event with IP, user agent, referrer
  • • ReferralEvent - Event type: "link_click"

Attribution data stored in:

  • • Cookies (referralCode)
  • • Session Storage
  • • Local Storage
2

Landing Page Display

Page: ReferralLanding

Displays:

  • • Studio information and branding
  • • Campaign offer details
  • • Referrer first name (optional)
  • • Testimonials/social proof
  • • Lead capture form
3

Lead Form Submission

Component: LeadCaptureForm

Collects:

  • • First name, last name
  • • Email (required)
  • • Phone (optional)
  • • Interest areas

Fraud checks:

  • • Prevents self-referrals (same email as referrer)
  • • Checks for duplicate emails
4

Lead Record Creation

Entities Created:

  • • Lead - Status: "new"
  • • AttributionRecord - First-touch attribution
  • • ReferralEvent - Event: "lead_signup"

Updates:

  • • ReferralClick.converted_to_lead = true
  • • Member.total_referrals++
5

Notifications

Email sent to studio via base44.integrations.Core.SendEmail

Notification created for referrer: Notification entity (type: "lead_signup")

Post-Submission Redirect

Destination: ReferralSuccess

Shows confirmation message and next steps

7

Lead-to-Member Conversion (Future)

When lead becomes paying member:

  • • Lead.status = "converted"
  • • Lead.converted_to_user_id populated
  • • Member entity created
  • • RewardTrigger created (based on campaign rules)
  • • Reward issued to referring member

Key Files:

  • • pages/ReferralLanding.js
  • • pages/ReferralSuccess.js
  • • components/landing/LeadCaptureForm.jsx
Platform Admin Flow
platform_role: platform_admin

Acquisition Source

Manually assigned by database administrator or existing platform admin

Access

Dashboard: AdminDashboard

Capabilities:

  • • View all organizations and studios
  • • Access platform-wide analytics
  • • Manage organization/studio status
  • • Review fraud detection alerts
  • • Access audit logs

Note: No onboarding flow exists. Platform admin role is assigned manually at the database level.

Entity Relationship Summary

User Hierarchy

User (Base44 built-in)
├── platform_role: "platform_admin" → AdminDashboard
├── platform_role: "studio_owner" → StudioDashboard
│   ├── organization_id (references Organization)
│   └── studio_id (references Studio)
├── platform_role: "studio_staff" → StudioDashboard (limited access)
│   ├── organization_id
│   └── studio_id
├── platform_role: "member" → MemberDashboard
│   ├── organization_id
│   ├── studio_id
│   └── Linked to Member entity via member_id
└── platform_role: "lead" → LeadView (future)
    └── Linked to Lead entity

Key Entity Relationships

Organization (1)
  └─ Studio (many)
      ├─ Member (many)
      │   ├─ user_id → User
      │   ├─ referral_code (unique)
      │   └─ Reward (many)
      ├─ Campaign (many)
      ├─ Lead (many)
      │   ├─ referred_by_member_id → Member
      │   ├─ referral_code_used
      │   └─ AttributionRecord (1)
      ├─ ReferralClick (many)
      │   └─ referral_code → Member
      ├─ ReferralEvent (many)
      └─ Asset (many)