HomeCase studiesReal-Time Multi-Tenant Project Delivery Platform on Next.js,...

Case study · Vancouver, Canada

Real-Time Multi-Tenant Project Delivery Platform on Next.js, NestJS, and PostgreSQL

Agile Delivery & Team Collaboration SaaS

We designed and shipped a multi-tenant project management and sprint delivery SaaS built on Next.js, NestJS, PostgreSQL, and Redis. Distributed engineering and product teams manage backlogs, dependency graphs, sprint capacity, and live Kanban boards with sub-second state synchronization across browser sessions. Strict PostgreSQL tenant isolation, fractional card ordering, and WebSocket event fan-out keep concurrent board edits deterministic without full-page refreshes.

Industry
Agile Delivery & Team Collaboration SaaS
Solution
Multi-tenant Next.js web application backed by a modular NestJS API, PostgreSQL row-level tenant boundaries, and Redis-backed WebSocket synchronization.
Platforms
Web & API
Stack
Next.js · TypeScript · NestJS · PostgreSQL · Redis · WebSockets
Location
Vancouver, Canada · delivered remotely
Role
Engineering, with the team behind for mobile and QA

Delivered remotely for a business based in Vancouver, Canada. Names withheld by agreement.

Project Overview

Distributed product teams lose delivery momentum when planning tools lag behind real engineering work. From Vancouver, we architected a multi-tenant project management platform built around Next.js, NestJS, PostgreSQL, and Redis so product managers, engineers, and delivery leads can coordinate backlogs, sprint boards, and cross-team dependencies in a single responsive workspace. Rather than bolting real-time updates onto a legacy CRUD database, the platform treats concurrent board state, granular permission scoping, and auditability as first-class primitives across the browser and API layers.

Business Bottleneck

Growing engineering organizations frequently outgrow lightweight task checklists yet stall inside bloated legacy trackers that take seconds to load a sprint board. Teams struggled with stale Kanban states during live standups, accidental overwrites when two leads prioritized the same backlog column, and fragmented spreadsheets used to track cross-project blockers and team capacity. Workspace administrators also lacked verifiable tenant isolation and role-scoped visibility when external contractors joined specific client-facing boards.

Architectural Strategy

We split presentation and domain orchestration cleanly between Next.js and NestJS while keeping strong TypeScript contracts across the wire. Next.js handles initial server-rendered project shells, fast route transitions, and optimistic local board mutations, while NestJS owns authentication, RBAC policy evaluation, WebSocket room broadcasting, and background job dispatch.

PostgreSQL serves as the single source of truth for issues, epics, comments, time logs, and dependency graphs. Instead of polling endpoints every few seconds, NestJS publishes committed state changes over Redis Pub/Sub to active Socket.IO rooms so every connected browser patches its local query cache incrementally.

Core Capabilities

  • Live Sprint & Kanban Boards: Instant card drag-and-drop with optimistic UI updates, column WIP limits, and automatic conflict reconciliation across connected users.
  • Hierarchical Work Breakdown: Initiatives, epics, stories, and subtasks modeled cleanly with roll-up progress indicators and cycle-free blocker links.
  • Role-Scoped Workspace Access: Granular permissions separating organization owners, project leads, contributors, and external guest reviewers down to board and field visibility.
  • Workload & Capacity Views: Sprint allocation heatmaps comparing estimated story points and logged hours against individual member availability and holiday calendars.
  • Automated Workflow Rules: Configurable triggers that transition parent epics, assign reviewers, or dispatch outbound webhooks when issue statuses or pull-request links change.
  • Keyboard-First Command Palette & Search: Sub-second full-text search across issue titles, descriptions, and comment threads scoped strictly to authorized projects.

Technical Architecture

Flow: Browser (Next.js App Router) -> ALB (HTTPS & WSS) -> NestJS API / WebSocket Gateway -> PostgreSQL (RLS + Fractional Index) & Redis (Pub/Sub + BullMQ)

Incoming browser requests authenticate with short-lived JWTs and HttpOnly refresh cookies validated at the NestJS gateway. On initial project load, Next.js fetches the hydrated board snapshot via REST so users see rendered columns immediately without a blank loading spinner, then opens an authenticated WebSocket channel bound to the workspace and project room.

When a user moves or edits a task, the client applies an optimistic update and sends the mutation along with the task's current version integer. Inside NestJS, a PostgreSQL transaction sets app.current_tenant_id, evaluates Row-Level Security policies, verifies the version match, computes a new fractional index key if the card changed rank, commits the change, and emits an event through Redis Pub/Sub. Every NestJS container subscribed to that project channel pushes the delta payload to connected clients, while BullMQ workers asynchronously process mention notifications, SLA escalations, and webhook deliveries.

Technology Stack

