A typesafe, modern, opinionated full-stack template, built for the edge, with deployment to Cloudflare Workers configured.
Raed more about the architectural choices behind the stack here!
| Layer | Tech | Role |
|---|---|---|
| Frontend | Vite 8, React 19, TanStack Router & Query | SPA, file-based routes, typed data fetching |
| API | Hono | Lightweight HTTP app; same createApp() runs on Node (dev) and Workers (prod) |
| Types | Hono RPC (hc<AppType>) |
Client infers request/response shapes from the server — no OpenAPI codegen |
| Auth | Better Auth | Email/password, cookie sessions, Kysely adapter |
| DB | Prisma schema → Kysely | Migrations + generated SQL types; queries in app code |
| UI | shadcn/ui (Tailwind 4) | Shared @acme/ui package |
| Deploy | Cloudflare Workers + Assets, Hyperdrive, Neon | Edge runtime, pooled Postgres to Neon; PR preview branches optional |
| Monorepo | pnpm, Turborepo | Shared packages, cached tasks |
Local dev: Vite proxies /api → apps/api (Node). Production: apps/worker serves the built SPA and API on one origin.
apps/
web/ # Vite + React SPA
api/ # Node dev server (Hono)
worker/ # Cloudflare Worker (production + previews)
packages/
hono-app/ # API routes, middleware, Zod validators — imported by api + worker
auth/ # Better Auth config
db/ # Prisma schema, migrations, Kysely client
ui/ # shadcn components + styles
tooling/ # Shared ESLint + TypeScript configs
Rename @acme/* package scopes when you fork. See DEPLOYMENT.md for Cloudflare, Neon, and CI.
- Use this template on GitHub, then clone your new repo.
docker compose up -d- Copy env examples and set a local auth secret:
cp .env.example .env
cp apps/api/.env.example apps/api/.env
cp apps/web/.env.example apps/web/.env # optional
# paste into apps/api/.env as BETTER_AUTH_SECRET=
openssl rand -base64 32pnpm installpnpm db:migratepnpm dev→ http://localhost:5173
See DEPLOYMENT.md.
| Command | Description |
|---|---|
pnpm dev |
Web + API (not Worker) |
pnpm build |
Build apps/packages |
pnpm db:migrate |
Prisma migrate dev |
pnpm lint / pnpm typecheck |
CI-style checks (run on pre-commit via husky). |