The full-stack starter kit for Cloudflare

TanStack Start renders every page at the edge, server functions replace the API, and D1 holds the data. One Worker, one deploy command.

Get lifetime access

  • TanStack
  • React 19
  • TypeScript
  • Cloudflare
  • Bun
  • Better Auth
  • Resend
  • Claude
  • Cursor

guardrails your AI agents followso their code fits the repository boundaries

the app your customers log intoit runs the minute you clone it

sign-up, teams, payments, emailworking on day one, not stubbed

your productthe only part left to build

one repo with the boring parts already finishedso you start on what makes your product different

What actually goes wrong.

Agents don't break your codebase in one commit.

They break it gradually: reading context nobody maintained, inventing a route through the code, and passing every check on the way to a regression you find two weeks later.

  • An AGENTS.md file last updated eight months ago, behind a terminal showing recent commits that changed the code since
    Someone wrote the context file months ago. Your agent is still working from it.
  • The same invoices feature created three times in three different directories: features, domains, and lib
    There's no established route for how features get built, so every agent takes a different one.
  • A pull request reporting 33 successful checks, overlaid by two production error reports
    The run comes back green and the PR looks right, but a regression shows up two weeks later.

Not an AI sticker on an old template.

Your codebase is half the harness.

You tuned the model, the prompts, the tools, and then dropped the agent into a repo it can't verify. Superslate is the other half: a map to read, boundaries to respect, and checks that prove every change.

AGENTS.md · the contract, verbatim

Do not disable CSRF, rate limits, signature checks, requireEmailVerification, or strict types.

Do not grant billing access from anything but a verified webhook.

Read before every change, by people and agents alike.

docs/architecture.md · rules the code keeps

  • validate input at the server function
  • resolve the organization in middleware
  • scope every query by organization_id
  • authorize with can(role, action)
  • batch every multi-row invariant
  • never edit an applied migration

Six rules, written where every agent reads them first.

bun run check · one command, every gate

Format, typecheck, tests inside workerd, the production build, and unused-code checks, in that order.

The same command runs in CI before every deploy.

tests/ · workerd, real migrations

Tenancy, permissions, and webhook replay are tested inside workerd against the migrations a deploy applies.

Drop an organization_id predicate and the suite fails.

What you're not building.

Skip to the part that's yours.

Auth, teams, billing, and email are already wired into one Worker and tested against a real D1. Your first commit is a feature, not a login form.

authentication

  • Password and magic-link sign-in
  • Optional Google provider
  • Email verification required
  • Reset revokes every session

billing

  • Same billing contract as the web edition
  • Signature-verified webhooks
  • Replays and stale events change nothing

organizations

personal + team

  • Personal org enforced by a D1 trigger
  • Invites, roles, transfers
  • Queries scoped by organization_id

server functions

  • Input validated at the boundary
  • Session and organization as middleware
  • Internal errors never reach the client

database

  • Typed SQL in repositories
  • Multi-row writes in one atomic batch
  • Migrations applied on deploy

email

  • Sent after the response, not before it
  • Verification, reset, magic link, invites
  • No key? Links go to the log

security

on by default

  • CSP and secure headers
  • CSRF check on every server function
  • www redirects to the apex

rate limiting

Workers bindings

  • Per IP on auth endpoints
  • Per user on every mutation
  • Auth fails closed

cron

Cron Triggers

  • Prunes expired sessions and invites
  • Same Worker, same bindings
  • Triggered locally with one URL

ui kit

Zag.js + CSS Modules

  • Same tokens as the web edition
  • Keyboard and ARIA from Zag.js
  • No Tailwind, no second system

tests

Vitest in workerd

  • Real D1, real migrations
  • Tenancy and permissions covered
  • Webhook replay and ordering covered

marketing site

  • No client JavaScript
  • Same design tokens as the app
  • Sitemap, llms.txt, markdown

your turn

  • 12 subsystems you don't write
  • Wired together, not a pile of packages
  • One command deploys it as yours

See what it costs

Why this stack.

Opinionated, on purpose.

One app instead of a client, an API, and a database server. Pages, server functions, webhooks, and the cron share one Worker and one database, so there is one thing to deploy and one place to look.

framework

