[Provide a brief description of the system, its objectives, and its intended users.]
[Provide a high-level diagram illustrating how the entire system interacts with external entities, such as APIs, databases, and user interfaces.]
[Explain the key components and their roles in the system context diagram.]
[Define key external and internal interfaces for the system (e.g., APIs, external services, modules). Describe their contracts and interaction boundaries.]
[List and briefly describe all interfaces.]
[For each interface, define:]
- Inputs: [What the interface expects to receive]
- Outputs: [What the interface provides back]
Example format:
Interface: Payment API
Inputs:
- POST /charge
- amount: number
- currency: string
Outputs:
- 200 OK { success: boolean, transactionId: string }
- 400 Bad Request { error: string }
[Specify technologies, frameworks, and tools chosen for the project, along with justifications for their selection.]
[List chosen languages, frameworks, and libraries, and explain why they were selected.]
Example:
### Frontend
- React Native - Mobile application framework
- Expo - Development platform and tools
- Expo Router - Navigation solution
- Nativewind - Tailwind CSS for React Native
- React Hook Form - Form handling
- Zod - Schema validation
- react-native-async-storage - Local storage management
- expo-secure-store - Secure data storage
- react-native-reusables - UI component library
### Backend
- Supabase - Backend as a Service platform
### Development Tools
- TypeScript - Programming language
- Expo CLI - Command line interface
- ESLint - Code linting
- Prettier - Code formatting
- Babel - JavaScript compiler
[Think about what data the system handles:
- What entities exist? (e.g., User, Report, Comment)
- What are the relationships? (e.g., A Report belongs to a User)
- What fields are important? (e.g., Report = title, content, date)]
[Define the structure of data used by the system, including schemas, entity-relationship diagrams, and data flow descriptions.]
[Outline the database schema with tables, fields, and relationships.]
Example ER diagram format:
User
- id
- name
- email
Report
- id
- userId
- title
- content
- createdAt
[Map how data moves:
- Input → user types/clicks
- Local State → temporarily holds data
- Global/Shared State → shared across components
- Persistence Layer → localStorage, database, API
- UI Update Cycle → re-render on state change]
[Explain how data moves through the system (using mermaid diagram), including transformations, relationships and storage.]
[Decide:
- What needs to be local (inside one component)?
- What needs to be global (shared across app)?
- How is state updated? (events? actions?)]
[General Rule:
- Local = Component’s own small concerns (e.g., form input)
- Global = App-wide concerns (e.g., user login status)]
[Break system into components:
- What components do I need?
- What should they own (state/props)?
- How do they talk (props, context, events)?]
[Provide a diagram showcasing system components and their relationships.]
[List the major subsystems or modules, along with their descriptions.]
Example component tree:
<App>
├── <Header>
├── <Sidebar>
└── <MainContent>
├── <ReportForm>
└── <ReportList>
[Define how system components communicate, including API specifications, protocols, and message formats.]
[List key APIs with request/response structures and authentication mechanisms.]
[Describe expected data formats, payload structures, and validation rules.]
[For each API, define:]
- Inputs: [Request structure, parameters, headers]
- Outputs: [Response structure, status codes, error formats]
Example format:
API: POST /login
Inputs:
- body: { email: string, password: string }
Outputs:
- 200 OK { token: string }
- 401 Unauthorized { error: string }
[Think about what could go wrong:
- Network failure?
- User leaves page halfway?
- Invalid inputs?
- API returns error?]
[Plan defensive code paths and fallback UI (loading states, error banners).]
[Finally:
- How big is the data being loaded?
- Should you lazy-load anything?
- Should you debounce input?
- Should you cache API responses?]
[Think in optimizations after correctness.]
[Optional for bigger apps:
- How to protect user data? (XSS, CSRF, Auth)
- How to grow system cleanly? (modular architecture)]
- Use UML Mermaid diagrams for components, relationships and systems