Primary backend components
app/api/user/profile/route.tsapp/api/user/onboarding/route.tsapp/api/auth/native-token/route.tsapp/api/mobile/exchange/route.tsserver/onboarding-actions.tsserver/auth-actions.tsserver/mobile-session-actions.tslib/mobile-session-token.tslib/server-auth.tslib/clerk-sync.ts
Core model touchpoints
UserConnectedAccountMobileSession(one-time hex token, consumed on exchange)PointsHistory(onboarding reward write)LeaderboardEntry(global enrollment path from onboarding profile flow)
High-level flow
Architectural notes
- Runtime auth is primarily request-context based and route-gated.
- Profile write flow performs synchronization between auth identity and app user data.
- Onboarding completion can trigger downstream quest progress checks and point history writes.
- Non-admin docs intentionally exclude privileged impersonation and admin user management flows.
