Skip to content

Templates

TemplateUse case
saas-b2bMulti-tenant SaaS with Next.js 16 + tRPC + Postgres + Drizzle + Better-Auth
api-onlyPure backend service: NestJS + Fastify + Drizzle
libTypeScript library: Hono (optional) + tsup + Changesets, ESM-only

The flagship template. Layout:

apps/web/ Next.js 16 (App Router, RSC)
packages/db/ Drizzle schema (auth + tenants), client, migrations
packages/auth/ Better-Auth server + client
packages/trpc/ Routers, context, public/protected/tenant procedures
packages/shared/ Zod schemas
packages/ui/ shadcn-based components, cn helper
docker-compose.yml Postgres 16 + Redis 7

Highlights:

  • Multi-tenant pool + Postgres RLS via tenantProcedure (sets app.tenant_id per request).
  • End-to-end type safety: Drizzle → Zod → tRPC → React Query.
  • Auth handler at app/api/auth/[...all]/route.ts, tRPC handler at app/api/trpc/[trpc]/route.ts.
  • Sign-in / sign-up / dashboard scaffolded.

Minimal NestJS service with Fastify and Pino logging. Use when the team needs a pure backend without the Next.js footprint.

Library template with tsup, Vitest, and Changesets pre-wired. ESM only. Includes an optional Hono server factory in src/index.ts for projects that want to ship both a library and a small server.

  1. Create templates/<name>/manifest.json (name, displayName, description, features[], postInit).
  2. Add files. Any file ending in .hbs is rendered through Handlebars; the .hbs extension is stripped.
  3. The CLI passes { projectName, features } into the render context. Use the case helpers (pascalCase, kebabCase, …).
  4. Add a smoke test in packages/cli/tests/<name>-smoke.test.ts that asserts critical files render without leftover {{ markers.