A robust RESTful API for task management built with Node.js, Express, TypeScript, and Prisma.
Complete documentation is available in the docs/ folder:
- Getting Started - Installation and setup guide
- API Reference - Complete API endpoints documentation
- Configuration - Environment variables and settings
- Development Guide - Development workflow and best practices
- Database Schema - Database structure and relationships
- Architecture - System design and architecture
- Deployment Guide - Production deployment instructions
- Contributing - How to contribute to the project
- Troubleshooting - Common issues and solutions
- π Authentication: JWT-based auth with password reset
- β Task Management: Full CRUD with subtasks, tags, and attachments
- π₯ Team Collaboration: Team management with roles
- π Notifications: Real-time notification system
- π API Documentation: Interactive Swagger/OpenAPI docs
- πΎ Database: SQLite with Prisma ORM
# Clone the repository
git clone <your-repo-url>
cd task-flow-api
# Run automated setup
./setup.shThe setup script will:
- Create
.envfrom.env.sample - Install dependencies
- Generate Prisma Client
- Run database migrations
Edit .env to customize:
# Database name (change if needed)
DB_NAME=taskflow.db
# JWT secret (change in production!)
JWT_SECRET="your-secure-secret-key"
# Email settings (optional)
SMTP_HOST=smtp.gmail.com
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-passwordnpm run devServer will start at http://localhost:3000
Swagger docs at http://localhost:3000/api-docs
POST /api/auth/register- Register new userPOST /api/auth/login- LoginPOST /api/auth/forgot-password- Request password resetPOST /api/auth/reset-password- Reset password with tokenPOST /api/auth/change-password- Change password for the currently authenticated user.GET /api/auth/me- Get current user
GET /api/tasks- List tasks (with filters)POST /api/tasks- Create taskGET /api/tasks/:id- Get task detailsPUT /api/tasks/:id- Update taskDELETE /api/tasks/:id- Delete task
GET /api/teams- List teamsPOST /api/teams- Create teamGET /api/teams/:id- Get team detailsPUT /api/teams/:id- Update teamDELETE /api/teams/:id- Delete teamPOST /api/teams/:id/members- Add memberDELETE /api/teams/:id/members/:userId- Remove member
GET /api/notifications- List notificationsPOST /api/notifications- Create notificationPUT /api/notifications/:id/read- Mark as readDELETE /api/notifications/:id- Delete notification
GET /api/users- List usersGET /api/users/me- Get profilePUT /api/users/me- Update profile
npm run dev # Start development server with hot reload
npm run build # Build for production
npm start # Start production server (without PM2)
npm run deploy # Deploy with PM2 (automated)For production deployments with process management:
# Automated deployment (recommended)
npm run deploy
# Or manual PM2 commands
npm run build
npm run pm2:start # Start with PM2
npm run pm2:stop # Stop application
npm run pm2:restart # Restart application
npm run pm2:logs # View logs
npm run pm2:monit # Monitor applicationPM2 Features:
- β Auto-restart on crashes
- β Cluster mode with load balancing (uses all CPU cores)
- β Automatic scaling across multiple instances
- β Log management with merge
- β Zero-downtime reloads
- β Startup script generation
- β Graceful shutdown handling
Scalability: The PM2 configuration automatically scales to use all available CPU cores using cluster mode. This enables:
- Load balancing across multiple Node.js processes
- Better CPU utilization
- Higher throughput for concurrent requests
- Fault tolerance (if one process crashes, others continue)
To manually control instances:
// In ecosystem.config.js
instances: 'max', // Use all CPU cores (default)
// OR
instances: 4, // Specify exact numberFirst-time PM2 Setup:
./deploy.shThis will:
- Build the application
- Run database migrations
- Start with PM2
- Optionally configure system startup
npx prisma migrate dev # Create and apply migration
npx prisma generate # Generate Prisma Client
npx prisma studio # Open Prisma Studio (DB GUI)For password reset functionality, configure SMTP in .env.
See the Email Setup Guide for detailed configuration instructions.
Without SMTP config, password reset emails will log to console (dev mode).
- Runtime: Node.js with TypeScript
- Framework: Express.js
- Database: SQLite (Prisma ORM)
- Validation: Zod
- Authentication: JWT + bcrypt
- Email: Nodemailer
- Documentation: Swagger/OpenAPI
- API Status - Feature implementation status
- PM2 Guide - PM2 configuration and monitoring
- Email Setup - Email configuration guide
We welcome contributions! Please see the Contributing Guidelines for details on:
- Code of conduct
- Development workflow
- Coding standards
- Pull request process
- Testing guidelines
- Documentation: Check the docs folder
- Issues: GitHub Issues
- Troubleshooting: See Troubleshooting Guide
MIT