Skip to content

Anoop-Kumar-31/QueueFlow_Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚙️ QueueFlow - Real-Time API (Backend)

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


This repository powers the backend infrastructure behind QueueFlow, a high-performance Real-time Kanban Workspace. It features robust RESTful endpoints bound natively over an integrated Socket.io ecosystem seamlessly driving Real-time application states directly to isolated front-end clients dynamically.


✨ Architecture Highlights

  • Relational Database Engine: Complex, scalable schema designs utilizing Prisma ORM built strictly over a PostgreSQL (Supabase) database natively enforcing relational tracking blocks (Users -> Projects -> Tasks).
  • Bi-directional WebSockets: Wrapped the Express HTTP server cleanly into a Socket.io node instance pushing organic telemetry signals isolated exclusively into target active 'Project Rooms'.
  • Time-Bound Cryptographic Invites: Highly secure cryptographic generation of 6-character Workspace invitations natively evaluating database deadlines executing organic expiry mechanics securely mitigating unauthorized onboardings.
  • Granular Audit Logging: Custom telemetry tracking logic executing strict .create() Prisma hooks immediately sequentially following state interactions permanently generating timeline Analytics securely.
  • JWT Identity Chains: Stateless JWT-driven authentication headers executing distinct RBAC (Role-Based Access Control) gates strictly preventing Developers from hitting PM-restricted routing nodes securely.

🗄️ Database Schema & Relations

Database ER Diagram

The backend is strictly typed and managed using Prisma. Below is a high-level overview of our core tables and how they structurally map the relational QueueFlow ecosystem:

  • User (Table): Core identity store tracking authentication data (Email, Password Hash) and their persistent Role (PM, DEVELOPER, CLIENT).

    • One-to-ManyProject (A PM creates many Projects).
    • One-to-ManyProjectMember (A user can join many workspaces).
    • One-to-ManyTask (A user is assigned multiple workload items).
    • One-to-ManyStickyNote (A user can leave multiple comments).
  • Project (Table): Represents an isolated Workspace initialized natively by a Project Manager.

    • One-to-ManyProjectMember (Manages who securely has access to the workspace).
    • One-to-ManyTask (Scopes tasks exclusively to this workspace border).
    • One-to-ManyActivityEvent (Scopes timeline logs directly to the project dashboard).
  • ProjectMember (Table): Serves as the junction matrix securely resolving many-to-many mapping boundaries between UserProject.

    • Enforces unique compound keys [user_id, project_id] preventing duplicate roles simultaneously holding state.
  • Task (Table): Granular workload rows tracking agile assignments. Contains state (status), structural queue order (position), and analytical timestamps (started_at, completed_at).

    • Many-to-OneUser (The Developer Assigned).
    • Many-to-OneProject (The target Workspace).
    • One-to-ManyStickyNote (A task can contain formal feedback).
  • ProjectInvite (Table): Temporary cryptographic keys allowing users to bypass manual PM assignments securely natively.

    • Features a strict expires_at column actively evaluated mitigating unauthorized onboardings.
  • ActivityEvent (Table): Permanent immutable telemetry tracking strings tracing exact granular actions chronologically (e.g. MOVED_TASK).

    • Many-to-OneUser (The explicit actor who executed the change).
    • Many-to-OneTask (Optional reference mapping directly back to the modified Task!).
  • StickyNote (Table): Client collaboration layer mapping specialized formal visual feedback exclusively tracked via bidirectional isolated WebSocket structures natively smoothly to specific exact DOM components safely.

    • Many-to-OneTask (The target structural grid scope).
    • Many-to-OneUser (The precise author ID mapping formally backward).

📦 Setup & Initialization

1. Clone the repository

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

2. Install Packages

npm install

3. Environment Configuration

Construct a local .env exposing your PostgreSQL connections firmly isolating secrets securely formatting like so:

DATABASE_URL="postgresql://user:password@aws-0-eu-central-1.pooler.supabase.com:6543/postgres?pgbouncer=true"
DIRECT_URL="postgresql://user:password@aws-0-eu-central-1.pooler.supabase.com:5432/postgres"

PORT=5000
JWT_SECRET=your_super_secret_jwt_string
CLIENT_URL=http://localhost:5173

4. Push Database Schema

Execute Prisma's DB Push to force the Postgres engine to compile the QueueFlow analytical tables natively:

npx prisma db push

5. Launch Application

npm run dev

The Node.js server and Socket.io instances will aggressively spin up binding to Port 5000 executing seamlessly.


Anoop Kumar | Full Stack Developer

About

This is the backend for Queueflow website

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors