Documentation Index
Fetch the complete documentation index at: https://grantmaster.dev/llms.txt
Use this file to discover all available pages before exploring further.
Feature Development Checklist
Step-by-step checklist for adding a new feature end-to-end. Canonical example:src/features/expenses/.
Checklist
1. Folder Structure
Create the feature directory with standard subfolders:2. Barrel Export
Createsrc/features/[name]/index.ts exporting only the public API:
3. Types
Createsrc/features/[name]/types/[name].types.ts:
- Define the core entity type
- Add Zod schemas for validation (read schema with graceful degradation, write schema strict)
- Export from barrel
4. Firestore Collection
Add typed collection reference insrc/core/firestoreCollections.ts.
Reminder: Collection names may not match the domain concept — see Common Gotchas.
5. Service
Createsrc/features/[name]/services/[Name]Service.ts:
6. Context Provider
Createsrc/features/[name]/[Name]Context.tsx:
- Use React Context for feature-level state
- Use React Query for server state
- Export
useMyFeature()hook for consuming components
7. Page Component
Create page insrc/features/[name]/components/pages/[Name]Page.tsx:
8. Route Registration
Add route in the appropriate file undersrc/routes/config/:
9. Navigation
Add sidebar nav item insrc/components/layout/navConfig.ts with path, label, icon, and optional permission.
10. Modal Registration
Createsrc/features/[name]/modals.registry.ts:
11. EventBus Events
Emit events from services for significant state changes:- Approval/rejection workflows
- Entity lifecycle (created, archived, deleted)
- Critical thresholds (budget limits, deadlines)
- Compliance events
12. Provider Hierarchy
If your feature needs a context provider at the app level:- Add to the appropriate tier (usually FeatureProviders)
- Wrap at the route level if the provider is route-scoped
13. Unit Tests
Create colocated test files:src/features/[name]/services/[Name]Service.test.ts
- 60% coverage threshold
- Use Vitest with jsdom environment for DOM testing
- Run:
npm run test
14. Feature Documentation
Createsrc/features/[name]/[name].md with:
- Purpose and overview
- Data model (Firestore collections, TypeScript types)
- Key behaviors
- Service contracts
- EventBus events (emitted and consumed)
- Dependencies and file structure
src/features/expenses/expenses.md.