A complete bug and feature tracking platform built with Node.js, Express, Sequelize, and PostgreSQL. Designed with a scalable service-based architecture to manage software development issues, projects, and developer collaboration.
Deployed API: https://bug-feature-tracker.onrender.com/
- π§βπΌ User Roles: Admin, Manager, User
- π Authentication: JWT-based login/signup
- π₯ RBAC: Role-based access control
- π Projects: Create, update, delete, list projects
- π« Tickets:
- Create, assign, and track bugs/features
- Filter by project, status, priority, assigned user
- Full-text search on title and description
- π¬ Comments: Add comments to tickets
- π Dashboard-ready: Stats can be added later
- π§± Modular Structure: Separation of concerns using services, controllers, models, and middlewares
- Backend: Node.js, Express.js
- Database: PostgreSQL (Supabase)
- ORM: Sequelize
- Authentication: JWT
- Deployment: Render
- Validation: Custom + middleware-based
Follow this step-by-step guide to test all API functionality:
POST /register
Content-Type: application/json
{
"name": "John Doe",
"email": "[email protected]",
"password": "password123",
"role": "user"
}
β Expected Response:
{
"message": "Record Created Successfully!",
"user": {
"id": "uuid-here",
"name": "John Doe",
"email": "[email protected]",
"role": "user"
}
}
POST /login
Content-Type: application/json
{
"email": "[email protected]",
"password": "password123"
}
β Expected Response:
{
"message": "Login successful",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
π Action Required: Copy the token
value for subsequent requests
POST /projects
Authorization: Bearer YOUR_JWT_TOKEN_FROM_STEP_2
Content-Type: application/json
{
"name": "Test Project",
"description": "This is a test project for our bug tracker"
}
π Action Required: Note the projectId
from the response for Step 5
GET /projects
Authorization: Bearer YOUR_JWT_TOKEN_FROM_STEP_2
POST /tickets
Authorization: Bearer YOUR_JWT_TOKEN_FROM_STEP_2
Content-Type: application/json
{
"title": "Login button not working",
"description": "The login button doesn't respond when clicked",
"type": "bug",
"priority": "high",
"status": "open",
"projectId": "PROJECT_ID_FROM_STEP_3"
}
GET /tickets
Authorization: Bearer YOUR_JWT_TOKEN_FROM_STEP_2
7a. Create Admin User:
POST /register
Content-Type: application/json
{
"name": "Admin User",
"email": "[email protected]",
"password": "admin123",
"role": "admin"
}
7b. Login as Admin:
POST /login
Content-Type: application/json
{
"email": "[email protected]",
"password": "admin123"
}
7c. View All Users (Admin Only):
GET /users
Authorization: Bearer ADMIN_JWT_TOKEN_FROM_7B
Method | Endpoint | Description |
---|---|---|
POST |
/register |
User registration |
POST |
/login |
User login |
Method | Endpoint | Description |
---|---|---|
GET |
/projects |
Get all projects |
POST |
/projects |
Create new project |
GET |
/projects/:id |
Get project by ID |
PUT |
/projects/:id |
Update project |
DELETE |
/projects/:id |
Delete project |
Method | Endpoint | Description |
---|---|---|
GET |
/tickets |
Get all tickets (with filters) |
POST |
/tickets |
Create new ticket |
GET |
/tickets/:id |
Get ticket by ID |
PUT |
/tickets/:id |
Update ticket |
DELETE |
/tickets/:id |
Delete ticket |
Method | Endpoint | Description |
---|---|---|
GET |
/tickets/:id/comments |
Get ticket comments |
POST |
/tickets/:id/comments |
Add comment to ticket |
Method | Endpoint | Description |
---|---|---|
GET |
/users |
View all users |
- Full system access
- Manage users, projects, and tickets
- View all users endpoint access
- System configuration
- Manage assigned projects
- View and update tickets within their projects
- Comment on tickets
- Create new tickets
- Create and view tickets
- Comment on tickets
- Limited project access
- Update assigned tickets
- Register a new user with
/register
- Login with
/login
to receive a JWT token - Include the token in the
Authorization: Bearer <token>
header for protected routes - Token expires based on JWT_EXPIRES_IN configuration
Use this checklist to verify all functionality:
- User Registration - Can create new users
- User Login - Returns valid JWT token
- Protected Routes - Work with valid token, fail without token
- Role-Based Access - Admin routes only work for admin users
- Project CRUD - Create, read, update, delete projects
- Ticket CRUD - Create, read, update, delete tickets
- Comments - Add and retrieve ticket comments
- Database Relations - Projects, tickets, users are properly linked
- Error Handling - Proper error messages for invalid requests
bug-tracker/
βββ config/ # DB config and env setup
βββ controllers/ # Handle req/res
βββ middlewares/ # Auth, roles, error handling
βββ migrations/ # Sequelize migration files
βββ models/ # Sequelize models
βββ routes/ # All API routes
βββ services/ # Business logic lives here
βββ utils/ # Helpers and utilities
βββ app.js # Express app setup
βββ index.js # App entry point
- Node.js (v14 or higher)
- PostgreSQL
- npm or yarn
git clone https://github.com/Parvezkhan0/bug-feature-tracker.git
cd bug-feature-tracker
npm install
Create a .env
file in the root directory:
NODE_ENV=development
PORT=5001
DB_HOST=localhost
DB_PORT=5432
DB_NAME=bug_tracker
DB_USER=your_username
DB_PASSWORD=your_password
DB_DIALECT=postgres
JWT_SECRET=your_jwt_secret
JWT_EXPIRES_IN=7d
# Run migrations
npm run migrate
# Run seeders (optional)
npx sequelize-cli db:seed:all
# Development
npm run dev
# Production
npm start
npm start # Start production server
npm run dev # Start development server with nodemon
npm test # Run tests
npm run migrate # Run database migrations
This application is deployed on Render with:
- β Automatic deployments from GitHub
- β PostgreSQL database hosted on Supabase
- β Environment variables configured for production
- β Database migrations run automatically on deployment
Parvez Khan
- GitHub: https://github.com/Parvezkhan0
- Live Demo: https://bug-feature-tracker.onrender.com/
Want to test immediately? Use these exact requests:
- Register:
POST /register
with the JSON from Step 1 - Login:
POST /login
with the JSON from Step 2 - Copy the token and use it in all subsequent requests
- Test protected routes following Steps 3-6
The API is live and ready to use! π