A production-like task management platform built with Node.js, Express, TypeScript, React, and Next.js.
This project follows a modular architecture inspired by NestJS, with clear separation of concerns:
- Modules: Feature-based organization (Auth, Users, Projects, Tasks, Reports)
- Controllers: Handle HTTP requests/responses
- Services: Business logic
- Repositories: Database access layer
- DTOs: Request/response validation
- Node.js (LTS version - 18.x or higher)
- Docker and Docker Compose
- npm or yarn
-
Clone the repository and install dependencies:
npm run install:all
-
Start infrastructure services (PostgreSQL + Redis):
cd docker docker-compose up -dThis will start:
- PostgreSQL on port 5432
- Redis on port 6379
-
Set up environment variables:
Backend:
cd backend cp .env.sample .envEdit
backend/.envand ensure:DATABASE_URLpoints to your PostgreSQL instanceJWT_SECRETis set to a secure random string (useopenssl rand -base64 32to generate)GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET(optional, for OAuth)REDIS_HOSTandREDIS_PORTmatch your Redis instanceFRONTEND_URLis set tohttp://localhost:3000
Frontend:
cd frontend cp .env.sample .env.localEdit
frontend/.env.localand set:NEXT_PUBLIC_API_URL=http://localhost:3001/api
-
Run database migrations:
cd backend npx prisma migrate dev npx prisma generate -
Start the backend (in one terminal):
npm run dev:backend
The backend will run on
http://localhost:3001 -
Start the frontend (in another terminal):
npm run dev:frontend
The frontend will run on
http://localhost:3000 -
Start the worker (optional, in another terminal):
npm run dev:worker
This processes background jobs for report generation.
taskflow-pro/
├── backend/ # Express + TypeScript backend
│ ├── src/
│ │ ├── modules/ # Feature modules (auth, users, projects, tasks, reports)
│ │ ├── common/ # Shared utilities (errors, middleware, logger)
│ │ ├── config/ # Configuration
│ │ └── infra/ # Infrastructure (DB, Redis, Workers)
│ ├── tests/ # Test files
│ ├── prisma/ # Prisma schema and migrations
│ └── package.json
├── frontend/ # Next.js 14 App Router frontend
│ ├── src/
│ │ ├── app/ # Next.js app router pages
│ │ └── lib/ # Utilities (API client, auth helpers)
│ └── package.json
├── docker/ # Docker Compose configuration
│ └── docker-compose.yml
└── README.md
Run backend tests:
cd backend
npm testRun tests in watch mode:
npm run test:watchRun tests with coverage:
npm run test:coverage- ✅ JWT Authentication (access + refresh tokens)
- ✅ Google OAuth 2.0
- ✅ Token refresh mechanism
- ✅ Protected routes with middleware
- ✅ Create, read, update, delete projects
- ✅ Add/remove project members
- ✅ Soft delete projects
- ✅ Pagination and filtering
- ✅ Full CRUD operations for tasks
- ✅ Task status workflow (TODO → IN_PROGRESS → DONE)
- ✅ Task assignments
- ✅ Tags and due dates
- ✅ File attachments (metadata + URLs)
- ✅ Kanban-style board view
- ✅ Generate weekly/monthly reports
- ✅ Background job processing with Worker Threads
- ✅ Redis queue for job management
- ✅ Project summary with caching
- ✅ Redis caching for expensive endpoints
- ✅ Rate limiting (global and per-endpoint)
- ✅ Security best practices (helmet, CORS, input validation)
- ✅ Structured logging with Pino
- ✅ Error handling middleware
- ✅ Event Loop demonstration endpoint (
/debug/event-loop)
Backend:
- Node.js + TypeScript
- Express.js
- Prisma ORM
- PostgreSQL
- Redis (caching + rate limiting + job queue)
- JWT + OAuth 2.0 (Passport.js)
- Worker Threads for background processing
- Jest for testing
Frontend:
- Next.js 14 (App Router)
- React + TypeScript
- TailwindCSS
- Axios for API calls
POST /api/auth/register- Register new userPOST /api/auth/login- LoginPOST /api/auth/refresh- Refresh access tokenPOST /api/auth/logout- LogoutGET /api/auth/google- Google OAuth redirectGET /api/auth/google/callback- Google OAuth callback
GET /api/users/me- Get current user profilePATCH /api/users/me- Update profileGET /api/users- List users (paginated)
GET /api/projects- List user's projectsPOST /api/projects- Create projectGET /api/projects/:id- Get project detailsPATCH /api/projects/:id- Update projectDELETE /api/projects/:id- Delete projectPOST /api/projects/:id/members- Add memberDELETE /api/projects/:id/members/:memberId- Remove member
GET /api/tasks/projects/:projectId/tasks- List tasks in projectPOST /api/tasks/projects/:projectId/tasks- Create taskGET /api/tasks/:id- Get task detailsPATCH /api/tasks/:id- Update taskDELETE /api/tasks/:id- Delete taskPOST /api/tasks/:id/attachments- Add attachmentDELETE /api/tasks/:id/attachments/:attachmentId- Remove attachment
GET /api/reports/projects/:projectId/reports- List reportsPOST /api/reports/projects/:projectId/reports- Generate reportGET /api/reports/:id- Get report detailsGET /api/reports/projects/:projectId/summary- Get project summary (cached)
GET /debug/event-loop- Event Loop demonstration
Open Prisma Studio:
cd backend
npm run prisma:studioCreate a new migration:
cd backend
npm run prisma:migrateSee backend/.env.example and frontend/.env.example for required environment variables.
MIT