Skip to main content

Documentation Index

Fetch the complete documentation index at: https://grantmaster.dev/llms.txt

Use this file to discover all available pages before exploring further.

Engineering reference: For service contracts, EventBus events, and data-layer details see src/features/onboarding/onboarding.md.

last_updated: 2026-02-22

Onboarding System

StatusUpdatedCovered Files
🟢 Stable2026-02-22src/features/onboarding/, src/shared/auth/onboardingService.ts

Overview

The Onboarding System is a dual-mechanism system that guides new users through platform setup using two complementary interfaces:
  1. Interactive Tour@onboardjs/react modal overlays that walk users through key UI areas
  2. Dashboard Checklist — Persistent UserOnboardingProgress card on the dashboard showing step completion
Both mechanisms are role-specific, configurable at three tiers (platform → organization → user), and persist state to Firestore.

Architecture

┌─────────────────────────────────────────────────────┐
│  OnboardingProvider                                  │
│  3-tier enable check: platform → org → user         │
│  Wraps @onboardjs/react BaseProvider                │
├─────────────────────────────────────────────────────┤
│  onboardingConfig.ts (single source of truth)       │
│  5 role configs × variable step counts              │
├──────────────────────┬──────────────────────────────┤
│  Interactive Tour    │  Dashboard Checklist          │
│  @onboardjs/react    │  UserOnboardingProgress      │
│  tourEnabled steps   │  All steps (persistent)      │
│  Modal overlay       │  Embedded card widget        │
└──────────────────────┴──────────────────────────────┘

Role Configurations (5)

File: src/features/onboarding/onboardingConfig.ts
RoleStepsTour StepsAccent ColorIcon
Super Admin33primaryShield
Admin94violetSettings
Manager53emeraldUsers
Member53amberUser
Auditor50primarySearch
Tour vs. Checklist: Steps with tourEnabled: true appear in the interactive modal tour. All steps appear in the dashboard checklist regardless of tourEnabled.

Step Structure

interface OnboardingStepConfig {
  id: string;
  title: string;
  description: string;
  whyItMatters: string;
  icon: LucideIcon;
  isRequired: boolean;
  estimatedMinutes: number;
  category: string;
  action?: { label: string; path: string };   // navigation CTA
  tourEnabled: boolean;                        // show in modal tour?
}

Example Steps by Role

Admin (9 steps):
  • Complete organization profile, Configure branding, Set up roles & permissions, Create first project, Configure budgets, Set up compliance rules, Invite team members, Review integrations, Explore AI features
Member (5 steps):
  • Complete your profile, Submit first journal entry, Review assigned projects, Upload a document, Explore the dashboard

3-Tier Enable Check

The OnboardingProvider evaluates three tiers before showing onboarding:
TierSourceControls
PlatformgetPlatformConfig()Global kill switch
Organizationorganization.settings.onboarding.enabledPer-org toggle
UsergetUserOnboarding() / showOnboardingIndividual completion state

Dashboard Checklist

Component: UserOnboardingProgress A dismissible card embedded on the user’s dashboard showing:
  • Role-specific header with accent color gradient
  • Progress bar (completed / total steps)
  • Step list with status indicators (done/pending)
  • “Go” buttons linking to relevant pages
  • “Required” badges on mandatory steps
  • Auto-hides when all steps complete

Accent Color Theming

ColorGradientUsed By
primaryfrom-primary-600 to-primary-700Super Admin, Auditor
violetfrom-violet-600 to-violet-700Admin
emeraldfrom-emerald-600 to-emerald-700Manager
amberfrom-amber-600 to-amber-700Member

Dismiss Behavior

  • Users can dismiss the checklist via the X button
  • Dismiss state persists in localStorage keyed by user ID
  • Checklist auto-hides when all steps are completed
  • Super Admins skip the user checklist (they have AdminOnboardingChecklist)

Persistence

Service: src/shared/auth/onboardingService.ts
FunctionPurpose
getUserOnboarding(userId, orgId)Fetch current onboarding state from Firestore
completeUserOnboarding(userId, orgId)Mark onboarding as fully completed
State is stored per user per organization, allowing different onboarding progress across multi-org users.

Components

ComponentDescription
OnboardingProviderContext provider wrapping @onboardjs/react
UserOnboardingProgressDashboard checklist card
AdminOnboardingChecklistSuperAdmin-specific onboarding panel
BaseStepReusable step rendering component

Accessor Functions

FunctionReturns
getRoleOnboardingConfig(role)Full config for a role (label, icon, accent, steps)
getOnboardingChecklistForRole(role)All steps for the dashboard checklist
getOnboardingFlowForRole(role)Only tourEnabled steps for the modal tour

Tenant Provisioning Wizard

TenantOnboardingWizard is a linear multi-step form used by admins to configure a new organization from scratch:
  1. BasicInfoStep — org name, type
  2. LegalEntityStep — legal registration details
  3. BrandingStep — logo and colors
  4. LocaleTimezoneStep — currency, timezone, language
  5. SecurityStep — MFA policy, password rules
  6. IntegrationsStep — optional third-party connections
  7. TeamInvitationsStep — invite initial team members
  8. SubscriptionStep — select plan
  9. ReviewLaunchStep — confirm and activate

Authentication Flows

The onboarding feature also covers authentication-related pages:
ComponentDescription
Auth.tsxLogin / register page
AcceptInvitationPageHandles user invite tokens via useInvitationAcceptance hook
PartnerInvitationPagePartner organization invitation acceptance
SetPasswordPagePost-invite password setup
EmailVerificationPageEmail address confirmation

MFA Setup

SetupMFA -> VerifyMFA -> RecoveryCodes — three-step flow for enabling TOTP-based multi-factor authentication. Recovery codes are displayed once and must be saved by the user.

Firestore Data Model

CollectionDocument typeDescription
employees/{userId}UseronboardingCompleted: boolean, onboardingProgress: string[]
organizations/{id}OrganizationSet up during tenant onboarding wizard

Dependencies

Depends on:
  • @onboardjs/react — interactive tour modal engine
  • contexts/AuthContext — current user and role
  • features/users — user document updates for progress tracking
  • features/settings — settings routes referenced in step actions
  • features/billing — subscription step in tenant wizard
Depended on by:
  • App shell — OnboardingProvider wraps the root layout
  • AdminOnboardingChecklist is rendered in the admin area

Key Files Reference

FilePurpose
src/features/onboarding/onboardingConfig.tsRole configs, step definitions, accessor functions
src/features/onboarding/OnboardingProvider.tsx3-tier enable check, @onboardjs/react integration
src/features/onboarding/components/UserOnboardingProgress.tsxDashboard checklist widget
src/features/onboarding/components/AdminOnboardingChecklist.tsxSuperAdmin onboarding panel
src/features/onboarding/components/BaseStep.tsxReusable step component
src/features/onboarding/components/LegalDocs.tsxTerms/privacy acceptance
src/features/onboarding/components/MFA/SetupMFA, VerifyMFA, RecoveryCodes
src/features/onboarding/components/pages/Auth.tsxLogin / register
src/features/onboarding/components/pages/AcceptInvitationPage.tsxInvite token acceptance
src/features/onboarding/components/pages/TenantOnboardingWizard.tsxMulti-step org setup wizard
src/features/onboarding/hooks/useInvitationAcceptance.tsInvite token validation and acceptance
src/shared/auth/onboardingService.tsFirestore persistence (get/complete)