Skip to content
Saasflare.dev
Get started
Dev & AI AgentClaude · Codex · Cursor
Browser ClientWeb · Mobile · Desktop
Saasflare Starter
weboRPCserver
monorepo · portable app layers
Cloudflare primitives
D1KVR2Queues
Open source · Agent-ready · MIT

A Cloudflare SaaS Starter, Ready for AI Agents.

Clone the repo and run the full stack with one command. AGENTS.md explains the project to coding agents, while two independently deployed Workers, end-to-end typed RPC, and branch-isolated environments give them a working system to extend.

  • MIT licensed
  • 2 typed Workers
  • 1 command for local full stack
  • E2E typed RPC
Developer Experience

Type-safe from your
browser to the database.

Frontend and backend are independent Workers — but to you, they're one codebase. Change an oRPC input or handler mounted in Hono; TypeScript updates your TanStack components without duplicated schemas or codegen.

tanstack.tsx·WEB · TanStack Worker
apps/web/src/routes/playground/components/users.tsx
orpc.ts·API · Hono Worker
packages/api/src/users.ts
Local-first dev

`pnpm dev` starts both Alchemy-managed Workers and their local Cloudflare bindings.

HMR everywhere

Hot module reload across the Worker boundary. Save your route handler; see it in the UI.

Previews per PR

Every pull request gets a unique URL with its own D1 branch. Review changes against real data.

Environments as code

One branch maps to one complete Cloudflare environment.

Alchemy reads the stage and environment file, then creates the Workers, bindings, data services, domains, and cross-service URLs as one stack. You push code; the repository handles the Cloudflare topology.

No wrangler commandsNo wrangler.tomlIsolated Alchemy stages
alchemy.run.tsBRANCH → ENV → STACK
devgit push
.dev.envenvironment contract
devstage

Push to dev → CI deploys the isolated development stack.

maingit push
.prod.envenvironment contract
prodstage

Push to main → CI deploys the production stack separately.

PR #42open / update PR
.dev.envenvironment contract
pr-42stage

A unique preview URL and isolated resources for this PR.

Close the PR → CI destroys its pr-42 preview stage automatically.
What's in the box

The plumbing is already connected.

The web app and API already talk to each other. Database migrations, typed RPC, file uploads, tests, and CI are included. Start with a working system, then change what you need.

AGENTS.md + rule packs

A root guide and task-specific docs explain where code belongs, how to query D1, and which project rules an agent should follow.

Two typed Workers

web on TanStack Start (:3000) and server on Hono (:4000), each with its own alchemy.run.ts, independently deployable, connected only by types.

End-to-end typed RPC

oRPC + shared Zod schemas plumb DB row → API → React Query hook; copy the ~25-line packages/api/src/todos.ts CRUD and go.

Drizzle + D1

Serverless SQLite at the edge with example users/posts/todos tables; migrations auto-generated and auto-applied on dev and deploy.

R2 / KV, wired

Every Cloudflare binding is wired and health-checked, plus a real presigned-upload flow in storage.ts with a react-dropzone UI you can copy — no server proxying, zero egress.

Alchemy IaC + CI

Pure-TypeScript IaC (no wrangler.toml) auto-computes URLs, CORS, and bindings; every PR gets a throwaway full-stack preview stage that self-destructs on close.

Architecture, not just features

Your frontend can change. Your backend does not have to.

Many full-stack starters optimize one web application. Saasflare starts with two independently deployable boundaries, so the API can serve every client your product grows into.

ClientsWorker boundariesCloudflare services
Typical full-stack starter
Browser
Full-stack web Worker
React + SSR · server functions · auth + business logic · database bindings
D1KVR2Queues
Saasflare architecture
Browser
React Native
Desktop app
Web Worker
direct to API
TYPED RPC
Hono API Worker
D1KVR2Queues
Architecture decision
Typical full-stack starter
Saasflare architecture
Deployment boundary
Web and server code ship as one full-stack application.
Web Worker and API Worker deploy independently.
Replace the frontend
Server functions may need to be extracted into a separate API first.
Keep the Hono API and replace only the client.
Add another client
A shared external API is an additional architecture step.
Web, React Native, and desktop clients share one backend.
Cloudflare infrastructure
Usually configured around one Worker application.
Bindings and business services stay behind the API Worker.
Environment lifecycle
Commonly centered on local and production configuration.
Separate dev, prod, and per-PR Alchemy stages.
Type contract
Types live inside the full-stack web application.
oRPC and Zod carry types across the Worker boundary.

