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
| Status | Updated | Covered Files |
|---|
| 🟢 Stable | 2026-02-22 | src/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:
- Interactive Tour —
@onboardjs/react modal overlays that walk users through key UI areas
- 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
| Role | Steps | Tour Steps | Accent Color | Icon |
|---|
| Super Admin | 3 | 3 | primary | Shield |
| Admin | 9 | 4 | violet | Settings |
| Manager | 5 | 3 | emerald | Users |
| Member | 5 | 3 | amber | User |
| Auditor | 5 | 0 | primary | Search |
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:
| Tier | Source | Controls |
|---|
| Platform | getPlatformConfig() | Global kill switch |
| Organization | organization.settings.onboarding.enabled | Per-org toggle |
| User | getUserOnboarding() / showOnboarding | Individual 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
| Color | Gradient | Used By |
|---|
primary | from-primary-600 to-primary-700 | Super Admin, Auditor |
violet | from-violet-600 to-violet-700 | Admin |
emerald | from-emerald-600 to-emerald-700 | Manager |
amber | from-amber-600 to-amber-700 | Member |
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
| Function | Purpose |
|---|
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
| Component | Description |
|---|
OnboardingProvider | Context provider wrapping @onboardjs/react |
UserOnboardingProgress | Dashboard checklist card |
AdminOnboardingChecklist | SuperAdmin-specific onboarding panel |
BaseStep | Reusable step rendering component |
Accessor Functions
| Function | Returns |
|---|
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:
- BasicInfoStep — org name, type
- LegalEntityStep — legal registration details
- BrandingStep — logo and colors
- LocaleTimezoneStep — currency, timezone, language
- SecurityStep — MFA policy, password rules
- IntegrationsStep — optional third-party connections
- TeamInvitationsStep — invite initial team members
- SubscriptionStep — select plan
- ReviewLaunchStep — confirm and activate
Authentication Flows
The onboarding feature also covers authentication-related pages:
| Component | Description |
|---|
Auth.tsx | Login / register page |
AcceptInvitationPage | Handles user invite tokens via useInvitationAcceptance hook |
PartnerInvitationPage | Partner organization invitation acceptance |
SetPasswordPage | Post-invite password setup |
EmailVerificationPage | Email 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
| Collection | Document type | Description |
|---|
employees/{userId} | User | onboardingCompleted: boolean, onboardingProgress: string[] |
organizations/{id} | Organization | Set 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
| File | Purpose |
|---|
src/features/onboarding/onboardingConfig.ts | Role configs, step definitions, accessor functions |
src/features/onboarding/OnboardingProvider.tsx | 3-tier enable check, @onboardjs/react integration |
src/features/onboarding/components/UserOnboardingProgress.tsx | Dashboard checklist widget |
src/features/onboarding/components/AdminOnboardingChecklist.tsx | SuperAdmin onboarding panel |
src/features/onboarding/components/BaseStep.tsx | Reusable step component |
src/features/onboarding/components/LegalDocs.tsx | Terms/privacy acceptance |
src/features/onboarding/components/MFA/ | SetupMFA, VerifyMFA, RecoveryCodes |
src/features/onboarding/components/pages/Auth.tsx | Login / register |
src/features/onboarding/components/pages/AcceptInvitationPage.tsx | Invite token acceptance |
src/features/onboarding/components/pages/TenantOnboardingWizard.tsx | Multi-step org setup wizard |
src/features/onboarding/hooks/useInvitationAcceptance.ts | Invite token validation and acceptance |
src/shared/auth/onboardingService.ts | Firestore persistence (get/complete) |