Skip to content
NomanAkram
All case studies
ai

PathFive

Decision-intelligence SaaS with a two-layer multi-tenant security model

PathFive
2 independent
Security layers
10
Simulation scenarios
5 weeks
Delivered in
The problem

What needed solving

A previous team's Supabase Edge Function build could not handle the complexity of a proprietary decision-scoring framework or the security a multi-tenant enterprise product demands.

The approach

How I built it

Rebuilt from scratch: a NestJS backend enforcing tenant isolation at two independent layers (middleware + Supabase RLS), a composite decision-quality scoring engine, and 10 stateful branching simulations with save/resume.

Architecture

How the system fits together

A NestJS API on Railway and a Next.js 14 front end on Vercel share a Supabase PostgreSQL database accessed through Prisma, with OAuth 2.0 for authentication. Every request carries an org_id that NestJS middleware checks, and Supabase row-level security enforces the same boundary inside the database, while NestJS guards separate the Manager, Executive and Admin roles. The decision engine scores each decision with a composite DQI, a weighted Alignment Score plus a Risk Score measured against configurable rubric thresholds. Simulations run as a JSON tree with stateful save and resume, manager dashboards track each manager's DQI over time, executive dashboards show decision quality across the organization live over Supabase Realtime, and Stripe handles subscription billing alongside affiliate tracking.

The outcome

Results

  • Delivered in 5 weeks
  • Tenant isolation enforced at two independent layers: NestJS middleware and Supabase row-level security
Overview

The details

Enterprise decision-intelligence SaaS built around the proprietary CARTA 5P framework (Purpose, Problem, Prognosis, Plan, Performance). Multi-tenant with org_id enforced at both NestJS middleware and Supabase RLS layers, a composite DQI scoring engine, branching simulations, and live manager and executive dashboards.

Key features
  • Two-layer tenant isolation: NestJS middleware + Supabase Row-Level Security
  • 5P Decision Engine: Purpose, Problem, Prognosis, Plan, Performance, auto-scored
  • Composite DQI: weighted Alignment Score + Risk Score against configurable rubric thresholds
  • 10 branching simulation scenarios with stateful save/resume
  • Manager and executive dashboards, live over Supabase Realtime
  • Manager, Executive and Admin roles via NestJS guards; Stripe billing with webhooks
Available for new projects

We can build something that lasts.

Tell me what you are building. I will come back with an honest take on approach, scope and timeline, usually within 24 hours.