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