Home Domain
This domain covers the public landing page for the root route
(/) implemented under
frontend/src/pages/home.
1️⃣ Domain Purpose
The Home domain is a thin entry hub that: - redirects
authenticated users straight into the app
(/dashboard) - gives unauthenticated users two
clear paths: - Sign in → /login -
Continue in Demo Mode → starts a client-only
demo session and continues into the app
It intentionally keeps the unauthenticated UI minimal and avoids any direct backend calls.
2️⃣ Scope & Boundaries
Included: - Home.tsx (root landing page
orchestrator) - Redirect behavior based on auth state
(useAuth(): { user, loading }) - Demo entry via
useAuth().loginAsDemo() - Public-route placement
(outside AppShell)
Excluded: - Login UI + OAuth redirect: see Auth domain - Auth state and hydration rules: see Auth Context - Routing topology: see Routing - App chrome (AppBar/Drawer/Main): see App Shell
3️⃣ High-Level Diagram
4️⃣ Domain Notes (Implementation-facing)
Homeis a pure UI router:- no HTTP requests
- no React Query usage
- only depends on the
AuthContextstate and actions
- Auth bootstrap is respected:
- while
loading=true,Homerenders a spinner to avoid flicker/incorrect redirects.
- while
- Demo entry behavior:
loginAsDemo()persists a demo user inlocalStorageso deep-links and refreshes remain usable.- After starting demo, the app route entry is the same as real
users:
/dashboard.
5️⃣ Domain Map (Deep-dives)
Leaf docs for how Home works:
Related ADRs
- ADR-0005: Application shell split (authenticated vs public)
- ADR-0006: Global state with Context modules (Auth)