Authentication & Onboarding
Relevant source files
The following files were used as context for generating this wiki page:
Authentication and Onboarding serve as the gateway to the TAMV MD-X4™ ecosystem, ensuring secure access and structured entry for users into the digital civilization. The system leverages Supabase Auth for identity management and implements a modular onboarding flow that transitions new users from registration to a functional state within the dashboard and social feed.
The scope of this module covers user registration, login, and the initial setup of the user's digital identity (ID-NVIDA). It is closely integrated with the Economy and Governance systems, as successful onboarding often triggers the initialization of user profiles and wallets.
Sources: E2E_CHECKLIST_TAMV.md:10-12, README_TAMV_COMPLETO.md:14-15
Authentication Architecture
The authentication system is built on a centralized provider (Supabase) using JWT for session management. The frontend routes all authentication requests through a dedicated Auth.tsx page, while the backend utilizes Edge Functions to validate identities.
Core Authentication Flow
The system supports standard email/password registration and login. Upon successful authentication, the user is redirected to the onboarding flow or the main dashboard.
The diagram shows the interaction between the UI, Supabase Auth, and the Unified API to establish user identity.
Sources: supabase/functions/tamv-unified-api/index.ts:38-43, DEPLOYMENT_GUIDE.md:133-140
Security Constraints
Authentication is governed by the Anubis Security system and the QC-TAMV-01 constitutional rules. These ensure that authentication logic is kept separate from business logic.
| Feature | Implementation | Description |
|---|---|---|
| Provider | Supabase Auth | Handles registration, login, and session persistence. |
| Token Type | JWT | Used for secure communication with Edge Functions. |
| Guarding | RouterGuard | Protects routes like /dashboard and /profile. |
| Session Expiry | 3600 seconds | Configurable JWT expiration for session security. |
Sources: src/App.tsx:94-95, DEPLOYMENT_GUIDE.md:133-140, PLAN-TAMV-MODULAR.md:160-165
Onboarding Process
The onboarding process is a multi-step sequence designed to initialize the user's environment. This includes creating a profile, setting up a digital wallet (TCEP), and establishing a presence in the social core.
Onboarding Steps
- Identity Creation: Generation of the
id_nvidarecord in the database. - Consent & Privacy: Handling PI (Personal Information) consent forms.
- Wallet Initialization: Creating a
tcep_walletsentry for TAU credit transactions. - Dashboard Redirection: Finalizing the entry into the main ecosystem.
The flow represents the logic for new vs. returning users during the onboarding phase.
Sources: E2E_CHECKLIST_TAMV.md:10-17, PLAN-TAMV-MODULAR.md:120-125
Data Structures
Onboarding populates several critical tables in the Supabase schema to ensure functional parity across modules.
| Table | Field | Type | Description |
|---|---|---|---|
profiles | role | TEXT | User access level (public, creator, pro, admin). |
id_nvida | dignity_score | INTEGER | Initial reputation metric assigned to users. |
tcep_wallets | balance_credits | NUMERIC | Initial credit balance for the user wallet. |
Sources: DEPLOYMENT_GUIDE.md:80-90, supabase/functions/tamv-unified-api/index.ts:45-48
Implementation Details
API Endpoints
The tamv-unified-api handles identity-related requests through its Identity Module (ID-NVIDA).
- GET
/id/me: Retrieves the current user's full profile and NVIDA data. - GET
/id/dignity: Returns specific reputation and trust level metrics.
Sources: supabase/functions/tamv-unified-api/index.ts:38-48
Client-Side Integration
The App.tsx file defines the routes for authentication and onboarding, ensuring they are accessible globally within the BrowserRouter.
// src/App.tsx:114-115
{/* Auth & Onboarding */}
<Route path="/auth" element={<Auth />} />
<Route path="/onboarding" element={<Onboarding />} />
Sources: src/App.tsx:114-115
Conclusion
Authentication and Onboarding in the TAMV ecosystem are not merely gatekeeping mechanisms but the foundational step for "Civilizatory" participation. By integrating identity (ID-NVIDA) with economic (TCEP) and governance (CITEMESH) readiness from the first login, the system ensures every user enters the digital nexus with a fully initialized state.