Atlas
A multi-tenant SaaS core — auth, billing, tenancy — built once, hardened, and reused on every product since.
STACK — Next.js · TypeScript · PostgreSQL · Prisma · Stripe · Redis
FIG. 02.0 — SYSTEM COMPOSITION, DRAWN IN CODE
THE PROBLEM, PLAINLY
Every SaaS project begins with the same six weeks: authentication, organizations, roles, billing, emails, background jobs. Atlas was built to make those six weeks a checkbox — a production-grade core we harden continuously and fork per product.
The discipline was to build it like it already had paying tenants: rate limits, row-level tenancy checks in one place, idempotent webhooks, and load numbers measured rather than assumed.
Tenancy as a single choke point
Every query passes a tenant resolver — one module owns isolation, so a leak requires beating one review, not thirty. Postgres row-level security backs it up at the database.
Billing that survives retries
Stripe webhooks are idempotent and event-sourced: every billing state transition replays cleanly, and a dropped webhook heals on the next sync pass.
Server components by default
Pages render on the server; interactivity ships as islands. First Load JS stays under 100 kB on every route — measured in CI, failed if exceeded.
Load-tested before launch-tested
k6 smoke and soak runs are part of the pipeline. The p95 number on this page comes from the soak report, not from a quiet afternoon.
$ next buildRoute (app) Size First Load JS┌ ○ / 4.1 kB 93 kB├ ○ /dashboard 8.7 kB 99 kB├ ƒ /api/v1/* — —└ ○ /settings/billing 6.2 kB 97 kB$ k6 run soak.js --vus 200 --duration 30mhttp_req_duration p50=61ms p95=182ms p99=290mshttp_req_failed 0.00%checks 100.00% (18,442 passed)
- Pooled
- Shared schema, RLS-enforced — default for small tenants
- Siloed schema
- Per-tenant schema for regulated data
- Read replica
- Analytics traffic isolated from the primary
- Session model
- HttpOnly, rotating, device-scoped revocation
ENGINEERING NOTE
The core insight is negative space: Atlas is defined by what product teams never have to think about again. Every hour it absorbs is an hour a product bet gets back.
0ms
P95 UNDER 200-VUS SOAK
0
LIGHTHOUSE PERFORMANCE
0kB
FIRST-LOAD JS CEILING, ENFORCED IN CI
00
CROSS-TENANT READS IN AUDIT

