Skip to content

Instantly share code, notes, and snippets.

@karstengresch
Created September 10, 2025 18:13
Show Gist options
  • Save karstengresch/71f0bdebb1f3cfd7e1b93c0bec645eef to your computer and use it in GitHub Desktop.
Save karstengresch/71f0bdebb1f3cfd7e1b93c0bec645eef to your computer and use it in GitHub Desktop.
Example: More detailed prompt

Full-Stack Todo Application with Enterprise Features

Project Overview

Create a production-ready todo application with enterprise-grade features including authentication, REST API, comprehensive testing, and Kubernetes deployment.

Frontend Requirements

Technology Stack

  • 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

Features

  • 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

Backend Requirements

Technology Stack

  • 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

API Design

  • 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

API Endpoints

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

Database Schema

Users Table

- id (UUID)
- email (unique)
- password_hash
- first_name
- last_name
- email_verified (boolean)
- created_at
- updated_at

Todos Table

- 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

Tags Table

- id (UUID)
- name
- color
- user_id (FK to Users)

TodoTags Junction Table

- todo_id (FK to Todos)
- tag_id (FK to Tags)

Testing Requirements

Unit Tests

  • Jest for both frontend and backend
  • Minimum 80% code coverage
  • Test all API endpoints
  • Test React components and hooks

Integration Tests

  • Supertest for API integration tests
  • React Testing Library for component integration

E2E Tests

  • Playwright or Cypress for critical user flows (registration, login, CRUD operations)

DevOps & Deployment

Docker Configuration

  • Multi-stage Dockerfile for both frontend and backend
  • Docker Compose for local development environment
  • Include PostgreSQL, Redis (for sessions/caching), and application services

Kubernetes Manifests

Create the following K8s resources:

Namespace

  • todo-app

Deployments

  • Frontend (2 replicas, with nginx)
  • Backend API (3 replicas)
  • PostgreSQL (StatefulSet)
  • Redis (StatefulSet)

Services

  • Frontend (ClusterIP)
  • Backend (ClusterIP)
  • PostgreSQL (ClusterIP)
  • Redis (ClusterIP)

Ingress

  • Host-based routing for api.example.com and app.example.com
  • TLS termination with cert-manager

ConfigMaps

  • Frontend environment variables
  • Backend environment variables

Secrets

  • Database credentials
  • JWT secrets
  • API keys

HorizontalPodAutoscaler

  • Backend API (min: 3, max: 10, target CPU: 70%)

PersistentVolumeClaims

  • PostgreSQL data (10Gi)
  • Redis data (5Gi)

Additional Requirements

Environment Configuration

  • Use .env files with validation (dotenv, joi/zod)

Logging

  • Winston or Pino for structured logging

Monitoring

  • Prometheus metrics endpoint

Security

  • Helmet.js for security headers
  • CORS configuration
  • Input sanitization
  • SQL injection prevention
  • XSS protection

API Documentation

  • Swagger/OpenAPI documentation auto-generated from code

CI/CD

  • GitHub Actions workflow for testing, building, and deploying

Code Quality

  • ESLint, Prettier, Husky pre-commit hooks

Project Structure

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

Implementation Instructions

Please implement this application step by step:

  1. Backend API: Start with the database schema, then implement authentication, followed by the todo CRUD operations
  2. Frontend: Build the authentication flow first, then the todo management interface
  3. Testing: Write unit tests alongside development, add integration tests after feature completion
  4. 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

Success Criteria

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment