System Domain
This domain covers “system-level” pages that exist outside business workflows, such as the global 404 fallback.
1️⃣ Domain Purpose
The System domain provides a safe, neutral UX for unexpected
navigation states: - When a user navigates to an unknown route,
show a simple 404 page. - Offer a clear next step: -
authenticated users → go back to /dashboard -
unauthenticated users → go to /login
2️⃣ Scope & Boundaries
Included: - NotFoundPage.tsx (generic 404) -
Router fallback wiring (Route path="*") - “Next
step” decision logic based on useAuth().user
Excluded: - Public landing page behavior: see Home domain - Login/callback/logout flows: see Auth domain - Global route structure and shells: see Routing and App Shell
3️⃣ High-Level Diagram
flowchart TD
Unknown[Unknown URL] --> Router[AppRouter.tsx]
Router --> Star[Route path="*"
(NotFoundPage)]
Star --> Auth{useAuth().user?}
Auth -->|yes| Dash[Button → /dashboard]
Auth -->|no| Login[Button → /login]
Star --> I18n[i18n copy
(system/common/auth namespaces)]
4️⃣ Domain Notes (Implementation-facing)
- The 404 page is intentionally lightweight:
- no React Query usage
- no HTTP calls
- no shell dependencies (it’s reachable as a public fallback)
- Copy is internationalized via
react-i18next:- uses the
systemnamespace for title/body - uses
commonandauthfor button labels (dashboard vs sign-in)
- uses the
- The “next step” button uses a single decision:
- if
userexists, route to/dashboard - otherwise route to
/login
- if
5️⃣ Domain Map (Deep-dives)
Related ADRs
- ADR-0005: Application shell split (authenticated vs public)
- ADR-0001: Frontend folder structure strategy