A single Worker is a good fit for many products. Separate boundaries matter when the API, clients, and Cloudflare services need to evolve on different release cycles.

Quick start

Two Workers. One local command.

Clone a working system, not a code sample. Local development starts the TanStack web app, Hono API, D1, and Cloudflare bindings together — no Cloudflare login required.

Node.js 23.6+pnpm 10
Read the full setup and troubleshooting guide →
~/starter
$git clone https://github.com/saasflare-dev/starter.git$cd starter$pnpm install$pnpm dev
Browserhttp://localhost:3000Hono APIhttp://localhost:4000
Local configNo env file for the default local stack
FAQ

Questions you probably have.

Straight answers, no hedging.

Open GitHub Discussions
Less than you'd think. The agent reads AGENTS.md and handles bindings, deploy commands, and edge gotchas. You should still grasp the basics — what a Worker is, what D1 vs KV vs R2 are for — to review the plan before it ships. But you shouldn't have to remember Drizzle JOIN syntax at 2am.
Yes. D1 is just the default binding; the data layer goes through Drizzle, so swap in HyperDrive→Postgres, Supabase, Neon, or PlanetScale. You give up some edge-locality, but the rest of the stack — types, RPC, tests — works unchanged.
It ships with CI/CD (deploy.yml + preview.yml), integration tests against the real Cloudflare runtime via miniflare, and Playwright E2E that exercise every binding and RPC procedure. The stack is pinned to current versions — oRPC 1.13, Hono 4.10, React 19.2, Drizzle 0.45 — so upgrades fail loudly in CI, not prod.
TanStack Start (edge-optimized React 19 SSR) with TanStack Router + Query on the frontend Worker, Hono on the backend Worker, oRPC + shared Zod schemas for typed RPC between them, Drizzle over D1, Tailwind v4 + Shadcn/ui, and Alchemy for TypeScript IaC. Biome for lint/format, Vitest + Playwright for tests. There's even a Tauri desktop scaffold in the same monorepo.
For a small project that stays within Cloudflare's current free-plan limits, it can be. Workers, D1, KV, and R2 all offer free usage, and R2 does not charge egress bandwidth fees. Limits vary by product and can change, so check Cloudflare's pricing before launch. If you outgrow the free plans, you pay Cloudflare directly, not us.
Open-source starter

MIT-licensed. Free forever.

Need the complete Saasflare product source? PRO includes a private GitHub repo seat and every current product, available now at the early-bird price.

STARTER
MIT-licensed and free forever.
$0MIT · open source
Clone on GitHub
  • saasflare-dev/starter (AGENT.md + rule packs)
  • Deploy to your own Cloudflare account
  • GitHub Discussions community support
  • All future starter updates — free
No checkout and no license fee. Fork it and deploy to your own Cloudflare account.
MOST POPULAR
PRO
Every product. Lifetime free updates.
$169$79one-time · early-bird price
  • Everything in STARTER
  • Private GitHub repo seat + all product source code
  • Notify — webhook-to-desktop alerts
  • Analytics — 1KB privacy-first analytics
  • Tasks — long tasks that survive reloads
  • Affiliate — referral system
  • Smart Wallet — stablecoin payments & payroll
  • Lifetime free updates to ALL current products
  • Priority email support · < 24h
Early-bird privilege price.
MAX
PRO + US company registration service.
$799$599one-time · white-glove
  • PRO — every current product, lifetime free updates
  • SaaS-optimized LLC US company structure
  • Wyoming LLC + EIN + registered agent
  • 1-on-1 Lili US bank account opening
  • 1-on-1 Stripe onboarding guidance
  • VoIP US phone number
  • US business address (yr 1)
  • Architecture review on request
First-year US incorporation included. Annual compliance ($399/yr) starts year 2.
SAASFLARE NEWSLETTER

Follow what we’re building.

We’ll only email you when we have a product update or industry news genuinely worth your attention. No inbox noise—only content that’s useful to you.

Product updates and selected industry news. Unsubscribe in one click.