Skip to content

Anoop-Kumar-31/QueueFlow_Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

βš™οΈ QueueFlow - Real-Time Project Management Backend

Node.js Express.js Supabase PostgreSQL Prisma Socket.io JWT GitHub


πŸš€ Overview

QueueFlow is a production-oriented real-time Kanban project management backend built with Node.js, Express.js, Prisma ORM, PostgreSQL (Supabase), and Socket.io.

It powers a collaborative workspace where teams can create projects, manage tasks, collaborate through sticky notes, track activities in real time, and securely manage members using Role-Based Access Control (RBAC).

Designed with scalability in mind, QueueFlow focuses on clean architecture, optimized database queries, real-time synchronization, and production-ready backend engineering practices.


✨ Core Features

  • πŸ” JWT Authentication
  • πŸ‘₯ Role-Based Access Control (RBAC)
  • πŸ“ Project Management
  • βœ… Kanban Task Management
  • πŸ“ Sticky Notes
  • ⚑ Real-Time Updates using Socket.io
  • πŸ“ˆ Activity Timeline
  • πŸ“Š Dashboard Analytics
  • πŸ“¨ Time-Limited Project Invitations
  • πŸ” Optimized Database Queries
  • πŸ“„ Server-side Pagination
  • πŸ›‘ Custom Sliding Window Rate Limiter

πŸ›  Technology Stack

Category Technology
Runtime Node.js
Framework Express.js
Language JavaScript
Database PostgreSQL (Supabase)
ORM Prisma ORM
Authentication JWT
Password Security Bcrypt
Real-Time Communication Socket.io
Authorization RBAC
API Style REST
Deployment Render

πŸ— Architecture Highlights

Relational Database Design

QueueFlow uses Prisma ORM with PostgreSQL to maintain a scalable relational database architecture.

Relationships include:

  • User β†’ Projects
  • Project β†’ Tasks
  • Task β†’ Sticky Notes
  • Project β†’ Activity Timeline
  • User ↔ Project (Many-to-Many via ProjectMember)

Real-Time Collaboration

Socket.io enables instant synchronization across connected clients.

Users joining the same project automatically receive updates when:

  • Tasks are created
  • Tasks are updated
  • Tasks move across Kanban columns
  • Sticky notes are added
  • Sticky notes are edited
  • Sticky notes are deleted
  • Activities are generated

Authentication & Authorization

QueueFlow implements stateless JWT authentication.

Every protected endpoint validates:

  • JWT token
  • User identity
  • Project membership
  • User role

Only Project Managers can access privileged endpoints like:

  • Create Project
  • Generate Invite
  • Manage Members

Activity Tracking

Every important action generates an immutable Activity Event.

Examples:

  • Project Created
  • Task Assigned
  • Task Completed
  • Sticky Note Added
  • Task Deleted

This creates a complete audit history for every workspace.


πŸ” Security Features

  • JWT Authentication
  • Password Hashing using Bcrypt
  • Role-Based Access Control
  • Protected Routes
  • Secure Invite Codes
  • Expiring Project Invitations
  • Custom Sliding Window Rate Limiter
  • Environment Variable Isolation
  • CORS Protection

⚑ Performance Optimizations

QueueFlow has recently undergone major backend optimizations focused on reducing database load and improving response times.

API Optimizations

  • Lazy loading for Sticky Notes
  • Reduced API payload sizes
  • Prisma select queries instead of heavy include
  • Optimized REST responses
  • Removed unnecessary nested joins

Pagination

Implemented server-side pagination for:

  • Project Tasks
  • User Queue
  • Activity Timeline
  • Sticky Notes

Benefits:

  • Faster page rendering
  • Reduced bandwidth usage
  • Lower database load
  • Improved scalability

Database Optimizations

  • Removed redundant indexes
  • Added targeted composite indexes
  • Optimized WHERE + ORDER BY queries
  • Reduced full table scans
  • Improved Prisma query execution

Real-Time Improvements

  • Optimistic frontend updates
  • Socket synchronization
  • Incremental activity loading
  • Lazy note fetching

πŸ“ˆ Recent Engineering Improvements

Recent updates include:

  • Server-side pagination across all major resources
  • Lazy loading for Sticky Notes
  • Composite PostgreSQL indexes
  • Optimized Prisma queries
  • Smaller API payloads
  • Activity Timeline pagination
  • Incremental frontend loading
  • Custom Sliding Window Log Rate Limiter
  • Improved Redux synchronization
  • Better database scalability

πŸ—„ Database Schema

Database ER Diagram

Core Tables

User

Stores authentication and profile information.

Relationships

  • One User β†’ Many Projects
  • One User β†’ Many Tasks
  • One User β†’ Many Sticky Notes
  • One User β†’ Many Project Memberships

Project

Represents an isolated workspace.

Contains:

  • Members
  • Tasks
  • Activities
  • Invitations

Task

Stores task information including:

  • Status
  • Priority
  • Position
  • Assigned User
  • Project
  • Completion timestamps

StickyNote

Stores collaborative notes attached to tasks.


ActivityEvent

Tracks every important action occurring inside a project.


ProjectInvite

Stores temporary invitation codes with automatic expiration.


ProjectMember

Junction table connecting Users and Projects with assigned roles.


πŸ“‚ Project Structure

