A production-oriented project management and team collaboration backend built with Node.js, Express.js, and PostgreSQL.
ProjectForge is a long-term backend engineering project focused on building the backend of a modern project management and team collaboration platform.
The goal is not simply to create CRUD APIs. ProjectForge is being designed and implemented with real-world backend engineering principles including authentication, authorization, role-based access control, relational database design, secure workflows, database constraints, pagination, filtering, search, modular architecture, and production-oriented development practices.
ProjectForge is actively under development.
- โ Authentication
- โ JWT-based authorization
- โ HTTP-only cookie authentication
- โ Workspace management
- โ Workspace membership
- โ Role-based workspace authorization
- โ Project management
- โ Task management
- โ Task assignment
- โ Task search
- โ Task filtering
- โ Task sorting
- โ Task pagination
- โ Workspace dashboard
- โ Complete workspace invitation lifecycle
- โ Task comment creation
- ๐ง Task comment listing
- ๐ง Task comment updating
- ๐ง Task comment deletion
- ๐ง Activity logging
- ๐ง File attachments
- โณ Real-time collaboration
- โณ Notifications
- โณ Advanced project management
- โณ AI-powered backend features
- โณ Production hardening
- โณ Deployment and scaling
ProjectForge is being built as a complete collaboration platform where users can organize their work inside isolated workspaces.
The long-term architecture looks conceptually like this:
Workspace
โ
โโโ Members
โโโ Invitations
โ
โโโ Projects
โ โ
โ โโโ Tasks
โ โ โโโ Comments
โ โ โโโ Attachments
โ โ
โ โโโ Activity
โ
โโโ Dashboard
โโโ Notifications
โโโ Real-time Collaboration
The system is intentionally being developed incrementally.
Every feature follows:
Design
โ
Understand important concepts
โ
Database / Model
โ
Service
โ
Controller
โ
Route
โ
Testing
โ
Production Review
โ
Commit & Push
ProjectForge follows a layered backend architecture.
Client
โ
โผ
Routes
โ
โผ
Controllers
โ
โผ
Services
โ
โผ
Models
โ
โผ
PostgreSQL
Define API endpoints and connect requests to middleware/controllers. Routes remain lightweight and contain no business logic.
Handle HTTP concerns: parameters, request bodies, authenticated user data, service calls, and responses.
Contain business logic such as workspace membership checks, role checks, invitation workflows, authorization rules, and coordination between models.
Contain SQL queries and database operations. Models do not contain application-level authorization logic.
- Node.js
- Express.js
- JavaScript
- CommonJS modules
- PostgreSQL
- JWT
- HTTP-only cookies
- bcrypt
- SHA-256
- Node.js
crypto
- Postman
- PostgreSQL
- pgAdmin
- Git
- GitHub
backend/
โ
โโโ src/
โ โโโ config/
โ โ โโโ db.js
โ โ
โ โโโ controllers/
โ โ โโโ authController.js
โ โ โโโ workspaceController.js
โ โ โโโ projectController.js
โ โ โโโ taskController.js
โ โ โโโ dashboardController.js
โ โ โโโ workspaceInvitationController.js
โ โ
โ โโโ models/
โ โ โโโ user.model.js
โ โ โโโ workspace.model.js
โ โ โโโ workspaceMember.model.js
โ โ โโโ project.model.js
โ โ โโโ task.model.js
โ โ โโโ dashboard.model.js
โ โ โโโ workspaceInvitation.model.js
โ โ
โ โโโ services/
โ โ โโโ auth.service.js
โ โ โโโ workspace.service.js
โ โ โโโ project.service.js
โ โ โโโ task.service.js
โ โ โโโ dashboard.service.js
โ โ โโโ workspaceInvitation.service.js
โ โ
โ โโโ middleware/
โ โ โโโ ...
โ โ
โ โโโ routes/
โ โ โโโ ...
โ โ
โ โโโ app.js
โ
โโโ package.json
โโโ .gitignore
โโโ README.md
The structure will continue evolving as ProjectForge grows.
ProjectForge uses JWT-based authentication with secure password handling.
User submits credentials
โ
โผ
Input validation
โ
โผ
Normalize email
โ
โผ
Check duplicate email
โ
โผ
Hash password using bcrypt
โ
โผ
Create user
โ
โผ
Return user information
Passwords are never stored as plaintext.
Credentials
โ
โผ
Find user
โ
โผ
Verify password
โ
โผ
Generate JWT
โ
โผ
Store authentication token
in HTTP-only cookie
โ
โผ
Authenticated requests
A workspace is the primary organizational boundary in ProjectForge.
Workspace
โ
โโโ Members
โโโ Projects
โโโ Tasks
โโโ Invitations
โโโ Dashboard
Users can belong to multiple workspaces. Workspace membership is represented separately from users so that roles and access can be managed per workspace.
Workspace-level authorization is handled through the workspace membership system.
Authenticated User
โ
โผ
Workspace Membership
โ
โผ
Role
โ
โผ
Permission
The application does not trust role information supplied by the client. Actual membership and role information is retrieved from PostgreSQL.
Sensitive workspace operations currently use the OWNER role.
Projects belong to workspaces.
Workspace
โ
โโโ Projects
Projects provide higher-level organization for tasks and remain workspace-scoped.
Tasks belong to projects.
Workspace
โ
โผ
Project
โ
โผ
Task
Tasks currently support:
- Title
- Description
- Status
- Priority
- Due date
- Assignee
- Creation information
Tasks can be created, retrieved, updated, and deleted.
Tasks can be assigned to users.
Task retrieval can include:
- Assignee ID
- Assignee name
- Assignee email
ProjectForge supports task discovery through:
- Search by title
- Filtering by status
- Filtering by priority
- Sorting by supported fields
- Pagination
Pagination uses:
LIMIT
OFFSET
The API returns:
tasks
totalTasks
This allows clients to construct pagination interfaces.
The workspace dashboard provides an overview of projects and tasks.
It includes statistics such as:
- Total projects
- Total tasks
- Completed tasks
- In-progress tasks
- Todo tasks
- High-priority tasks
- Overdue tasks
- Completion percentage
It can also provide recent projects and tasks.
Dashboard access is workspace-scoped.
ProjectForge contains a complete workspace invitation lifecycle.
โโโโโโโโโโโโ
โ PENDING โ
โโโโโโฌโโโโโโ
โ
โโโโโโโโโโโโโโผโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
ACCEPTED REJECTED REVOKED
Supported operations:
- Create invitation
- Accept invitation
- List invitations
- Reject invitation
- Revoke invitation
Invitation tokens are generated using cryptographically secure random bytes.
Random Token
โ
โผ
SHA-256
โ
โผ
Token Hash
โ
โผ
PostgreSQL
The raw token is used by the invited user, while only its SHA-256 hash is persisted in the database.
Invitations contain an expiration timestamp.
The current implementation uses a seven-day expiration period.
Before processing an invitation:
Current Time < expires_at
must be true.
Expired invitations cannot be processed.
ProjectForge prevents multiple pending invitations for the same email address inside the same workspace.
Application logic and database constraints work together to enforce this rule.
Historical invitations remain after their status changes.
Example:
Workspace
โ
โโโ john@example.com โ ACCEPTED
โโโ john@example.com โ REJECTED
โโโ john@example.com โ REVOKED
โโโ john@example.com โ PENDING
Two simultaneous PENDING invitations for the same workspace/email are not allowed.
POST /api/v1/workspaces/:workspaceId/invitationsFlow:
Request
โ
โผ
Validate workspace
โ
โผ
Verify requester is OWNER
โ
โผ
Normalize email
โ
โผ
Check existing membership
โ
โผ
Check pending invitation
โ
โผ
Generate secure token
โ
โผ
Hash token
โ
โผ
Set expiration
โ
โผ
Create invitation
โ
โผ
Return invitation
POST /api/v1/invitations/:token/acceptFlow:
Token
โ
โผ
SHA-256 hash
โ
โผ
Find invitation
โ
โผ
Verify invitation exists
โ
โผ
Verify PENDING status
โ
โผ
Verify expiration
โ
โผ
Verify authenticated email
โ
โผ
Create workspace membership
โ
โผ
Mark invitation ACCEPTED
The authenticated user's email must match the invitation email.
GET /api/v1/workspaces/:workspaceId/invitationsThe endpoint verifies that the requester belongs to the workspace before returning invitations.
Invitation data can include:
- Invitation ID
- Role
- Status
- Expiration
- Inviter
- Creation timestamp
POST /api/v1/invitations/:token/rejectFlow:
Token
โ
โผ
SHA-256 hash
โ
โผ
Find invitation
โ
โผ
Verify PENDING
โ
โผ
Verify expiration
โ
โผ
Verify invited email
โ
โผ
Status โ REJECTED
Rejecting an invitation does not create workspace membership.
PATCH /api/v1/invitations/:invitationId/revokeRevocation is an owner-side operation.
Invitation ID
โ
โผ
Find invitation
โ
โผ
Get workspace ID
โ
โผ
Verify requester is OWNER
โ
โผ
Verify invitation is PENDING
โ
โผ
Status โ REVOKED
A revoked invitation cannot be accepted.
Phase 7 introduces collaboration features.
The first collaboration feature is Task Comments.
The intended collaboration architecture is:
Task
โ
โโโ Comments
โโโ Attachments
โโโ Activity History
A comment belongs to a task and a user.
User
โ
โผ
Comment
โ
โผ
Task
โ
โผ
Project
โ
โผ
Workspace
The task_comments table contains:
task_comments
โ
โโโ id
โโโ task_id
โโโ user_id
โโโ content
โโโ created_at
โโโ updated_at
task_comments.task_id
โ
โผ
tasks.id
Deleting a task cascades to its comments.
task_comments.user_id
โ
โผ
users.id
The current relationship prevents deleting a referenced user while comments still depend on that user.
The database rejects empty or whitespace-only content:
CHECK (length(trim(content)) > 0)An index exists on:
task_comments.task_id
to optimize retrieval of comments for a task.
POST /api/v1/tasks/:taskId/commentsExample request body:
{
"content": "I'll finish this task by tomorrow."
}The user ID comes from the authenticated user and is never trusted from the request body.
Flow:
POST /tasks/:taskId/comments
โ
โผ
Get authenticated user
โ
โผ
Get task
โ
โผ
Does task exist?
โ
โผ
Get task's workspace
โ
โผ
Check workspace membership
โ
โโโโโโโดโโโโโโ
โ โ
NO YES
โ โ
Reject โผ
Create comment
โ
โผ
Return comment
Any authenticated member of the workspace can comment. Commenting is not restricted to the workspace owner.
PostgreSQL is treated as an important part of the application's integrity layer.
Relationships are enforced at the database level.
Examples:
Task โ Project
Project โ Workspace
Comment โ Task
Comment โ User
Invitation โ Workspace
Invitation โ User
Queries use parameters:
WHERE id = $1rather than directly interpolating user-controlled values.
The database uses:
- Primary keys
- Foreign keys
- NOT NULL constraints
- CHECK constraints
- Unique constraints/indexes
Indexes are added for frequently queried relationships and constraints, such as:
task_comments.task_id
Security is considered throughout development.
Passwords are hashed with bcrypt and are never stored in plaintext.
JWT-based authentication identifies authenticated users.
HTTP-only cookies are used where applicable.
Authentication determines identity.
Authorization determines whether the authenticated user can perform an operation.
Workspace-scoped resources are protected by membership checks.
Sensitive operations require appropriate workspace roles, such as OWNER.
Invitation tokens use cryptographically secure random generation and only their SHA-256 hashes are persisted.
Postman is currently used for API testing.
Every feature is tested after implementation.
Testing covers:
Successful creation, retrieval, update, acceptance, rejection, etc.
- Invalid authentication
- Unauthorized users
- Non-members
- Missing resources
- Duplicate invitations
- Expired invitations
- Already processed invitations
- Invalid invitation tokens
- Invalid workspace access
- Invalid comment content
A feature is not committed until it has been tested and reviewed.
Every feature follows:
1. Design
โ
2. Understand important new concepts
โ
3. Database / Model
โ
4. Service
โ
5. Controller
โ
6. Route
โ
7. Test
โ
8. Production Review
โ
9. Commit & Push
The project intentionally avoids blindly copying implementation code.
The purpose is to understand why each architectural and database decision is made.
ProjectForge uses meaningful feature-level commits.
Examples:
feat: implement workspace invitation creation system
feat: implement workspace invitation acceptance flow
feat: implement workspace invitation listing
feat: implement workspace invitation rejection flow
feat: implement workspace invitation revocation flow
feat: implement task comment creation
This keeps the Git history understandable and makes individual features easy to identify.
Phase 1
Foundation
โ
โผ
Phase 2
Core Backend
โ
โผ
Phase 3
Authentication & Authorization
โ
โผ
Phase 4
Workspaces, Projects, Tasks & Dashboard
โ
โผ
Phase 6
Workspace Invitation System
โ
โผ
Phase 7
Collaboration
โ
โโโ Task Comments
โโโ Activity Logs
โโโ File Attachments
โ
โผ
Future Phases
โ
โโโ Real-time Collaboration
โโโ Notifications
โโโ Advanced Project Management
โโโ AI Backend
โโโ Production Hardening
| Feature | Status |
|---|---|
| User Registration | โ Complete |
| User Login | โ Complete |
| JWT Authentication | โ Complete |
| HTTP-only Authentication Cookies | โ Complete |
| Workspace Management | โ Complete |
| Workspace Membership | โ Complete |
| Workspace Roles | โ Complete |
| Project Management | โ Complete |
| Task Management | โ Complete |
| Task Assignment | โ Complete |
| Task Search | โ Complete |
| Task Filtering | โ Complete |
| Task Sorting | โ Complete |
| Task Pagination | โ Complete |
| Workspace Dashboard | โ Complete |
| Create Invitation | โ Complete |
| Accept Invitation | โ Complete |
| List Invitations | โ Complete |
| Reject Invitation | โ Complete |
| Revoke Invitation | โ Complete |
| Create Task Comment | โ Complete |
| List Task Comments | ๐ง In Progress |
| Update Task Comment | ๐ง In Progress |
| Delete Task Comment | ๐ง In Progress |
| Activity Logs | ๐ง In Progress |
| File Attachments | ๐ง In Progress |
| Real-time Collaboration | โณ Planned |
| Notifications | โณ Planned |
| AI Features | โณ Planned |
| Production Hardening | โณ Planned |
Install:
- Node.js
- npm
- PostgreSQL
- Git
git clone https://github.com/rohanbuildai/ProjectForge.git
cd ProjectForgenpm installCreate a .env file according to the application's configuration.
Example:
PORT=5000
DB_HOST=localhost
DB_PORT=5432
DB_NAME=projectforge_db
DB_USER=postgres
DB_PASSWORD=your_password
JWT_SECRET=your_jwt_secretUse strong secrets in real environments.
Never commit .env files or credentials to Git.
Start the development server using the configured development command:
npm run devThe API will be available at:
http://localhost:5000
ProjectForge uses versioned API routes.
Example:
/api/v1/...
This provides a foundation for future API evolution without immediately breaking existing clients.
ProjectForge is intentionally built with production considerations from the beginning.
Key principles:
Routes, controllers, services, and models have distinct responsibilities.
Foreign keys and constraints protect relationships and important invariants.
Passwords are hashed and authentication credentials are protected.
Workspace membership and roles are verified on the server.
Invalid input is rejected before reaching sensitive application logic.
User-controlled values are passed as SQL parameters.
Large collections are not returned blindly in one response.
Task retrieval supports structured filtering and search.
Each meaningful feature receives its own commit.
As ProjectForge grows, additional production improvements are planned, including:
- Centralized error handling refinements
- More comprehensive validation
- Automated tests
- API documentation
- Rate limiting
- Structured logging
- Monitoring
- Caching
- Background jobs
- Object storage
- WebSocket infrastructure
- Deployment automation
- Horizontal scaling
These will be introduced when they become relevant to the architecture rather than being added prematurely.
The long-term goal is to evolve ProjectForge into a complete project-management and collaboration platform.
ProjectForge
โ
โโโโโโโโโโโโดโโโโโโโโโโโ
โ โ
Workspaces Users
โ
โโโโโโโโผโโโโโโโโโโ
โ โ โ
Projects Members Invitations
โ
Tasks
โ
โโโโโโโผโโโโโโโโโโโ
โ โ โ
Comments Files Activity
โ
โโโโโโโโโโโโโโโโโ
โ
Collaboration
โ
โโโโโโโโโโโผโโโโโโโโโโ
โ โ โ
Realtime Notifications AI
The final system is intended to combine strong backend engineering with intelligent features.
AI integration is planned for a later phase.
The AI layer will eventually integrate with the existing backend rather than being an isolated demonstration.
Potential areas include:
- Project intelligence
- Task assistance
- Productivity insights
- Intelligent summaries
- Natural-language project interaction
- Automated project analysis
The exact AI feature set will be designed when the AI phase begins.
ProjectForge is currently primarily developed as a long-term personal engineering project.
As the project matures, contribution guidelines, issue templates, and development documentation may be added.
Suggestions, discussions, and contributions are welcome as the project moves toward a more public development stage.
Computer Science & Engineering โ AI & ML
GitHub:
https://github.com/rohanbuildai
ProjectForge is built around one core principle:
Build like a real product, not like a tutorial.
The objective is to understand the engineering decisions behind every feature.
Every feature should be:
Designed
โ
Understood
โ
Implemented
โ
Tested
โ
Reviewed
โ
Production-ready
โ
Committed
ProjectForge is a long-term exploration of:
- Backend Engineering
- REST API Design
- PostgreSQL
- Database Architecture
- Authentication
- Authorization
- Security
- Role-Based Access Control
- System Design
- Collaboration Systems
- Real-Time Systems
- AI Integration
ProjectForge is not being built to maximize the number of endpoints.
It is being built to develop the engineering ability required to design, build, debug, test, and maintain a real software system.
License information will be added as ProjectForge approaches its public release.
Built with โค๏ธ, JavaScript, Node.js, Express.js & PostgreSQL.
ProjectForge โ Build. Collaborate. Ship.