Thriving Thriving TypeScript TS
โ†‘ 56 ?
b2b-saas-starter brandhaug/b2b-saas-starter

Cloudflare-first B2B SaaS monorepo starter. TanStack Start, Effect v4, Drizzle on D1, Better Auth, Alchemy v2, REST + MCP, React Email, Storybook, Vitest, Playwright, oxlint, oxfmt, Vite+, pnpm.

https://b2b-saas-starter-web.brandhaug.workers.dev โ†—
HEALTH ? 98 / Healthy
// solo builder// hidden gem monorepostartertypescriptalchemyb2bbetter-authcloudflarecloudflare-workersd1drizzle-orm ?

// readme

B2B SaaS Starter

A Cloudflare-first repository for building a B2B SaaS with TanStack Start, Effect v4, Drizzle D1, Better Auth, and Alchemy.

The public site explains the repository. The Reference Application demonstrates workspaces, membership and permissions, billing, API tokens, webhooks, notifications, audit events, and account administration.

Run locally

Install the Vite+ CLI, which manages the pinned Node and pnpm toolchain:

vp install
cp .env.example .env
pnpm run dev

Open http://localhost:3071. Optional providers stay inactive until configured. For credential sign-in, migrate and seed local D1, then restart the dev server.

Architecture

Three Workers share the business-use-case layer in packages/capabilities, with billing and email-delivery infrastructure in their dedicated packages:

  • apps/web: public content, authenticated UI, server functions, and Better Auth.
  • apps/api: REST and MCP interfaces over the same workspace operations.
  • apps/background:โ€ฆ