QueueFlow_Backend
β”‚
β”œβ”€β”€ prisma
β”‚   β”œβ”€β”€ schema.prisma
β”‚   └── migrations
β”‚
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ config
β”‚   β”œβ”€β”€ controllers
β”‚   β”œβ”€β”€ middleware
β”‚   β”œβ”€β”€ routes
β”‚   β”œβ”€β”€ services
β”‚   β”œβ”€β”€ sockets
β”‚   β”œβ”€β”€ utils
β”‚   β”œβ”€β”€ app.js
β”‚   └── server.js
β”‚
β”œβ”€β”€ screenshots
β”‚
β”œβ”€β”€ .env
β”œβ”€β”€ package.json
└── README.md

πŸš€ Getting Started

1️⃣ Clone Repository

git clone https://github.com/Anoop-Kumar-31/QueueFlow_Backend.git

cd QueueFlow_Backend

2️⃣ Install Dependencies

npm install

3️⃣ Configure Environment Variables

Create a .env file in the project root.

DATABASE_URL="postgresql://username:password@host:6543/postgres?pgbouncer=true"

DIRECT_URL="postgresql://username:password@host:5432/postgres"

PORT=5000

JWT_SECRET=your_secret_key

CLIENT_URL=http://localhost:5173

4️⃣ Push Database Schema

npx prisma db push

5️⃣ Generate Prisma Client

npx prisma generate

6️⃣ Start Development Server

npm run dev

Server starts at

http://localhost:5000

πŸ“‘ REST API

Authentication

Method Endpoint
POST /api/auth/register
POST /api/auth/login
GET /api/auth/profile

Projects

Method Endpoint
GET /api/projects
POST /api/projects
GET /api/projects/:projectId
PATCH /api/projects/:projectId
DELETE /api/projects/:projectId

Tasks

Method Endpoint
GET /api/tasks
POST /api/tasks
PATCH /api/tasks/:taskId
DELETE /api/tasks/:taskId
GET /api/tasks/:taskId/notes

Sticky Notes

Method Endpoint
POST /api/tasks/:taskId/notes
PATCH /api/notes/:noteId
DELETE /api/notes/:noteId

Activities

Method Endpoint
GET /api/projects/:projectId/activity

Invitations

Method Endpoint
POST /api/projects/:projectId/invite
POST /api/projects/join

⚑ Socket.io Events

QueueFlow uses Socket.io for real-time collaboration.

Client β†’ Server

Event
joinProject
leaveProject
typing

Server β†’ Client

Event Description
taskCreated New task created
taskUpdated Task updated
taskDeleted Task removed
stickyNoteAdded New sticky note
stickyNoteUpdated Sticky note updated
stickyNoteDeleted Sticky note deleted
activityCreated New timeline activity

πŸ“Š Performance Metrics

Recent backend improvements include

βœ… Lazy Loading

βœ… Pagination

βœ… Composite Database Indexes

βœ… Optimized Prisma Queries

βœ… Reduced Payload Size

βœ… Optimistic Updates

βœ… Socket Synchronization

βœ… Custom Rate Limiter

These improvements significantly reduced unnecessary database operations while improving scalability for larger projects.


πŸ“Έ Screenshots

Database ER Diagram

screenshots/
    └── ER_NEW.png

Future Screenshots

  • Login
  • Dashboard
  • Kanban Board
  • Task Details
  • Activity Timeline

🚧 Roadmap

Completed

  • Authentication
  • Authorization
  • RBAC
  • Project Management
  • Kanban Board
  • Sticky Notes
  • Activity Timeline
  • Dashboard Analytics
  • Socket.io Integration
  • Pagination
  • Database Optimization
  • Rate Limiting

Upcoming Features

  • Email Notifications
  • Calendar Integration
  • Task Attachments
  • File Uploads
  • Search & Filtering
  • AI Task Assistant
  • Project Templates
  • Email Verification
  • Password Reset
  • Unit & Integration Testing

πŸ§ͺ Development Practices

The project follows modern backend development principles including:

  • Layered Architecture
  • RESTful API Design
  • Repository Pattern (Prisma)
  • Middleware-based Authentication
  • Centralized Error Handling
  • Modular Routing
  • Scalable Folder Structure
  • Real-time Event Broadcasting
  • Secure Environment Configuration

🀝 Contributing

Contributions are always welcome.

  1. Fork the repository

  2. Create a feature branch

git checkout -b feature/new-feature
  1. Commit your changes
git commit -m "feat: add awesome feature"
  1. Push the branch
git push origin feature/new-feature
  1. Open a Pull Request

πŸ“œ License

This project is licensed under the MIT License.


πŸ‘¨β€πŸ’» Author

Anoop Kumar

Full Stack Developer

Expertise

  • React.js
  • Node.js
  • Express.js
  • PostgreSQL
  • Prisma ORM
  • Socket.io
  • REST APIs
  • Database Design
  • Authentication & RBAC
  • Real-Time Systems

Connect With Me

GitHub

https://github.com/Anoop-Kumar-31

LinkedIn

https://linkedin.com/in/anoop--kumar

Portfolio

https://myportfolio-kto7.onrender.com


⭐ If you found this project useful, consider giving it a star on GitHub. It helps support the project and motivates future improvements.

About

This is the backend for Queueflow website

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages