Create a production-ready todo application with enterprise-grade features including authentication, REST API, comprehensive testing, and Kubernetes deployment.
- Framework: React 18+ with TypeScript
- State Management: Redux Toolkit or Zustand for global state
- Routing: React Router v6 for client-side routing
- UI Components: Material-UI (MUI) or Tailwind CSS with HeadlessUI
- Form Handling: React Hook Form with Zod validation
- Authentication: JWT token management with refresh token rotation
- User registration and login pages
- Dashboard with todo list view (grid and list layouts)
- Create, read, update, delete todos with optimistic updates
- Todo categorization with tags/labels
- Priority levels (Low, Medium, High, Urgent)
- Due date picker with overdue highlighting
- Search and filter functionality (by status, priority, tags, date range)
- Bulk operations (mark complete, delete selected)
- Real-time updates using WebSockets or Server-Sent Events
- Dark/light theme toggle
- Responsive design for mobile, tablet, and desktop
- Framework: Node.js with Express or NestJS
- Language: TypeScript
- Database: PostgreSQL with Prisma ORM or TypeORM
- Authentication:
- JWT-based auth with access and refresh tokens
- Password hashing with bcrypt
- Email verification for new accounts
- Password reset functionality
- RESTful endpoints following OpenAPI 3.0 specification
- Pagination, sorting, and filtering support
- Rate limiting per user (100 requests/minute)
- Request validation middleware
- Error handling with consistent error response format
POST /api/auth/register
POST /api/auth/login
POST /api/auth/refresh
POST /api/auth/logout
GET /api/todos (with query params for filtering/pagination)
POST /api/todos
GET /api/todos/:id
PUT /api/todos/:id
DELETE /api/todos/:id
PATCH /api/todos/bulk (for bulk operations)
GET /api/users/profile
PUT /api/users/profile
- id (UUID)
- email (unique)
- password_hash
- first_name
- last_name
- email_verified (boolean)
- created_at
- updated_at
- id (UUID)
- user_id (FK to Users)
- title
- description
- status (pending, in_progress, completed)
- priority (low, medium, high, urgent)
- due_date
- completed_at
- created_at
- updated_at
- id (UUID)
- name
- color
- user_id (FK to Users)
- todo_id (FK to Todos)
- tag_id (FK to Tags)
- Jest for both frontend and backend
- Minimum 80% code coverage
- Test all API endpoints
- Test React components and hooks
- Supertest for API integration tests
- React Testing Library for component integration
- Playwright or Cypress for critical user flows (registration, login, CRUD operations)
- Multi-stage Dockerfile for both frontend and backend
- Docker Compose for local development environment
- Include PostgreSQL, Redis (for sessions/caching), and application services
Create the following K8s resources:
- todo-app
- Frontend (2 replicas, with nginx)
- Backend API (3 replicas)
- PostgreSQL (StatefulSet)
- Redis (StatefulSet)
- Frontend (ClusterIP)
- Backend (ClusterIP)
- PostgreSQL (ClusterIP)
- Redis (ClusterIP)
- Host-based routing for api.example.com and app.example.com
- TLS termination with cert-manager
- Frontend environment variables
- Backend environment variables
- Database credentials
- JWT secrets
- API keys
- Backend API (min: 3, max: 10, target CPU: 70%)
- PostgreSQL data (10Gi)
- Redis data (5Gi)
- Use .env files with validation (dotenv, joi/zod)
- Winston or Pino for structured logging
- Prometheus metrics endpoint
- Helmet.js for security headers
- CORS configuration
- Input sanitization
- SQL injection prevention
- XSS protection
- Swagger/OpenAPI documentation auto-generated from code
- GitHub Actions workflow for testing, building, and deploying
- ESLint, Prettier, Husky pre-commit hooks
todo-app/
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── hooks/
│ │ ├── services/
│ │ ├── store/
│ │ ├── utils/
│ │ └── types/
│ ├── tests/
│ └── Dockerfile
├── backend/
│ ├── src/
│ │ ├── controllers/
│ │ ├── services/
│ │ ├── repositories/
│ │ ├── middlewares/
│ │ ├── validators/
│ │ ├── utils/
│ │ └── types/
│ ├── tests/
│ ├── prisma/
│ └── Dockerfile
├── k8s/
│ ├── base/
│ └── overlays/
│ ├── development/
│ ├── staging/
│ └── production/
├── docker-compose.yml
├── .github/workflows/
└── README.md
Please implement this application step by step:
- Backend API: Start with the database schema, then implement authentication, followed by the todo CRUD operations
- Frontend: Build the authentication flow first, then the todo management interface
- Testing: Write unit tests alongside development, add integration tests after feature completion
- Deployment: Create Docker configurations, then Kubernetes manifests, finally CI/CD pipelines
Ensure all code follows best practices for production applications including:
- Comprehensive error handling
- Structured logging
- Security best practices
- Clean code principles
- SOLID principles
- Proper TypeScript typing
- Accessibility standards (WCAG 2.1 AA)
- Performance optimization
- Caching strategies
The completed application should:
- Handle 1000+ concurrent users
- Maintain sub-200ms API response times
- Achieve 99.9% uptime
- Pass all security audits
- Score 90+ on Lighthouse performance metrics
- Provide comprehensive monitoring and alerting
- Support horizontal scaling
- Include complete documentation for developers and users