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.
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.
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.
Results
- Delivered in 5 weeks
- Tenant isolation enforced at two independent layers: NestJS middleware and Supabase row-level security
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.
- 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
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.