flowboard is a backend project management system built with NestJS, Prisma, and PostgreSQL. It allows users to manage workspaces, projects, tasks, comments, and team roles through a secure REST API.
- User registration and login
- JWT-based authentication
- Protected routes using guards
- Workspace management
- Workspace member management
- Role-based access control with OWNER, ADMIN, and MEMBER roles
- Project management inside workspaces
- Task management inside projects
- Task filtering and pagination
- Task assignment to workspace members
- Comment system for tasks
- Global error response formatting
- Global success response formatting
- Swagger API documentation
- Prisma seed script for demo data
- Unit and E2E testing setup
- NestJS
- TypeScript
- Prisma ORM
- PostgreSQL
- Neon Database
- JWT
- Passport
- bcrypt
- class-validator
- class-transformer
- Swagger
- Jest
- Supertest
src/
auth/
dto/
guards/
strategies/
auth.controller.ts
auth.service.ts
auth.module.ts
users/
users.controller.ts
users.service.ts
users.module.ts
workspaces/
dto/
workspaces.controller.ts
workspaces.service.ts
workspaces.module.ts
projects/
dto/
projects.controller.ts
projects.service.ts
projects.module.ts
tasks/
dto/
tasks.controller.ts
tasks.service.ts
tasks.module.ts
comments/
dto/
comments.controller.ts
comments.service.ts
comments.module.ts
prisma/
prisma.service.ts
prisma.module.ts
common/
decorators/
filters/
interceptors/
selects/
services/
app.module.ts
main.tsThe main database models are:
- User
- Workspace
- WorkspaceMember
- Project
- Task
- Comment
Relationship overview:
User
-> WorkspaceMember
-> Workspace
-> Project
-> Task
-> CommentA workspace can have many members. A user can belong to many workspaces. This is handled through the WorkspaceMember table, which also stores the user's role inside each workspace.
Can:
- Update workspace
- Delete workspace
- Add members
- Remove members
- Change member roles
- Create, update, and delete projects
- Create, update, and delete tasks
- Delete comments
Can:
- Add members
- Create, update, and delete projects
- Create, update, and delete tasks
- Delete comments
Can:
- View workspace data
- View projects
- Create and update tasks
- Add comments
- Delete their own comments
POST /api/auth/register
POST /api/auth/login
GET /api/auth/mePOST /api/workspaces
GET /api/workspaces
GET /api/workspaces/:workspaceId
PATCH /api/workspaces/:workspaceId
DELETE /api/workspaces/:workspaceIdPOST /api/workspaces/:workspaceId/members
GET /api/workspaces/:workspaceId/members
PATCH /api/workspaces/:workspaceId/members/:memberId
DELETE /api/workspaces/:workspaceId/members/:memberIdPOST /api/workspaces/:workspaceId/projects
GET /api/workspaces/:workspaceId/projects
GET /api/projects/:projectId
PATCH /api/projects/:projectId
DELETE /api/projects/:projectIdPOST /api/projects/:projectId/tasks
GET /api/projects/:projectId/tasks
GET /api/tasks/:taskId
PATCH /api/tasks/:taskId
DELETE /api/tasks/:taskIdTask filtering example:
GET /api/projects/:projectId/tasks?status=TODO&priority=HIGH&page=1&limit=10POST /api/tasks/:taskId/comments
GET /api/tasks/:taskId/comments
DELETE /api/comments/:commentIdSwagger documentation is available at:
http://localhost:3000/api/docsAfter logging in, copy the access token and use the Swagger Authorize button to test protected endpoints.
Create a .env file in the project root:
DATABASE_URL="your_neon_pooled_database_url"
DIRECT_URL="your_neon_direct_database_url"
JWT_SECRET="your_jwt_secret"
JWT_EXPIRES_IN="7d"Do not commit .env to GitHub.
npm installGenerate Prisma Client:
npx prisma generateRun migrations:
npx prisma migrate devSeed the database:
npx prisma db seedDevelopment mode:
npm run start:devProduction build:
npm run build
npm run start:prodRun unit tests:
npm run testRun E2E tests:
npm run test:e2e