Standard Implementation Workflow
This is the standard, ordered implementation plan for developing new features in TwinMail. Use the AI tools to generate specific instructions for each step.
1. Backend Implementation (NestJS)
- Define new entities and update database schema.
- Create or update services with business logic.
- Expose new endpoints in controllers.
- Implement authentication and authorization checks.
- Add jobs to BullMQ for asynchronous tasks.
2. Frontend Development (React)
- Build new UI components using Shadcn/UI.
- Manage state with Zustand stores.
- Fetch data using React Query, calling backend endpoints.
- Handle real-time updates with Socket.IO.
- Ensure responsive design and accessibility.
3. Database Migrations (Prisma/SQL)
- Generate migration files for schema changes.
- Write `up` and `down` migration scripts for safety.
- Test migrations in a staging environment.
- Consider data backfills for existing records.
4. Testing (Unit, Integration, E2E)
- Write unit tests for new services and logic.
- Create integration tests for API endpoints.
- Develop end-to-end tests for user flows.
- Ensure tests meet TwinMail's code coverage goals.