Skip to content

ADR-0001: Monorepo Stack Selection

Status: Accepted
Date: 2026-01-01

Cosella needs a frontend platform that supports:

  • A web dashboard, an admin panel, an Electron overlay, a marketing site, and engineering docs — all sharing design tokens, domain types, and UI components.
  • Strict type safety everywhere (exactOptionalPropertyTypes, noUncheckedIndexedAccess).
  • Fast CI and local iteration via caching.
ConcernChoiceRationale
Workspacepnpm workspaces + catalogSingle version source; faster installs than npm/yarn
Task runnerTurborepoRemote caching; incremental builds
BundlerViteSub-second HMR; native ESM
RouterTanStack RouterFull type-safe routes; file-based codegen
Data fetchingTanStack QueryIndustry standard; great devtools
StylingTailwind CSS v4CSS-first @theme; no JS config file
Component primitivesRadix UI (owned copies)Accessible; unstyled; no breaking upgrades
API typesopenapi-typescript + openapi-fetchSingle source of truth from OpenAPI spec
RealtimeWebSocket with backoff reconnectWorks in browser + Electron; no STUN/TURN complexity
TestingVitest + Testing Library + MSW v2Fast; no Jest config churn
  • All packages must use the pnpm catalog versions.
  • tsconfig extends must use relative paths (Windows junction limitation).
  • Apps may only depend on packages, never on sibling apps.