Skip to content

Repository files navigation

TaskForge

Production-grade multi-tenant SaaS project management platform built with Next.js, NestJS, PostgreSQL, Redis, Socket.IO, Stripe, Docker, and CI/CD.

TaskForge provides organizations with project and task management, role-based access control, Kanban workflows, real-time notifications, email automation, activity tracking, and subscription billing.

Features

  • Multi-tenant organization architecture
  • JWT authentication with refresh-token rotation
  • Role-based access control
  • Organization membership and invitations
  • Project and task management
  • Kanban board with drag-and-drop
  • Real-time notifications with Socket.IO
  • Transactional email notifications with Nodemailer
  • Stripe subscription billing
  • Activity and audit logging
  • Redis caching
  • BullMQ background workers
  • Responsive dashboard and analytics
  • Docker development and production environments
  • GitHub Actions CI/CD

Tech Stack

Frontend

  • Next.js 15
  • React 19
  • TypeScript
  • Tailwind CSS
  • Zustand
  • TanStack React Query
  • Socket.IO Client
  • dnd-kit

Backend

  • NestJS 11
  • TypeScript
  • PostgreSQL 16
  • TypeORM
  • Redis 7
  • BullMQ
  • Socket.IO
  • Nodemailer
  • Stripe SDK

Infrastructure

  • Docker
  • Nginx
  • GitHub Actions
  • Pino structured logging

Security

  • JWT
  • Passport
  • Argon2
  • Role-based authorization
  • Request throttling
  • Refresh-token rotation

Architecture

Next.js Frontend
       |
       v
  NestJS API
       |
 +-----+-----+
 |     |     |
 v     v     v

PostgreSQL Redis Socket.IO | v BullMQ Workers

Project Structure

TaskForge/
├── frontend/
│   └── src/
│       ├── app/
│       ├── components/
│       ├── features/
│       ├── hooks/
│       ├── lib/
│       ├── store/
│       └── types/
│
├── backend/
│   └── src/
│       ├── modules/
│       │   ├── auth/
│       │   ├── users/
│       │   ├── organizations/
│       │   ├── projects/
│       │   ├── tasks/
│       │   ├── activity/
│       │   ├── realtime/
│       │   ├── notifications/
│       │   ├── mail/
│       │   ├── billing/
│       │   └── health/
│       ├── infrastructure/
│       ├── common/
│       └── shared/
│
├── nginx/
├── scripts/
├── docs/
├── screenshots/
├── docker-compose.yml
└── docker-compose.prod.yml

Multi-Tenancy

TaskForge uses organization-based multi-tenancy.

Every request is validated through the authorization layer before accessing organization resources.

Request
   |
   v
Authentication
   |
   v
Organization Membership
   |
   v
Role Authorization
   |
   v
Service Layer
   |
   v
PostgreSQL

Organization context is validated before services access tenant-specific resources.

Authentication

Authentication includes:

  • JWT access tokens
  • Refresh tokens
  • Refresh-token rotation
  • Token theft detection
  • Passport authentication
  • Argon2 password hashing
  • Role-based authorization
  • Request throttling

Real-Time Notifications

TaskForge uses Socket.IO for real-time communication.

Users can connect to personal and organization-specific rooms.

user:{userId}
org:{organizationId}

Domain events can trigger:

  • Real-time WebSocket broadcasts
  • Persistent notifications
  • Email notifications
  • Activity logging

Example events:

task.created
task.updated
member.joined
notification.created

Event-Driven Workflow

Mutations can emit domain events that are consumed by multiple services.

Domain Event
     |
     +------> Activity Log
     |
     +------> Socket.IO
     |
     +------> Notification
     |
     +------> BullMQ Worker
                   |
                   v
                 Email

Background processing is handled through BullMQ and Redis to keep asynchronous operations outside the main request lifecycle.

Project Management

TaskForge supports:

  • Projects
  • Tasks
  • Task assignment
  • Task priorities
  • Due dates
  • Kanban workflows
  • Drag-and-drop task management
  • Project analytics
  • Activity history

API

Authentication

POST /api/v1/auth/register
POST /api/v1/auth/login
POST /api/v1/auth/refresh
GET  /api/v1/auth/me
POST /api/v1/auth/logout

Organizations

POST /api/v1/organizations
GET  /api/v1/organizations
POST /api/v1/organizations/switch
GET  /api/v1/organizations/current
GET  /api/v1/organizations/members
POST /api/v1/organizations/invites

Projects & Tasks

POST  /api/v1/projects
GET   /api/v1/projects
POST  /api/v1/projects/{id}/tasks
GET   /api/v1/tasks
PATCH /api/v1/tasks/{id}

Notifications

GET  /api/v1/notifications
GET  /api/v1/notifications/unread-count
POST /api/v1/notifications/{id}/read
POST /api/v1/notifications/read-all

Getting Started

Prerequisites

  • Node.js 20+
  • PostgreSQL 16+
  • Redis 7+
  • npm
  • Docker (optional)

Backend

cd backend
cp .env.example .env
npm install
npm run migration:run
npm run start:dev

Start the background worker:

cd backend
npm run start:worker:dev

The API runs on:

http://localhost:3000

Frontend

cd frontend
cp .env.local.example .env.local
npm install
npm run dev

The frontend runs on:

http://localhost:3001

Docker

Start the development environment:

docker compose up --build

Start the production environment:

docker compose -f docker-compose.prod.yml up --build -d

Environment Variables

Backend

PORT=3000
NODE_ENV=development

DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_NAME=taskforge

REDIS_HOST=localhost
REDIS_PORT=6379

JWT_SECRET=your-secret-key
ACCESS_TOKEN_TTL=15m
REFRESH_TOKEN_TTL=7d

SMTP_HOST=
SMTP_PORT=587
SMTP_SECURE=false
SMTP_USER=
SMTP_PASS=
SMTP_FROM=

STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=

FRONTEND_URL=http://localhost:3001

Frontend

NEXT_PUBLIC_API_URL=http://localhost:3000
NEXT_PUBLIC_SOCKET_URL=http://localhost:3000

Engineering Highlights

TaskForge demonstrates production-oriented full-stack engineering patterns:

  • Multi-tenant SaaS architecture
  • Modular NestJS backend
  • Next.js App Router
  • Organization-scoped authorization
  • JWT authentication and token rotation
  • RBAC
  • PostgreSQL relational data modeling
  • Redis caching
  • Background job processing with BullMQ
  • WebSocket-based real-time communication
  • Event-driven architecture
  • Transactional email workflows
  • Stripe billing integration
  • Structured logging
  • Dockerized infrastructure
  • CI/CD automation
  • Responsive frontend architecture

Use Cases

TaskForge can be used as a reference implementation for:

  • Multi-tenant SaaS applications
  • Project management platforms
  • Team collaboration systems
  • Kanban applications
  • Organization-based RBAC
  • Real-time web applications
  • Event-driven backend systems
  • Stripe subscription platforms
  • Next.js + NestJS applications

License

MIT

About

Production-style multi-tenant SaaS project-management application. Includes organizations/workspaces, projects, tasks, authentication, real-time functionality, subscriptions and billing.

Topics

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages