Overview

A full-featured TanStack Start SaaS starter for Cloudflare Workers.

The TanStack template is a full-featured SaaS starter built with TanStack Start, TanStack Router, React 19, and Vite. It targets Cloudflare Workers and includes D1 database access, R2 object storage, authentication, payments, email, content, internationalization, and AI examples.

Auth, database, storage, email, and content/i18n are integrated end to end. Examples and UI starters still need your product's policies, limits, data, and operational hardening — the feature status table below spells out each one.

The runtime is part of the architecture: DB and UPLOADS are per-request Cloudflare bindings, the database is SQLite-compatible D1, and production ships with wrangler deploy rather than a Node server or container.

Tech stack

ConcernTechnology
FrameworkTanStack Start + TanStack Router, built by Vite
UI runtimeReact 19 + TypeScript
AuthenticationBetter Auth (email/password, GitHub/Google OAuth, admin plugin)
DatabaseCloudflare D1 (SQLite) + Drizzle ORM
StorageCloudflare R2
PaymentsCreem
EmailResend + React Email
Internationalizationi18next + react-i18next
Docs and contentFumadocs MDX, blog, and legal collections
AI chatVercel AI SDK + OpenAI
AI mediaReplicate image, video, and audio tasks
StylingTailwind CSS v4 + shadcn/ui
ToolingBiome, Vitest, pnpm, Wrangler

Feature status

These labels are used throughout this guide:

  • Integrated — connected end to end in the template.
  • Example — a working reference that needs product-specific policy, limits, or data.
  • UI starter — a designed surface with mock/static data or unfinished actions.
AreaStatusScope
AuthenticationIntegratedEmail/password, required verification, reset, GitHub/Google OAuth, sessions, account linking, and admin plugin
DatabaseIntegratedD1/SQLite, Drizzle auth and payment schemas, and committed SQL migrations
PaymentsExampleAuthenticated Creem checkout, order query, signature verification, and selected webhook events
Email/contactIntegratedResend delivery for verification, reset, and contact messages
NewsletterUI starterEmail template only; no subscription route or persistence
AIExampleOpenAI chat streaming and Replicate media task flows; production quotas and rate limits are not included
Content and i18nIntegratedFumadocs docs, blog/legal collections, and English/Chinese i18next routing
Dashboard/adminUI starterSeveral pages use mock/static data; route guards and authenticated APIs provide connected foundations
StorageIntegrated (example policy)Authenticated upload to durable R2 and Worker-served objects; add product limits and stronger validation

Application surfaces

TanStack Router uses pathless layout routes to share UI without adding segments to the public URL:

  • Marketing (_marketing) — landing, pricing, blog, legal, contact, payment success, and AI pages.
  • Authentication (auth) — login, registration, verification guidance, forgot password, and reset password.
  • Dashboard (_dashboard) — authenticated dashboard, account/settings, and admin surfaces.
  • Content (_docs) — Fumadocs-powered documentation, alongside blog and legal collections.
  • Service routes (src/routes/api) — Better Auth, contact email, Creem, storage, user/admin, chat, and media APIs.

The optional {-$locale} segment wraps these layouts: English URLs are unprefixed, while Chinese URLs use /zh.

Start here

Follow the primary journey from a local Worker to a production deployment:

On this page