Tenantly
Multi-tenant SaaS starter
A B2B SaaS foundation with workspaces, team roles, plans and invoices, audit log and API keys, where tenant isolation is built into the data layer.
Concept project · fictional brand and sample dataApp in English
- 23
- automated tests passing
- 0
- rows leaked between tenants in the live isolation check
- 3
- roles: owner, admin and member
- 5.3 ms
- p50 per authenticated API request (1,000 requests)
The brief
Every B2B product rebuilds the same base: sign-up that creates a workspace, invites, roles, billing, an audit trail, API access and an internal admin view. The riskiest part is tenant isolation: one forgotten filter and a customer sees another customer's data.
What I built
- Sign-up creates an organization on the Free plan; one person can belong to several and switch between them
- Invites by single-use link with a 7-day expiry, and owner, admin and member roles from one permission matrix
- Free, Pro and Business plans with seat, project and API limits, prorated upgrades and downgrades at period end
- Audit log of sign-ins, invites, role and plan changes, API keys and support access, filterable by type
- API keys per organization, shown once and stored hashed, with a metered public API that enforces the plan quota
- Platform admin panel with MRR, tenants and usage, plus support impersonation that shows a banner and is logged
- Live isolation check in the admin panel that probes every tenant's data from every other tenant
The decision that mattered
Tenant isolation enforced by the data layer
Feature code never filters by tenant by hand: it uses a scoped Prisma client that adds the tenant to every read, update and delete, stamps it on every create, and throws if no tenant is set. A lint rule blocks the unscoped client outside sign-up, authentication and the admin panel. A forgotten filter stops being possible, instead of being something code review has to catch.