Explanation
Product architecture overview
The big picture of the KTB Health app monorepo.
The product repo is a bun monorepo containing the KTB Health clinical
documentation app.
Stack
- TanStack Start (React) SSR app in
apps/web, deployed to Cloudflare Workers via Alchemy (alchemy.run.ts+infra/cloudflare). - Effect for domain services and structured effects; ports/adapters for external capabilities.
- Drizzle ORM on Cloudflare D1 (
packages/db), with migrations synced for Alchemy deploys. - better-auth for authentication; Turnstile for bot protection.
- Paraglide i18n (generated output in
src/paraglide/— never hand-edited). - Tailwind v4 and the
@ktbhealth/uidesign system, consumed as git-tag deps (github:ktbhealth/ui#vX.Y.Z@react).
Quality gates
bun run check— format + lint + typecheck.bun run test— vitest per package; the repo-wide coverage gate is 100% (scope runs per package).- Arch lint enforces the ports/adapters boundary described in Ports and adapters.