Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

DevPulse API

A collaborative backend API for software teams to report bugs, suggest features, and manage issue workflows efficiently.


๐Ÿš€ Live API

๐Ÿ”— https://devsync-lemon.vercel.app/


๐Ÿ“ฎ Postman Collection

๐Ÿ”— https://drive.google.com/file/d/1j7YgWMmDruq_LZZOPlndJjD-jnc0CUHA/view?usp=sharing


๐Ÿ› ๏ธ Tech Stack

  • Node.js
  • TypeScript
  • Express.js
  • PostgreSQL (NeonDB)
  • Raw SQL (pool.query)
  • JWT Authentication
  • bcryptjs
  • Vercel Deployment

โœจ Features

Authentication

  • User Registration
  • User Login
  • JWT Authentication
  • Protected Routes
  • Role-Based Authorization

Issue Management

  • Create Issue
  • Get All Issues
  • Get Single Issue
  • Update Issue
  • Delete Issue
  • Filtering
  • Sorting

Security

  • Password Hashing with bcrypt
  • JWT Token Verification
  • Protected Endpoints
  • Role Validation Middleware

Error Handling

  • Global Error Handler
  • 404 Route Handler
  • Consistent Error Response Structure

๐Ÿ‘ฅ User Roles

Contributor

  • Register & Login
  • Create Issues
  • View Issues
  • Update Own Open Issues

Maintainer

  • All Contributor Permissions
  • Update Any Issue
  • Delete Any Issue
  • Change Issue Status

๐Ÿ“‚ Project Structure

src/
โ”œโ”€โ”€ app.ts
โ”œโ”€โ”€ server.ts
โ”‚
โ”œโ”€โ”€ config/
โ”‚
โ”œโ”€โ”€ db/
โ”‚
โ”œโ”€โ”€ middleware/
โ”‚
โ”œโ”€โ”€ modules/
โ”‚   โ”œโ”€โ”€ auth/
โ”‚   โ””โ”€โ”€ issues/
โ”‚
โ”œโ”€โ”€ types/
โ”‚
โ””โ”€โ”€ utils/

โš™๏ธ Installation & Setup

Clone Repository

git clone YOUR_GITHUB_REPOSITORY_LINK

Move Into Project

cd devpulse

Install Dependencies

npm install

๐Ÿ”‘ Environment Variables

Create a .env file:

CONNECTION_STRING=your_postgresql_connection_string

PORT=3000

SECRET_KEY=your_secret_key

REFRESH_SECRET_KEY=your_refresh_secret

โ–ถ๏ธ Run Project Locally

Development Mode

npm run dev

Production Build

npm run build

Run Production Server

npm start

๐Ÿงช API Endpoints

Authentication

Method Endpoint Access
POST /api/auth/signup Public
POST /api/auth/login Public

Issues

Method Endpoint Access
POST /api/issues Authenticated
GET /api/issues Public
GET /api/issues/:id Public
PATCH /api/issues/:id Contributor / Maintainer
DELETE /api/issues/:id Maintainer

๐Ÿ” Query Features

Filtering

GET /api/issues?type=bug
GET /api/issues?status=open

Sorting

GET /api/issues?sort=newest
GET /api/issues?sort=oldest

๐Ÿ—„๏ธ Database Schema

Users Table

Field Type
id SERIAL
name VARCHAR
email VARCHAR
password TEXT
role VARCHAR
created_at TIMESTAMP
updated_at TIMESTAMP

Issues Table

Field Type
id SERIAL
title VARCHAR
description TEXT
type VARCHAR
status VARCHAR
reporter_id INTEGER
created_at TIMESTAMP
updated_at TIMESTAMP

๐Ÿ” Authentication Flow

  1. User logs in
  2. Server validates credentials
  3. JWT token generated
  4. Client sends token in Authorization header
  5. Protected routes verify token

๐Ÿ“Œ Authorization Header Format

Authorization: YOUR_JWT_TOKEN

๐ŸŒ Deployment

Backend

  • Vercel

Database

  • Neon PostgreSQL

๐Ÿง  Important Technical Decisions

  • Used Raw SQL only (pool.query)
  • No ORM used
  • No SQL JOIN used
  • Reporter data fetched manually from users table
  • Modular architecture followed
  • Role-based middleware implemented

๐Ÿ‘จโ€๐Ÿ’ป Author

Zayed Utsho

Computer Science Graduate & MERN Stack Developer


About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages