The Next.js starter kit for multi-tenant B2B SaaS.
Organizations, roles, billing and an admin console, already wired together, with tests that prove one customer can't reach another's data. For developers and small agencies. One-time purchase from $119.
$ npm run test:security ✓ tenant-isolation.security.test.ts (8) ✓ authorization.security.test.ts (14) ✓ billing.security.test.ts (11) … 21 more files Test Files 24 passed Tests 244 passed
The hard partReal bugs, not hypotheticals
What goes wrong in a B2B SaaS foundation
Sign-in and billing pages are quick to build. The bugs are in the rules between them. Each example below turned up in DryDock Kit's own reviews or is checked by its security suites, and each now has a test that fails if it comes back.
Tenant isolationTested
Organization B uses organization A's real IDs
Every organization-scoped record is looked up by organization and ID. Tests have B try to read, change or revoke A's API keys, members, invitations, roles and notifications with A's real IDs. Every attempt is refused, and A's rows are unchanged.
tests/security/tenant-isolation.security.test.ts
AuthorizationFound and fixed
An admin invites a second address as owner
The rule that only an owner can grant ownership lived in role changes, not in invitations. An admin could invite an address they control as owner, then delete the organization or change billing. Invitations now enforce it too.
SECURITY.md · F-01, high · fixed
WebhooksTested
The same payment event arrives twice
Providers retry deliveries. A redelivered event is recognised and acknowledged without changing billing a second time, tested for Stripe, Razorpay, Paddle and Polar. If two copies arrive at the same moment, unique keys in the database keep the effect single.
tests/integration · one webhook suite per provider
Billing stateFound and fixed
A late webhook moves a paid invoice back to open
Subscriptions had an ordering guard; invoices and payments didn't, so a late event could rewrite billing history and drop revenue figures. Impossible status changes are now refused, and all 50 transitions are tested.
SECURITY.md · F-12 · fixed
Roles and seatsFound and fixed
29 members on a 10-seat plan
The seat limit was checked when an invitation was sent and counted active members only, so an organization one seat under its limit could send any number of invitations. Pending invitations now reserve seats, and acceptance re-checks under a lock, tested with a concurrent race for the last seat.
SECURITY.md · F-03 · fixed
PaymentsFound and fixed
A €9 transaction labelled “lifetime” grants a lifetime plan
Paddle one-time purchases were resolved from data the buyer can set. Every provider's purchases now resolve only from the checkout the app itself recorded, and the amount and product must match.
SECURITY.md · H3, high · fixed
Rebuilding this for every client? The Teams license lets an agency start every client project from the same tested foundation. See the Teams license.
ProofRun on 2 October 2026, against PostgreSQL 16
Don't just trust the architecture. Test it.
The rules above are tests, and the tests ship in the download. The integration and security suites run against a real PostgreSQL database, in CI on every push, and on your machine with one command.
Tests passing
1,258
in 104 files, the whole suite (1 skipped)
Security tests
244
in 24 files under tests/security
Findings published
35
from two in-house reviews, each with its fix and its test
Database mocks
0
a real Postgres throughout; payment providers and email are stubbed, so no test calls the network
Another organization's API keys, members, invitations, roles, notifications and billing stay out of reach, even with their real IDs.
tenant-isolation.security.test.ts · 8 tests
Authorization
A lower role never acts on a higher one; only an owner grants ownership, on every path.
authorization.security.test.ts · 14 tests
Billing limits
Seat limits hold when two people accept the last seat at once; 20 simultaneous increments against a limit of 3 commit exactly 3.
billing.security.test.ts · 11 tests
Payments
A purchase is granted only for a checkout the app itself recorded, for the right product and amount.
purchase-resolution.security.test.ts · 10 tests
Webhooks
Forged signatures are refused with 400, oversized bodies with 413, and nothing is stored.
webhooks.security.test.ts · 6 tests
Impersonation
An admin impersonating a user can't add a passkey, change the password or move money, and the session ends at 30 minutes.
impersonation.security.test.ts · 10 tests
Admin 2FA
The platform console requires a second factor on the session, not just on the account.
second-factor.security.test.ts · 9 tests
Redirects
Open-redirect tricks after sign-in (tabs, line breaks, backslashes, encoded and protocol-relative URLs) are refused.
open-redirect.security.test.ts · 29 tests
Both reviews were done in-house. This is not an independent penetration test, and nothing here makes your application secure on its own: the code you add needs tests too, and the suites show the pattern. Every finding, fix and known limitation is in the security write-up.
WalkthroughReal screens, real test runs
From sign-up to deploy, in ten steps
Every screen here is a screenshot of DryDock Kit running locally on its seeded demo data, not a mock-up. The runs are real too.
3-minute video walkthrough: being recorded. Until it's here, the ten steps below are real screens and real test runs from a local install.
localhost:3000/sign-up
localhost:3000/organizations/new
localhost:3000/organizations/acme/members
localhost:3000/organizations/acme/members
localhost:3000/settings/billing
localhost:3000/settings/usage
localhost:3000/admin
tenant-isolation · 2 October 2026
$ npx vitest run tests/security/tenant-isolation.security.test.ts --reporter=verbose ✓ API keys — B acting on A’s key id › B cannot revoke or rotate A’s key, and A’s key keeps authenticating
✓ API keys — B acting on A’s key id › an API key is bound to its own organization — request-supplied org hints are ignored
✓ API keys — B acting on A’s key id › splicing A’s keyId with B’s secret (or vice versa) authenticates as nobody
✓ roles — B using A’s custom role id › B cannot assign or invite with a role that belongs to A
✓ members and invitations — B acting on A’s ids › B cannot remove, re-role, or revoke A’s member and invitation rows
✓ members and invitations — B acting on A’s ids › an invitation token for A cannot be accepted by a different user — the token is not a bearer credential on its own
✓ notifications — per user, not per tenant › B cannot read or mark read A’s notification, even with its real id
✓ billing — each tenant sees only its own › B’s billing overview never includes A’s subscription, invoices, or payments
Tests 8 passed (8)
npm test · 2 October 2026
$ npm test Test Files 104 passed (104) Tests 1258 passed | 1 skipped (1259)
scripts/deploy.sh · its eight steps
$ ./scripts/deploy.sh==> 1/8 Building images (app + migrate)
==> 2/8 Starting postgres
==> 3/8 Pre-flight: saas:check against the production .env
==> 4/8 Backing up the database before migrating
==> 5/8 Applying migrations (prisma migrate deploy)
==> 6/8 Applying reference data (roles, plans from config/)
==> 7/8 Starting the new app version
==> 8/8 Waiting up to 120s for /api/health/ready
# Steps 1–6 never touch the running app. A failure anywhere before step 7# leaves the previous version serving. Downtime is the few seconds step 7 takes# to swap one container for another — this is NOT a zero-downtime deploy.
IncludedEvery license gets the whole codebase
What's in the download
The foundation a B2B product needs, wired together and covered by tests. What's not in it: file uploads, a job queue, Redis, and a Vercel deployment path.
auth
Sign-in, every way
Email and password, magic link, passkeys and TOTP two-factor. Google, GitHub, X or Discord once you add their keys.
tenancy
Organizations and workspaces
Team organizations plus a personal workspace for every user. The tenant always comes from membership, never from the request.
tenancy
Roles and permissions
Owner, Admin and Member from one permission catalogue, checked on the server. Custom roles exist in the data model; there's no screen to create them yet.
tenancy
Invitations and seats
Invitations bound to the invited address. Pending invitations reserve a seat, so a plan's member limit holds.
billing
Four payment providers
Stripe, Razorpay, Paddle and Polar behind one interface. Only a verified webhook changes what a customer has.
billing
Every pricing model
Flat, per-seat, metered and one-time, with invoices, plan changes, cancel and resume.
billing
Plans and limits
Plans are data in src/config/plans.ts. Limits are enforced when data is written, inside the transaction.
Scoped per organization, hashed at rest, shown once, with a REST endpoint to build on.
platform
Notifications and flags
Live in-app notifications plus email, with preferences. Feature flags with percentage rollout and overrides.
marketing
Your marketing site
Landing page, pricing, blog, help center, changelog and roadmap for the product you build.
i18n
English and German
Every string, page and email translated with next-intl, ready for your next language.
quality
Tests on real Postgres
1,258 unit, integration and security tests, plus Playwright browser smoke tests.
ops
Docker and a deploy script
A non-root image, GitHub Actions CI, and a VPS deploy script with backup and health check.
ops
saas:check
One command inspects your production configuration, from secrets to webhook setup, and says what to fix before you deploy.
ai
Rules for AI agents
CLAUDE.md, AGENTS.md next to the code, Cursor rules, task prompts and a read-only MCP server.
Who it’s forAnd who it isn’t
For people with a B2B product to ship, not a foundation to rebuild.
Agencies and freelancers
Start every client's B2B app from the same tested foundation. The Teams license covers 10 developers and unlimited client projects.
Developers starting a B2B product
Organizations, roles and billing on day one, so the first weeks go into the product your customers pay for.
Small teams
Two to ten people building on shared rules that lint and tests enforce.
Builders billing Indian customers
Razorpay subscriptions alongside Stripe, Paddle or Polar, on one billing model. New Stripe accounts are invite-only in India.
Teams building with AI agents
Rules your agent reads for each folder, and tests that catch what it gets wrong.
Prototypes going to production
Move a proof of concept onto tenants, roles and billing you can trust.
It's probably not for you if
you need to deploy on Vercel or another serverless platform
you're new to TypeScript and Next.js
you want a hosted service instead of your own server
you want a landing page or a no-code tool
you need file uploads, a job queue or outgoing webhooks on day one
Why DryDock Kit?What you'd otherwise build and prove yourself
The foundation, plus the proof that it holds
A coding agent can write organizations, roles and billing in days. Checking that they hold together is the slow part, and that's the part DryDock Kit has already done.
Isolation you can check
A security suite on a real Postgres tries another tenant's reads, writes, API keys and billing with real IDs. Every attempt is refused, and the tests ship with the code.
Billing that survives retries
Stripe, Razorpay, Paddle and Polar behind one billing model. Only a verified webhook changes what a customer has, and a redelivered event changes nothing.
Razorpay alongside Stripe
Subscriptions for Indian customers on the same per-organization billing model, next to Stripe, Paddle or Polar.
Your server, one script
A Docker image and a VPS deploy script that checks your production config, backs up the database and migrates before the new version starts.
A license built for client work
Teams covers 10 collaborators and unlimited client projects, and lets you hand a client their product's source code. One payment.
Rules your agent reads
CLAUDE.md, AGENTS.md next to the code, Cursor rules and a read-only MCP server. Lint and the test suites catch what an agent gets wrong.
A good fit if
you want tenant isolation, roles and billing that are already proven by tests;
you bill Indian customers through Razorpay, alongside Stripe, Paddle or Polar;
you deploy to your own server with Docker;
you're an agency that wants one license for 10 developers and unlimited client projects.
Not the right fit if
you need to deploy on Vercel or another serverless platform;
you want a hosted service rather than code you run yourself;
you want a long public track record: DryDock Kit is new, and version 1.0 shipped in September 2026;
you only need sign-in today and would rather write and maintain the tests yourself.
AK
Abinithish Kumar
Software engineer, backend and distributed systems · India
I'm Abinithish Kumar, a software engineer in India working on backend and distributed systems. I built DryDock Kit because the parts every B2B product needs before its first feature are where the risk lives: one customer seeing another's data, billing that breaks when a webhook arrives twice, an admin who can promote themselves.
A coding agent can now write each of those parts in a day. What it can't do is show you they hold together. So DryDock Kit ships the proof with the code: security suites against a real database, and a written record of every finding and fix.
Support comes from me, by email. The security reviews were done in-house, not by an outside firm, and the write-up says so.
PricingOne-time purchase, no subscription
Pay once. Build every product on it.
Every license gets the whole codebase and every 1.x update, for as many products of your own as you build. Teams adds collaborators and client work.
Leave your address and you'll hear the moment you can buy. The founding price is for the first 30 sales only.
Launch pricing. Prices may increase as the product matures and gains a public update history.Checkout by Dodo Payments · tax added at checkout · Refund policy · License
FAQStraight answers
Questions buyers ask first.
Deployment first, because it decides whether DryDock Kit fits at all. More in the docs, and the full FAQ ships in the download.
Can I deploy DryDock Kit to Vercel?
Not as a supported path. DryDock Kit is built and tested to run as a long-lived Node.js server from its Docker image. It hasn't been run on Vercel or another serverless platform, and support doesn't cover them. These parts assume a server that stays up:
Live notifications use a stream that stays open for up to 15 minutes. Serverless platforms cap how long a function runs, so streams would end early and reconnect more often. (The Supabase edition uses Supabase Realtime instead.)
Each running instance opens a pool of up to 10 Postgres connections. Many short-lived instances need an external connection pooler.
Per-seat and metered billing need a scheduler that calls the billing job every 5–15 minutes.
The limit of 5 notification streams per user is kept in memory, per instance.
If Vercel is a must, a Vercel-first kit is the better choice today.
Where can I deploy it?
A VPS (Ubuntu with Docker and nginx) is the documented and tested path. scripts/deploy.sh builds the image, runs saas:check, backs up the database, migrates, starts the app and waits for its health check. It isn't zero-downtime, and rolling back is a documented manual step, not automatic.
AWS: an EC2 or Lightsail instance running Ubuntu is a VPS, so the same guide applies. Container services such as ECS or App Runner can run the Docker image, but they aren't documented or tested.
CloudPanel: a guide is included. It hasn't been verified on a live CloudPanel server yet, and it says so.
Kubernetes: not documented, and not planned.
What does it need to run?
Node.js 20.9 or newer (22.12 for the TanStack Start edition), PostgreSQL 16, and an SMTP server or Resend for email in production. The Supabase edition needs a hosted Supabase project (Postgres 17). There's no Redis and no queue to run.
Are there background jobs or file uploads?
There's no job queue: work happens during the request. One scheduled job reports metered usage and corrects per-seat quantities; run npm run billing:report-usage from cron or a systemd timer, or call POST /api/cron/billing with your CRON_SECRET. File uploads and storage aren't included, except in the Supabase edition, which keeps avatars and organization logos in Supabase Storage.
Is this a hosted service or source code?
Source code. You download a ZIP, run it on your own infrastructure and own your copy. Nothing is hosted for you, and there is no account to sign in to.
Which edition should I choose?
Next.js + Prisma, unless you already know you want another one. It's the edition the others are built from, and the first to get updates. Drizzle and TanStack Start keep the same features with a different data or web layer. Supabase swaps Better Auth for Supabase Auth, so a few sign-in details differ; the pricing section lists them. If you pick the wrong one, we'll switch it.
Which payment providers are supported?
Stripe, Razorpay, Paddle and Polar, behind one billing model: flat, per-seat, metered and one-time. Use one, several, or none to start. Only verified webhooks change what a customer has. Lemon Squeezy and Dodo aren't included; the docs show how to add a provider.
Can I use it for client projects?
Yes, with the Teams license: up to 10 collaborators, unlimited client projects, and you may hand a finished product's source code to the client who owns it. The Developer license covers your own products and your employer's.
Does it work with Claude Code, Codex and Cursor?
Yes. It ships CLAUDE.md, AGENTS.md files next to the code, Cursor rules, task prompts, a Definition of Done and a read-only MCP server. Lint and the test suites catch many mistakes an agent makes, and security changes are marked for a human to review. DryDock Kit itself calls no AI services and has no API costs.
How are updates delivered?
Every 1.x release is included. When one ships, you get an email with the new download at the address you bought with. UPGRADING.md shows how to merge a release into code you've changed, using a git branch that holds only unmodified releases. A 2.0 may be a paid upgrade.
What support is included?
Email support for installing, configuring and deploying along the documented paths, and for bugs in the shipped code. Developer requests are answered within 3 business days, Teams within 2. It doesn't cover building your features or debugging code you or an AI added. Support policy.
Does it phone home?
No. There is no telemetry and no analytics inside the product.
What's the refund policy?
Within 14 days: a full refund if the kit doesn't work as documented and we can't fix it, if you were charged twice, or if your download never arrived. Bought the wrong edition or tier? We'll switch it. Full details are on the refund policy page.
The Next.js starter kit for multi-tenant B2B SaaS.
Build the part only your product has.
Start from organizations, roles and billing that are already built and tested, and put your time into what makes your product different.