Category Technology detail
Frontend Framework Next.js (App Router) with React Server Components and optimistic client mutations
Language & Typing TypeScript shared contracts for DTO validation, API responses, and socket payloads
Backend Runtime NestJS modular monolith exposing REST endpoints and authenticated WebSocket gateways
Primary Database PostgreSQL with Row-Level Security policies, ltree hierarchies, and GIN full-text indexes
Realtime Coordination Redis Pub/Sub adapter synchronizing Socket.IO rooms across stateless NestJS pods
Background Queues BullMQ on Redis handling recurring tasks, webhook retries, and digest notifications
Container Orchestration Docker images deployed on AWS ECS Fargate behind an Application Load Balancer
Observability OpenTelemetry traces and structured JSON logs exported to AWS CloudWatch

Engineering Trade-offs & Solutions

Challenge Architectural Solution
Reordering cards without rewriting entire column indexes Lexicographical fractional indexing on text rank keys with background rebalancing when key strings exceed threshold length
Maintaining tenant boundaries across shared tables PostgreSQL Row-Level Security bound per transaction via NestJS request context instead of relying solely on ORM query filters
Preserving WebSocket fan-out across autoscaling API pods Stateless Socket.IO rooms backed by Redis Pub/Sub so any ECS task can broadcast mutations to users on other instances
Preventing circular task-blocking graphs Bounded recursive CTE cycle check inside the dependency insertion transaction before persisting blocker edges
Keeping heavy search queries from slowing board mutations Composite B-tree indexes for board views paired with dedicated GIN tsvector indexes and cursor pagination for search

Security & Reliability

Every API endpoint enforces both NestJS guard evaluation and database-level PostgreSQL Row-Level Security, creating defense in depth for multi-tenant workspaces. Guest collaborators receive project-restricted tokens that exclude private internal comments and organization billing metadata at the serializer boundary.

Webhook deliveries and notification bursts run outside the synchronous request path inside BullMQ queues with exponential backoff, idempotency keys, and dead-letter inspection. Automated database migrations execute as pre-deploy jobs with backward-compatible schema steps so rolling ECS container updates drop zero active WebSocket connections abruptly.

Performance & Scale

Board load queries avoid N+1 joins by fetching normalized task summaries, assignee profiles, and label mappings in batched relational queries indexed on (tenant_id, project_id, status_id, rank_key). Client state separates static workspace metadata from fast-changing board items, preventing full board re-renders when a single comment arrives.

Read-heavy reporting exports—such as velocity charts and cumulative flow diagrams—aggregate from pre-computed daily snapshot tables refreshed asynchronously when sprint states change, shielding live transaction throughput from analytical scans.

Operational Outcomes

Engineering and product squads replaced disconnected spreadsheets and sluggish legacy trackers with a single predictable workspace where board changes appear instantaneously for every team member. Delivery leads gain clear visibility into blocked dependencies and sprint capacity before bottlenecks cascade into missed milestones, while administrators onboard external partners safely under verifiable tenant isolation and complete change histories.

01 — Questions

asked about this kind of project

How does the board avoid rewriting hundreds of task rows whenever a user reorders a Kanban card?

Card positions use lexicographical fractional indexing stored as text keys in PostgreSQL. Moving a task between two neighbors computes an intermediate string key in constant time, updating only the moved row unless key length exceeds a threshold that triggers a scoped column rebalance.

How do multiple teammates dragging cards in the same sprint avoid silent overwrites?

Each task carries a monotonically increasing version column checked on every PATCH and socket mutation. Stale updates fail with a conflict payload that reconciles the client cache via the latest Redis Pub/Sub broadcast instead of blindly clobbering newer edits.

Why pair Next.js App Router with a separate NestJS backend instead of placing all logic in Next.js Route Handlers?

Long-lived WebSocket gateways, BullMQ workers, and domain-heavy permission guards require persistent stateful worker processes and clean horizontal scaling independent of SSR rendering bursts.

How is tenant data isolated across organizations sharing the same PostgreSQL cluster?

NestJS middleware resolves the verified organization ID from the JWT and binds it to a transaction-local PostgreSQL session setting. Row-Level Security policies enforce tenant predicates at the database engine layer so an omitted WHERE clause cannot leak cross-tenant tasks.

How are circular task dependencies prevented when linking blockers across projects?

Before committing a dependency edge, a NestJS domain service runs a bounded recursive CTE traversal in PostgreSQL from the target task to check whether the source task already appears as an ancestor, rejecting cycles inside the same transaction.

03 — Similar project?

describe what is different about yours

Build yours.

Tell me what exists, what you need and the deadline. Fixed price for a defined scope, or $55/day (8–9 hours work) with a written plan first.

Solitaire Corporate Park, Makarba, Ahmedabad, Gujarat 380015, India · IST (UTC+5:30) · --:-- IST · Mon–Fri 09:00–18:00 IST · US & EU overlap daily

No newsletter, no CRM. Just a reply.