Skip to content

Custom Software · Open-source build

Multi-tenant SaaS core with row-level isolation

The unglamorous foundation every B2B product needs: organisations, members, roles, billing and audit, isolated at the database.

Built on
Next.js
Licence
MIT
Provenance
Open-source build

What it is

A Next.js application over PostgreSQL where every table carries a tenant column and row-level security policies enforce it, so a bug in application code cannot leak one customer's rows to another. Stripe handles subscriptions through webhooks that are idempotent and replayable. Every mutation writes an audit event.

What the build consists of

  1. 01Organisations, invitations, roles and permissions modelled once and reused everywhere
  2. 02PostgreSQL row-level security with the tenant set per request
  3. 03Stripe subscriptions, seats and invoices driven by verified webhooks
  4. 04Append-only audit log with actor, action, before and after
  5. 05Background jobs with retries and a dead-letter queue
  6. 06OpenAPI-described public API with per-tenant keys and rate limits

What you see in a demo

Two tenants in the same database, a deliberately broken query, and still no cross-tenant read. Then a subscription upgrade flowing from Stripe to a feature flag in under a second.