New Frontend Page
Create a new page $ARGUMENTS[0] with domain prefix $ARGUMENTS[1].
Prerequisites
Read frontend/src/ARCHITECTURE.md and an existing page for reference.
Naming Convention
Page prefix determines the domain:
- •S: Settings/System
- •D: Daily
- •N: Notes
- •T: Task
- •R: Routine
- •A: Analytics/AI
- •O: Observability
Example: /new-page GoalDashboard A → creates A03_GoalDashboard
Steps
- •
Determine page number: Check existing pages in
frontend/src/pages/for the next available number in the prefix. - •
Create page component in
frontend/src/pages/{Prefix}{NN}_{PageName}.tsx:- •Import from
@/components/ui/and@/stores/ - •Use Zustand stores for state
- •Follow existing page patterns
- •Import from
- •
Add route in
frontend/src/App.tsx:- •Add inside the protected route group
- •Use lowercase kebab-case path
- •
Add sidebar navigation in
frontend/src/components/layout/Sidebar.tsx:- •Add navigation item with Lucide icon
- •
Create/update Zustand store if new state is needed:
- •Place in
frontend/src/stores/ - •Use
createCrudStorefactory for standard CRUD - •Or create custom store following existing patterns
- •Place in
- •
Create API service if new endpoints:
- •Place in
frontend/src/api/services/ - •Use
createApiServicefactory - •Follow response envelope unwrapping pattern
- •Place in
- •
Add MSW handler in
frontend/src/mocks/handlers/for development
After Creation
- •Run
cd frontend && npm run buildto verify TypeScript compilation - •Update
frontend/src/ARCHITECTURE.mdrouting section and page naming table