This document outlines all the features and components that need to be implemented for the Stellar Uzima Backend.
- JWT Strategy implementation
- Password hashing with bcrypt
- Login endpoint
- Register endpoint
- Refresh token endpoint
- Logout endpoint
- Change password endpoint
- Forgot password flow
- Email verification
- Auth guards (JWT, Role-based)
- Auth interceptors
- Tests for auth service and controller
Status: Foundation created, implementation pending
Files to create/update:
src/modules/auth/strategies/jwt.strategy.tssrc/modules/auth/guards/jwt.guard.tssrc/modules/auth/dtos/login.dto.tssrc/modules/auth/dtos/register.dto.tssrc/modules/auth/auth.service.ts(implementation)test/auth.service.spec.ts
- User entity with all fields
- Get user profile endpoint
- Update user profile endpoint
- Delete user account endpoint
- Get user preferences
- Update user preferences
- User search functionality
- User roles and permissions
- Account activation/deactivation
- Tests for users service and controller
Status: Foundation created, implementation pending
Files to create/update:
src/database/entities/user.entity.tssrc/modules/users/dtos/create-user.dto.tssrc/modules/users/dtos/update-user.dto.tssrc/modules/users/dtos/user-profile.dto.tssrc/modules/users/users.service.ts(implementation)test/users.service.spec.ts
- HealthTask entity
- Get all health tasks
- Get health task by ID
- Create health task
- Update health task
- Delete health task
- Mark task as complete
- Get task statistics
- Filter tasks by category/status
- Task progress tracking
- Task reminders scheduling
- Task history/audit logs
- Tests for health tasks service and controller
Status: Foundation created, implementation pending
Files to create/update:
src/database/entities/health-task.entity.tssrc/modules/health-tasks/enums/task-status.enum.tssrc/modules/health-tasks/enums/task-category.enum.tssrc/modules/health-tasks/enums/task-priority.enum.tssrc/modules/health-tasks/dtos/create-health-task.dto.tssrc/modules/health-tasks/dtos/update-health-task.dto.tssrc/modules/health-tasks/health-tasks.service.ts(implementation)test/health-tasks.service.spec.ts
- Database connection configuration
- TypeORM setup
- Initial migration (create all tables)
- Seed data script
- Database utilities and helpers
- Connection pooling setup
- Query logging (development)
- Database health check
Status: Foundation created, partial implementation
Files to create/update:
src/database/migrations/001_initial.tssrc/database/seeds/seed.service.tssrc/database/database.service.ts
- JWT Authentication Guard
- Role-based access control (RBAC) guard
- Permission-based guard
- API key guard
- Rate limiting guard
- Tests for guards
Status: Structure created, implementation pending
Files to create/update:
src/common/guards/jwt.guard.tssrc/common/guards/roles.guard.tssrc/common/guards/permission.guard.tssrc/common/guards/rate-limit.guard.ts
- Response transformation interceptor
- Error handling interceptor
- Logging interceptor
- Performance monitoring interceptor
- Request timing interceptor
- Tests for interceptors
Status: Structure created, implementation pending
Files to create/update:
src/common/interceptors/response.interceptor.tssrc/common/interceptors/error.interceptor.tssrc/common/interceptors/logging.interceptor.ts
- Global exception filter
- HTTP exception filter
- Validation exception filter
- Database exception filter
- Tests for filters
Status: Structure created, implementation pending
Files to create/update:
src/common/filters/http-exception.filter.tssrc/common/filters/validation-exception.filter.tssrc/common/filters/database-exception.filter.ts
- Validation pipe (global)
- Transformation pipe
- Parse UUID pipe
- Parse enum pipe
- Custom pipes as needed
- Tests for pipes
Status: Structure created, implementation pending
Files to create/update:
src/common/pipes/validation.pipe.tssrc/common/pipes/transform.pipe.ts
- @Auth() decorator
- @Roles() decorator
- @Permission() decorator
- @Public() decorator
- @RateLimit() decorator
- @ApiResponse() decorators
- Tests for decorators
Status: Structure created, implementation pending
Files to create/update:
src/common/decorators/auth.decorator.tssrc/common/decorators/roles.decorator.tssrc/common/decorators/permission.decorator.tssrc/common/decorators/public.decorator.ts
- Date/time utilities
- String utilities
- Validation utilities
- Error handling utilities
- Pagination helpers
- Response formatting utilities
- Logger utility setup
- Tests for utilities
Status: Structure created, implementation pending
Files to create/update:
src/common/utils/date.util.tssrc/common/utils/string.util.tssrc/common/utils/pagination.util.tssrc/common/utils/logger.util.ts
- Generic response DTO
- Error response DTO
- Pagination DTO
- Filter DTO
- Sort DTO
- Tests for DTOs
Status: Structure created, implementation pending
Files to create/update:
src/common/dtos/response.dto.tssrc/common/dtos/pagination.dto.tssrc/common/dtos/error.dto.ts
- Email configuration
- Send email template
- Verification email
- Password reset email
- Notification emails
- Tests for mail service
Files to create:
src/shared/mail/mail.service.tssrc/shared/mail/mail.module.tssrc/shared/mail/templates/
- In-app notifications
- Push notifications
- Email notifications
- SMS notifications (optional)
- Notification preferences
- Tests for notification service
Files to create:
src/shared/notifications/notification.service.tssrc/shared/notifications/notification.module.ts
- Custom logger setup
- Structured logging
- Log levels
- Integration with monitoring service
- Tests for logger
Files to create:
src/shared/logger/logger.service.tssrc/shared/logger/logger.module.ts
- JWT token blacklist
- Rate limiting
- CORS configuration
- Helmet for HTTP headers
- Input validation & sanitization
- SQL injection prevention
- XSS prevention
- CSRF protection
- Password strength requirements
- Session management
Files to update:
src/main.ts- Add security middlewaresrc/app.module.ts- Configure security
- API documentation with Swagger/OpenAPI
- Setup Swagger decorators on all endpoints
- Database schema documentation
- Architecture documentation
- Development workflow guide
- Deployment guide
- Troubleshooting guide
- API changelog
Files to create/update:
src/main.ts- Swagger setupDEPLOYMENT.mdARCHITECTURE.mdCHANGELOG.md
- Unit test setup for all services
- Integration test setup
- E2E test setup
- Mock data factory
- Test database setup
- Coverage reporting
- Tests for all modules
Files to create/update:
jest.config.js- Update test configurationtest/fixtures/- Test datatest/factories/- Test factories
- Docker setup (already created)
- Docker Compose (already created)
- GitHub Actions CI/CD pipeline
- Environment-specific configurations
- Database backup strategy
- Logging and monitoring setup
- Error tracking (Sentry integration)
- Performance monitoring
- Health check endpoint
Files to create/update:
.github/workflows/ci.yml.github/workflows/deploy.ymldocker-compose.prod.yml
- Database query optimization
- Caching strategy (Redis)
- API response compression
- Request deduplication
- Batch operations
- Pagination optimization
- Database indexing strategy
- Query analysis and monitoring
- Health Records Module
- Appointments Module
- Medications Module
- Lab Results Module
- Documents/Files Module
- Reports & Analytics Module
- Admin Panel Module
- Settings Module
- Integration Module (for third-party services)
- Project structure created
- Package.json configured
- TypeScript configuration
- ESLint configuration
- Prettier configuration
- Jest configuration
- NestJS CLI configuration
- Docker setup
- Environment variables template
- Base documentation (README, CONTRIBUTOR_GUIDE)
- GitHub repository setup
- GitHub branch protection rules
- GitHub Actions workflows
- Issue templates
- Pull request template
- Code owners file
- Lint checks on PR
- Run tests on PR
- Code coverage reporting
- Build verification
- Security scanning
- Auto-deploy to staging
- Manual approval for production
- Database migration verification
- Health check after deployment
- CORS configuration
- API documentation complete
- Error response standardization
- Pagination standardization
- Filter/search standardization
- Authentication flow finalized
- API versioning strategy
- Database module & migrations
- User authentication (auth module)
- User management (users module)
- Security setup (guards, pipes, filters)
- Error handling & logging
- Tests
- Health tasks module
- Health records module
- API documentation (Swagger)
- Common decorators & utilities
- Email service
- Performance optimization
- Notification service
- Admin module
- Analytics
- Caching strategy
- Advanced features
-
Start with Authentication
- Implement JWT strategy
- Create login/register endpoints
- Add auth guards
-
Setup Database
- Create migrations
- Define all entities
- Setup seeders
-
Implement Users Module
- User CRUD operations
- User preferences
-
Add Common Components
- Pipes, guards, interceptors
- Error handling
- Logging
-
Implement Business Modules
- Health tasks
- Health records
- Other domain modules
-
Add Documentation & Testing
- Swagger docs
- Unit tests
- E2E tests
-
Setup DevOps
- CI/CD pipeline
- Monitoring
- Logging
Refer to:
- CONTRIBUTOR_GUIDE.md
- README.md
- Module-specific READMEs in
src/modules/*/README.md