A full-stack productivity platform with gamification features, built with React, Node.js, Apollo GraphQL, and PostgreSQL.
- Task management with priorities, categories, and due dates
- Gamification system (XP, levels, streaks, achievements)
- Pomodoro timer
- Project organization
- Template system for recurring tasks
- Dark mode support
- Real-time analytics
| Frontend | Backend |
|---|---|
| React 18 | Node.js |
| TypeScript | Apollo Server |
| Apollo Client | GraphQL |
| Tailwind CSS | PostgreSQL (Prisma) |
| DnD Kit | Redis (optional) |
- Node.js >= 20.0.0
- PostgreSQL 14+
- npm or yarn
- (Optional) Redis for caching
git clone <repository-url>
cd todo_app
npm installCopy the example environment file:
cp backend/.env.example backend/.envEdit backend/.env with your configuration:
# Database
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/taskflow?schema=public"
# Redis (optional)
REDIS_URL="redis://localhost:6379"
# JWT (minimum 32 characters)
JWT_SECRET="your-super-secret-jwt-key-change-in-production"
JWT_REFRESH_SECRET="your-super-secret-refresh-key-change-in-production"
# Server
PORT=4000
NODE_ENV=development
CORS_ORIGIN="http://localhost:3000"
# Sentry (optional)
SENTRY_DSN=""# Generate Prisma client
npm run prisma:generate
# Run migrations
npm run prisma:migrate
# (Optional) Seed database
npm run db:seed# Start both frontend and backend
npm run dev- Frontend: http://localhost:3000
- Backend GraphQL: http://localhost:4000/graphql
- Health Check: http://localhost:4000/health
| Script | Description |
|---|---|
npm run dev |
Start both frontend and backend in development mode |
npm run frontend |
Start only the frontend |
npm run backend |
Start only the backend |
npm run build |
Build both workspaces for production |
npm run test |
Run all tests |
npm run lint |
Run ESLint |
npm run format |
Format code with Prettier |
npm run typecheck |
Run TypeScript type checking |
| Script | Description |
|---|---|
npm run prisma:generate |
Generate Prisma client |
npm run prisma:migrate |
Run database migrations |
npm run prisma:studio |
Open Prisma Studio GUI |
npm run db:seed |
Seed database with sample data |
# Start PostgreSQL and Redis
npm run docker:up
# Stop containers
npm run docker:downtodo_app/
├── frontend/ # React frontend
│ ├── src/
│ │ ├── components/ # UI components
│ │ ├── contexts/ # React contexts
│ │ ├── hooks/ # Custom hooks
│ │ ├── graphql/ # GraphQL queries/mutations
│ │ ├── utils/ # Utility functions
│ │ └── __tests__/ # Test files
│ └── package.json
│
├── backend/ # Node.js backend
│ ├── src/
│ │ ├── resolvers/ # GraphQL resolvers
│ │ ├── schema/ # GraphQL type definitions
│ │ ├── services/ # Business logic layer
│ │ ├── repositories/ # Data access layer
│ │ ├── validators/ # Input validation (Zod)
│ │ ├── dataloaders/ # N+1 query prevention
│ │ ├── routes/ # Express routes (health checks)
│ │ ├── config/ # Configuration
│ │ ├── utils/ # Utilities (logger, sentry)
│ │ └── __tests__/ # Test files
│ ├── prisma/ # Database schema
│ └── package.json
│
├── .husky/ # Git hooks
├── .eslintrc.js # Shared ESLint config
├── .prettierrc # Prettier config
└── package.json # Root package with workspaces
npm run test# Backend tests
cd backend && npm test
# Frontend tests
cd frontend && npm test- Backend: 53 tests (services, repositories, validators)
- Frontend: 126 tests (components, hooks, utilities)
Request → Resolver → Service → Repository → Prisma → Database
↓
DataLoader (caching)
↓
Validators (Zod)
- Repository Pattern: Data access abstraction
- Service Layer: Business logic isolation
- DataLoader: N+1 query prevention
- Input Validation: Zod schemas for all inputs
| Endpoint | Purpose |
|---|---|
GET /health |
Basic health check (uptime, timestamp) |
GET /ready |
Readiness probe (database connectivity) |
GET /live |
Liveness probe (for Kubernetes) |
| Variable | Required | Description |
|---|---|---|
DATABASE_URL |
Yes | PostgreSQL connection string |
JWT_SECRET |
Yes | JWT signing secret (min 32 chars) |
JWT_REFRESH_SECRET |
Yes | Refresh token secret (min 32 chars) |
PORT |
No | Server port (default: 4000) |
NODE_ENV |
No | Environment (development/production) |
CORS_ORIGIN |
No | Allowed CORS origin |
REDIS_URL |
No | Redis connection string |
SENTRY_DSN |
No | Sentry error tracking DSN |
LOG_LEVEL |
No | Log level (debug/info/warn/error) |
# Kill process on port 3000
lsof -ti:3000 | xargs kill -9
# Kill process on port 4000
lsof -ti:4000 | xargs kill -9- Ensure PostgreSQL is running
- Check
DATABASE_URLin.env - Run
npm run prisma:migrateto create tables
# Clean install
rm -rf node_modules package-lock.json
npm install# Regenerate Prisma client
npm run prisma:generate
# Check types
npm run typecheck- Create a feature branch
- Make changes with tests
- Run
npm run lintandnpm run test - Submit a pull request
Pre-commit hooks will automatically:
- Format code with Prettier
- Run linting checks
MIT