A robust and scalable REST API for project and task management, built with NestJS, Prisma, and PostgreSQL.
- JWT Authentication: Secure user registration and login using JSON Web Tokens (access and refresh tokens).
- Role-Based Access Control (RBAC): Differentiated permissions for
ADMIN,MANAGER, andUSERroles. - User Management: Admin-only endpoints for creating, viewing, updating, and deleting users.
- Project & Category Management: Full CRUD operations for organizing tasks into projects and categories.
- Task Management: Comprehensive CRUD functionality for tasks, including assignment, status updates, and due dates.
- Advanced Querying: Paginated, filterable, and sortable API responses for tasks and users.
- Validation & Serialization: Automatic request validation and response serialization to ensure data integrity and security.
- API Documentation: Auto-generated, interactive API documentation with Swagger (OpenAPI).
- Framework: NestJS
- Database ORM: Prisma
- Database: PostgreSQL
- Authentication: Passport.js with JWT Strategy
- Validation: class-validator & class-transformer
- API Documentation: Swagger
- Language: TypeScript
- Node.js (v18 or higher recommended)
- pnpm (or npm/yarn)
- PostgreSQL database running locally or on a cloud service.
- Git
git clone https://github.com/jayflashy/projectflow-api.git
cd projectflowpnpm installCreate a .env file in the root of the project by copying the example file:
cp .env.example .envNow, open the .env file and fill in your database connection string and a secure JWT secret:
# .env
DATABASE_URL="postgresql://YOUR_DB_USER:YOUR_DB_PASSWORD@localhost:5432/projectflow_db"
JWT_SECRET="your-super-secret-and-long-jwt-key"
PORT=7090
Apply the database schema to your PostgreSQL database:
npx prisma migrate deployNote: If you are in a development environment and need to make schema changes, use npx prisma migrate dev.
# Development mode with hot-reloading
pnpm run start:devThe application will be running on http://localhost:7090.
Once the application is running, you can access the interactive Swagger API documentation at:
http://localhost:7090/api/docs
This documentation provides a complete list of available endpoints, their required parameters, and allows you to test them directly from your browser.
pnpm run start: Start the application.pnpm run start:dev: Start the application in watch mode.pnpm run start:prod: Start the application in production mode (after building).pnpm run build: Build the application for production.pnpm run lint: Lint the codebase.pnpm run format: Format the codebase with Prettier.pnpm run test: Run unit tests.pnpm run test:e2e: Run end-to-end tests.pnpm run test:cov: Run tests with coverage report.
Contributions are welcome! Please feel free to open an issue or submit a pull request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'feat: Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.