DevPilot
Full-stack project management app to organize projects, assign tasks, collaborate with teams, and track progress. Built with Next.js (frontend), Node.js/Express (backend), Prisma ORM, and PostgreSQL.
π Deployment Setup
DevPilot is split into frontend and backend, deployed separately for flexibility and performance.
Frontend
- Built with Next.js.
- Hosted on Vercel (automatic deployments from GitHub).
- Benefits:
- Fast global CDN delivery
- Automatic SSL/TLS
- Built-in CI/CD with GitHub integration
- Communicates with the backend via API requests to a public URL (through Cloudflare Tunnel).
Backend
- Built with Node.js/Express and Prisma ORM for database access.
- Runs on my personal laptop server (Ubuntu) hosting:
- PostgreSQL database
- Node.js backend
- Exposed to the internet using Cloudflare Tunnel:
- Secure public URL for your local server
- Acts as a reverse proxy
- Provides automatic HTTPS and DDoS protection
- No need to open router ports
How it Works
- Frontend (Vercel) sends API requests to the backend via the Cloudflare Tunnel URL.
- Tunnel forwards requests securely to my local backend server.
- Backend communicates with the PostgreSQL database.
- Responses are returned to the frontend, providing dynamic project/task data.
Advantages
- Decoupled architecture: Frontend and backend are independent for easier updates.
- Secure local hosting: Backend stays on my laptop but is safely exposed.
- Fast frontend delivery: Vercel CDN ensures quick UI load worldwide.
- Flexibility: Update backend code locally without redeploying the frontend.
π Table of Contents
- How to Run the Project
- Prerequisites
- Local Development
- API Endpoints Summary
- Database / ER Diagram
- Assumptions and Improvements Possible
- Libraries Used
- Author / Contact
- License
π How to Run the Project
Prerequisites
- Node.js (v18+ recommended)
- npm or yarn
- PostgreSQL (local or cloud instance)
The backend uses Prisma for ORM and requires a DATABASE_URL environment variable.
Local Development
- Clone the repository
git clone https://github.com/Rifaque/DevPilot.git
- Install dependencies
cd backend
npm install
cd ../frontend
npm install
- Set up environment variables
Backend
.envexample:
DATABASE_URL, PORT, JWT_SECRET, GROQ_API_KEY
Frontend .env example:
NEXT_PUBLIC_API_BASE, NEXTAUTH_SECRET
- Run database migrations and seed data
npx prisma migrate dev --name init
npx prisma db seed
- Start server Backend:
npm run dev
Frontend:
npm run dev
- Access the app
- Frontend β http://localhost:3000
- Backend API β http://localhost:4000/api
π§© API Endpoints Summary
- Auth
- POST
/api/auth/registerβ Register a new user (not used in current version) - POST
/api/auth/loginβ Login and receive JWT
- POST
- Users
- GET
/api/usersβ List all users
- GET
- Projects
- GET
/api/projectsβ List userβs projects - GET
/api/projects/:idβ Get project (with members & tasks) - POST
/api/projectsβ Create project - DELETE
/api/projects/:idβ Delete project - POST
/api/projects/:id/membersβ Add member - GET
/api/projects/:id/metricsβ Get project metrics
- GET
- Tasks
- POST
/api/tasks/:projectId/tasksβ Create task under project - GET
/api/tasks/:projectId/tasksβ List tasks for project - PUT
/api/tasks/task/:idβ Update task - DELETE
/api/tasks/task/:idβ Delete task
- POST
- Admin
- GET
/api/admin/metricsβ Get admin metrics - GET
/api/admin/usersβ List all users - PUT
/api/admin/users/:idβ Update user role - DELETE
/api/admin/users/:idβ Delete user - GET
/api/admin/tasksβ List all tasks - POST
/api/admin/usersβ Create user
- GET
- AI User Stories (Bonus)
- POST
/api/ai/generate-user-storiesβ Generate User Stories from GROQ API
- POST
For more info on the API, visit Swagger API Docs or check out
DevPilot API.postman_collection.json
π Database / ER Diagram
erDiagram
USER {
int id PK
string name
string email
string passwordHash
Role role
datetime createdAt
}
PROJECT {
int id PK
string name
string description
datetime startDate
datetime endDate
ProjectStatus status
datetime createdAt
}
PROJECTMEMBER {
int id PK
int projectId FK
int userId FK
string role
}
TASK {
int id PK
string title
string description
TaskStatus status
int assigneeId FK
int projectId FK
datetime dueDate
datetime createdAt
datetime updatedAt
}
COMMENT {
int id PK
int taskId FK
int authorId FK
string message
datetime createdAt
}
USERSTORY {
int id PK
int projectId FK
string text
datetime createdAt
}
USER ||--o{ PROJECTMEMBER : "is member of"
PROJECT ||--o{ PROJECTMEMBER : "has members"
USER ||--o{ TASK : "assigned to"
PROJECT ||--o{ TASK : "has tasks"
TASK ||--o{ COMMENT : "has comments"
USER ||--o{ COMMENT : "writes"
PROJECT ||--o{ USERSTORY : "has user stories"
Database Structure Overview
Users
- Stores all users of the system.
- Fields:
id,name,email,passwordHash,role(ADMIN / MANAGER / DEVELOPER),createdAt - Relations:
- Many-to-many with
ProjectthroughProjectMember - One-to-many with
Task(asassignee) - One-to-many with
Comment(as author)
- Many-to-many with
Projects
- Represents projects in the system.
- Fields:
id,name,description,startDate,endDate,status(ACTIVE / ON_HOLD / COMPLETED),createdAt - Relations:
- Many-to-many with
UserthroughProjectMember - One-to-many with
Task - One-to-many with
UserStory
- Many-to-many with
ProjectMember
- Junction table for many-to-many relationship between
UserandProject. - Fields:
id,projectId,userId,role(e.g., Manager, Developer)
Tasks
- Represents tasks assigned to users within a project.
- Fields:
id,title,description,status(TODO / IN_PROGRESS / DONE),assigneeId,projectId,dueDate,createdAt,updatedAt - Relations:
- Belongs to a
Project - Assigned optionally to a
User - Has many
Comments
- Belongs to a
Comments
- Stores comments on tasks.
- Fields:
id,taskId,authorId,message,createdAt - Relations:
- Belongs to a
Task - Written by a
User
- Belongs to a
UserStory
- Represents user stories for a project.
- Fields:
id,projectId,text,createdAt - Relations:
- Belongs to a
Project
- Belongs to a
Enums
- Role: ADMIN, MANAGER, DEVELOPER
- TaskStatus: TODO, IN_PROGRESS, DONE
- ProjectStatus: ACTIVE, ON_HOLD, COMPLETED
π‘ Assumptions and Improvements Possible
Assumptions
- Role-based access:
admin,project_manager,developer - Tasks belong to one project
- Projects have multiple members via a junction table
- JWT authentication
Potential Improvements
- Real-time updates via WebSockets (Socket.io / Pusher)
- Notifications for task assignments and comments
- Search and filtering across all entities
- Audit logs for change tracking
- Advanced RBAC β fine-grained permissions per project
π¦ External Libraries
This project uses several external libraries, each serving a specific purpose:
- Next.js β Frontend framework for React-based pages and server-side rendering.
- Node.js / Express β Backend framework for building API endpoints.
- Prisma β ORM for database modeling, migrations, and queries.
- PostgreSQL β Relational database for storing project, user, task, and comment data.
- dotenv β Load environment variables from
.envfiles. - bcryptjs β Password hashing for secure user authentication.
- morgan β HTTP request logger middleware for backend debugging.
- groq-sdk β SDK for querying content from Sanity or GROQ-based APIs.
- jsonwebtoken (jwt) β Generate and verify JSON Web Tokens for authentication.
- next-auth β Authentication library for Next.js apps.
Additional libraries for UI, development, or testing are listed in package.json.
Author
Rifaque Ahmed Akrami
Email: rifaque123@gmail.com
LinkedIn: Rifaque Ahmed Akrami
Portfolio: Portfolio
License
This project is licensed under the MIT License.
See the LICENSE file for details.