TanStack Start + React 19over a separate API

Pages render on the server and hydrate. Server functions are typed calls, so there is no REST layer to keep in step with the UI.

contracts

TypeScript + Zodover types by convention

Every server function validates its input with the schema the form imports. Change a field and both sides fail at compile time.

runtime

Cloudflare Workersover a server to babysit

One Worker serves pages, server functions, webhooks, and the nightly cron. Nothing to patch, scale, or keep warm.

database

D1 + Kyselyover an ORM DSL

SQLite next to the Worker, queried with typed SQL. Triggers and atomic batches hold the tenancy rules, not application code alone.

toolchain

Bunover a five-tool Node pipeline

Installs, scripts, and the one check command run on Bun. Tests run inside workerd against a real D1 with the real migrations.

One Worker, one command.

Deploy to Cloudflare in one command.

bun run deploy builds the app, applies pending D1 migrations, then ships the Worker. The same command runs in the included GitHub Actions workflow.

wrangler.jsonc · one fileWrangler

pieceruns onconfigured in
pagesWorkers, server-renderedsrc/routes
server functionsWorkers, same requestsrc/functions
auth + webhooksWorkers server routessrc/routes/api
cronCron Triggerswrangler.jsonc
databaseD1db/migrations
rate limitsWorkers bindingswrangler.jsonc
live proof reference instance deployed to Workers with a remote D1release gate a custom-domain deploy is pending

The license.

Pay once for lifetime access.

Buy the TanStack Start edition, or every edition at once. Use it on every product you own.

TanStack Start

40% off

One TanStack Start app on one Cloudflare Worker and one D1 database.

Lifetime access:

$149Standard price $249

  • One licence for you or your company
  • Every developer in it, no seats
  • Unlimited products you own

Founding updates includedUpdates to the editions you own are included while they remain maintained and distributed.

every edition

All-access

38% off

React + Hono, TanStack Start, and Expo: every edition, one licence.

Lifetime access:

$249Standard price $399

  • $348 if bought separately
  • Every developer in your company, no seats
  • Private GitHub repository access

Founding updates includedUpdates to the editions you own are included while they remain maintained and distributed.

The first 50 licenses are this price, then $329.

Get All-access

Every licence covers you or the company you buy for, every developer in it, and unlimited products you own, with no runtime DRM. Client delivery and source redistribution are not included. Already own an edition? Its licence email carries a code that takes what you paid off All-access, so you pay only the difference. Read the license.

Common questions.

FAQ

How is this different from the React + Hono edition?

The React + Hono edition is an SPA with a Bun API and Postgres, built for a dashboard behind a login. This edition is one TanStack Start app on Cloudflare Workers and D1: pages render on the server, so it fits products where the public site and the app are one thing.

Why D1 instead of Postgres?

D1 runs next to the Worker with no connection pool, no server to run, and nothing to pay for while idle. The trade-off is SQLite semantics and no interactive transactions, so multi-row rules are enforced with triggers and atomic batches instead.

Where does Bun fit if production runs on Workers?

Bun installs dependencies and runs every script and the check command. Production code runs on workerd, which is why one deploy command is enough and why the tests run inside workerd too.

Does it ship the agent tooling?

It ships the AGENTS.md contract, the architecture rules, and one check command. The eval harness, golden paths, and local context server are React + Hono edition only for now.

Does it include a marketing site?

Yes, in every edition. apps/site is a static Astro site that sends no JavaScript, uses the same design tokens as the app, and deploys as its own Cloudflare Worker. It ships sample copy, outline privacy and terms pages, a sitemap, llms.txt, and a markdown copy of every page for agents.

Which coding agents does it work with?

Any of them. The contract is plain artifacts (markdown, JSON, runnable checks) read equally well by Claude Code, Cursor, Codex, or whatever ships next.

Can I buy every edition at once?

Yes. All-access includes React + Hono, TanStack Start, and Expo for $249, less than two editions bought separately, and adds the private GitHub repository. If you already own an edition, its license email carries a code that takes what you paid off All-access.

Ship this weekend.

By Monday, people can sign in and pay. You spend the weekend on the product.

Get lifetime accessRead the docs

Your license key lands the moment checkout completes.