RL-HB / This site
How this site is built
A full-stack monorepo, not a template: a typed contract from database to button, infrastructure as code, and guardrails that make AI agents safe to work with.
01 / This site
Architecture
- Browser
- web — Next.js, server-rendered
- api — NestJS, Better Auth
- Postgres — Drizzle migrations
- Claude API — chat answers, phase 5
- Voyage AI — embeddings, phase 5
- Resend — lead emails, phase 5
Only web is public. The API sits on Railway's private network, and migrations run before each deploy.
02 / This site
Typed end to end
- 01
Zod contracts
Every endpoint declares its request and response as Zod schemas; the API validates and strips to them.
- 02
Generated OpenAPI
The schemas produce an OpenAPI 3.1 document, committed next to the code.
- 03
Generated client
The frontend's typed client is generated from that document. A stale contract fails typecheck and CI.
03 / This site
Testing layers
- 01
Unit and component
Vitest next to the code, including the architecture tests that enforce layer rules.
- 02
Stories with accessibility
Every kit component has a story, run in light and dark with an axe check.
- 03
API end to end
The whole API over HTTP against a real Postgres in Testcontainers, migrated like production.
- 04
Browser smoke test
Playwright drives the built app on a throwaway database, the way it is deployed.