Skip to content

Onboarding

The onboarding module guides new users through a two-step setup process that determines their dashboard layout and initial platform experience.

Module path: src/lib/modules/onboarding/ Route: /onboarding

Users select their primary purpose on the platform:

GoalDashboard TemplateDescription
Buyerbuyer_defaultDiscover, support, and purchase from creators
Sellerseller_defaultBuild a site and sell products/services
Refer and Earnreferral_defaultShare Mindhyv and earn commissions
Project Managementpm_defaultOrganize and collaborate on projects

The selected goal determines which dashboard template is initialized.

Two-panel layout: form on the left, live preview on the right.

Required fields:

  • Display Name
  • Username (max 15 characters, unique)
  • Location (country selector)
  • Timezone
  • Language
  • Birth Date (must be 18+)

Optional fields:

  • Avatar (with crop dialog)
  • Profile Tagline (max 30 characters)
  • About Me (max 500 characters)
ComponentFilePurpose
onboarding-goals.sveltesrc/lib/components/onboarding/Goal selection cards
onboarding-form.sveltesrc/lib/components/onboarding/Profile form with validation
onboarding-layout.sveltesrc/lib/components/onboarding/Two-column layout
onboarding-preview.sveltesrc/lib/components/onboarding/Live profile preview
avatar-crop-dialog.sveltesrc/lib/components/onboarding/Avatar cropping tool
avatar-with-crop.sveltesrc/lib/components/onboarding/Cropped avatar display
goal-card.sveltesrc/lib/components/ongoals/Reusable goal card

File: src/lib/modules/onboarding/schemas/onboarding.ts

onboardingSchema = {
displayName: string // required, non-empty
userName: string // required, 1-15 chars
location: string // required
timeZone: string // required
language: string // required
birthDate: Date // required, 18+ years old
photoURL?: string // optional, image URL
tagline?: string // optional, max 30 chars
aboutMe?: string // optional, max 500 chars
onboardingGoal?: string // optional, selected goal
avatarCrop*?: number // optional, crop parameters
}
  1. Username uniqueness validated
  2. Data saved to Firestore: users/{uid} and profiles/{uid}
  3. onboardingCompleted flag set to true
  4. Dashboard created with template matching selected goal
  5. User redirected to /

The checkOnboardingCompleted() guard in the app layout ensures users who haven’t completed onboarding are redirected back to /onboarding.