Skip to content

A secure, organized, and scalable task management app built with Node.js, Express, PostgreSQL, Redis, BullMQ, and Prisma.

License

Notifications You must be signed in to change notification settings

MustafaHabibX/task-vault

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task Vault

Task Vault is a backend-focused task processing system built with Node.js, Express, Prisma, PostgreSQL, and BullMQ.
It provides job creation, queuing, processing, status tracking, and a complete authentication flow with JWT cookies.

This project simulates a real-world production backend where jobs are added to a queue and processed asynchronously by a dedicated worker.

Tech Stack

  • Backend: Node.js, Express
  • Queue System: BullMQ (Redis)
  • Database: PostgreSQL
  • ORM: Prisma
  • Authentication: JWT (HttpOnly Cookies)
  • Environment Management: dotenv
  • Validation & Utilities: bcrypt, cookie-parser
  • Worker: BullMQ Worker (separate process)

Features

  • User registration with email verification OTP.
  • Secure login with JWT stored in HttpOnly cookies.
  • Protected routes using custom authenticateJWT middleware.
  • Create new jobs and store them in the database.
  • Push jobs to BullMQ for background processing.
  • Dedicated worker to process tasks asynchronously.
  • Retrieve all jobs belonging to an authenticated user.
  • Retrieve details of a specific job.
  • Clean and modular code architecture following service/controller patterns.

Requirements

  • Node.js (v16 or higher recommended)
  • npm
  • PostgreSQL installed locally
  • Redis installed and running locally (required for BullMQ)

Installation & Setup

  1. Clone the repository
git clone https://github.com/MustafaHabibX/task-vault.git
  1. Navigate into the project folder
cd task-vault
  1. Install dependencies
npm install
  1. Configure environment variables
cp .env.example .env
  1. Setup Prisma
npx prisma migrate dev --name init
npx prisma generate
  1. Start the server
npm start
  1. Start the job worker
npm run worker
  1. Access the API at:
http://localhost:3000

Project Structure

task-vault/
│
├─ prisma/ # Prisma schema and migrations
├─ src/
│ ├─ controllers/ # Express route controllers
│ ├─ services/ # Business logic
│ ├─ routes/ # Express routes
│ ├─ queue/ # BullMQ queue setup
│ ├─ workers/ # Worker that processes background jobs
│ ├─ middleware/ # JWT authentication middleware
│ ├─ utils/ # Helper utilities (OTP, email, etc.)
│ ├─ server.js # Main API server entry point
│
├─ package.json
├─ .env.example
├─ .env
└─ README.md

Learning Outcomes

  • Implemented full authentication with JWT cookies.
  • Built a production-like job queue system with BullMQ and Redis.
  • Used Prisma for database management and migrations.
  • Structured Node.js backend using modern service → controller → route layering.
  • Handled OTP email flows and secure login.
  • Learned real-world worker/queue architecture used in industry.

About

A secure, organized, and scalable task management app built with Node.js, Express, PostgreSQL, Redis, BullMQ, and Prisma.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published