Open source starter kit

Ship SaaS products on Cloudflare in hours, not weeks

A Cloudflare-native starter kit with Workers, React Router v7 + Hono, Better Auth, Drizzle on D1 and a shadcn/ui design system — wired together with tests, quality gates and gated deploys.

$ git clone https://github.com/farshidpourlatifi/edgeseed my-app

Watch it go from clone to deployed

EdgeSeed in one unbroken take — cloning the repo, booting the dev servers, passing the quality gate, and shipping a gated release to a live Cloudflare Worker. The same commands you'll find in Getting started below.

No sound needed — it's a screen recording. Press play when you're ready; nothing downloads until you do.

What you'll see

  1. Step 1: Starts on this landing page.
  2. Step 2: git clone, then pnpm install.
  3. Step 3: Dev servers come up on Cloudflare Workers.
  4. Step 4: Build, typecheck and the boot check go green.
  5. Step 5: A version bump, then a gated release deploys.
  6. Step 6: The live Worker in Cloudflare — its D1 and rate-limit bindings, and real request logs.

Everything wired up on day one

Nine building blocks that normally take weeks to assemble, already integrated and covered by tests.

  • Cloudflare Workers runtime
    Runs at the edge on Workers with local dev through Wrangler, so production and localhost behave the same.
  • React Router v7 + Hono
    Server-rendered routes with loaders and actions, backed by a Hono app that owns every API surface.
  • Better Auth
    Email and password, GitHub and Google OAuth, plus organizations, invitations and role-based membership.
  • Drizzle ORM on D1
    Typed schema and migrations against Cloudflare D1, with a single request-scoped database client.
  • shadcn/ui design system
    Accessible primitives, CSS-variable theming and a first-class dark mode you actually own the code for.
  • MCP server for LLM tools
    Expose your app to agents over the Model Context Protocol, with every tool mirroring a public API route.
  • Auto-generated OpenAPI
    Route schemas emit an OpenAPI document that is checked into git — CI fails the build when it drifts.
  • Observability built in
    One correlation id per request — on the response header, every log line, and the Sentry issue. Quote it from an error page and land on the exact failure.
  • Quality gates
    ESLint, Prettier and gitleaks run as pre-commit hooks, blocking broken code and leaked secrets locally.
  • Gated deploys
    Deploys wait on lint, format, types, unit, e2e and a gitleaks history scan before any Worker ships.

One account, four ways in.

The same operation works from the web app, the REST API, the CLI, and an MCP server for LLM agents — one set of users, one permission model.

Web

Sign in and the dashboard reads the session cookie Better Auth set. The same principal every other surface resolves to.

web / dashboard
pnpm dev
# → localhost:5173/dashboard/settings

One request, one predictable path

No hidden globals and no duplicated data access. Here is exactly what happens between the edge and your database.

BrowserCloudflare Workerworker.tsHono middlewarelogger + db + auth per requestBetter Auth/api/auth/**Versioned API/api/v1 · OpenAPIRR loadersSSR pagesDrizzle ORMCloudflare D1 (SQLite)
  1. Worker entry

    Every request lands on a single Cloudflare Worker that binds D1 and environment secrets before anything else runs.

  2. Hono middleware

    Middleware builds a per-request context: a correlation id and scoped logger first, then a Drizzle database client and a configured auth instance, never shared between requests. The id follows the request out — response header, every log line, and any Sentry event.

  3. Better Auth

    Auth routes handle sessions, OAuth callbacks and organization membership, then hand the active user to downstream handlers.

  4. Versioned API

    Validated /api/v1 routes emit OpenAPI schemas, so breaking changes require a new version rather than a silent edit.

  5. React Router loaders

    Loaders receive the same request-scoped db and auth through AppLoadContext, so pages and the public API can never disagree about your data.

A monorepo you can navigate

Eight focused packages with clear boundaries, so a change to auth never means editing your UI library.

  • @starter/web
    app
    React Router v7 app with SSR loaders, layouts and the authenticated dashboard.
  • @starter/mcp
    server
    Model Context Protocol server exposing your domain to LLM tooling.
  • @starter/auth
    lib
    Better Auth configuration, session helpers and organization permissions.
  • @starter/config
    shared
    Zod-validated Worker env schemas and the app version, shared by both Workers.
  • @starter/db
    lib
    Drizzle schema, migrations and the request-scoped D1 client factory.
  • @starter/observability
    lib
    Structured logging, correlation ids and opt-in Sentry reporting, shared by both Workers.
  • @starter/ui
    lib
    shadcn/ui component library with the shared theme and design tokens.
  • @starter/cli
    tool
    Dev workflow scripts for migrations, seeds, the OpenAPI spec and product init.

Quality gates you cannot skip

The same commands run on your machine and in CI. If a gate fails, the deploy never starts.

Unit tests

76

Vitest, 9 suites across packages

E2E tests

9

Playwright: auth, health, landing

Mutation score

54%

Stryker, 294 mutants on core logic

CI jobs

4

quality, drift, e2e, gitleaks

~/edgeseed $ pnpm verify
› lint       eslint .                ok
› format     prettier --check .      ok
› test       vitest run (76)         ok
› secrets    gitleaks git --redact   ok
› build      turbo build             ok
› types      turbo typecheck         ok
› e2e        playwright test (9)     ok
7 gates passed — deploy unlocked
~/edgeseed $ pnpm test:mutation
Stryker  mutating packages + app server…
killed 159   survived 131   no-coverage 4
mutation score 54.1%
report: reports/mutation/index.html
~/edgeseed $ pnpm verify
> edgeseed@0.2.1 verify

lint — eslint . clean
format — All matched files use Prettier code style!
unit — vitest run
 ✓ packages/db schema.test.ts (33 tests)
 ✓ ui terminal-timeline.test.ts (16 tests)
 … 7 more suites
 Test Files 9 passed (9) · Tests 76 passed (76)
secrets — gitleaks git --redact
 INF 28 commits scanned
 INF no leaks found
build — 2 tasks successful
 Time: 33ms >>> FULL TURBO
types — 8 packages clean
e2e — Running 9 tests using 1 worker
 9 passed (18.6s)

7 gates passed — deploy unlocked
~/edgeseed $ pnpm test:mutation
mutation run complete
killed 159   survived 131   no-coverage 4
mutation score 54.1%
report: reports/mutation/index.html

Running locally in 4 commands

No dashboard clicking required. Everything below works against local D1 before you deploy.

  1. Clone the repository

    Clone with full history so you can keep pulling upstream updates through the upstream remote later.

    $ git clone https://github.com/farshidpourlatifi/edgeseed my-app
  2. Make it yours

    Installs dependencies, wires the git hooks, and stamps your product name onto the Workers and config.

    $ pnpm install && pnpm init:product my-app
  3. Apply migrations and seed

    Runs Drizzle migrations against local D1 and loads a demo user and organization.

    $ pnpm db:migrate && pnpm db:seed
  4. Start developing

    Boots the app at http://localhost:5173 with hot reload against local D1.

    $ pnpm dev