Decisions — stack and code conventions
Rendered from corpus/wiki/decisions-engineering.md · updated 2026-11-02
This page is generated from the project corpus and rewritten on every docs build. Edit the source in corpus/, not here.
Split out of decisions.md on 2026-10-04, when that page passed ~200 lines. Unchanged in the move.
Stack
- npm workspaces (not pnpm/yarn) —
workspace:*protocol not supported; use"*"for local package refs. - React Router 8 (not v7) — latest stable as of 2026-06-26; requires Vite 7+.
- Vite 7 (not Vite 8 beta) — stable build tool for React Router 8.
- Tailwind CSS 4 — Vite plugin approach (
@tailwindcss/vite), not PostCSS. - Fastify 5 (not Express) — chosen for performance and TypeScript-first plugin system.
- better-sqlite3 (not
node:sqliteorlibsql) — synchronous, battle-tested, native addon; fits single-server deployment. - Drizzle ORM (not Prisma) — lightweight, SQL-close, no separate runtime process.
- Zod for validation — schemas live in
shared/and TS types are derived viaz.infer; backend imports them so shape + validation have one source of truth. - TanStack Query for all UI→backend reads — replaces hand-rolled
useEffect+fetch; provider inLayout.tsx, client inui/app/lib/queryClient.ts. - Zustand for UI state —
locationStore(geolocation requested once, shared across pages) andmapFilterStore(category/radius/search/selection). - SPA mode for the UI (
ssr: falseinreact-router.config.ts) — simplifies deployment; no server-side rendering needed for an interactive map app. Note: route modules must useclientLoader, notloader(aloaderexport fails the build in SPA mode). - SQLite (not Postgres) — appropriate for single-server / local-first deployments at this scale.
- Exact pinned dependency versions (no
^ranges) in everypackage.json— reproducible installs.
Code conventions
- Import extensions are package-specific (corrected 2026-06-28 — the old "no
.jssuffixes anywhere" was wrong and would break the backend at runtime):backend/+shared/run as Node ESM ("type": "module", executed viatsx/node dist), so relative imports MUST keep the.jssuffix (the existing code already does). Per research, code that runs directly in Node wantsmoduleResolution: "nodenext", which requires the extension; the current"bundler"setting tolerates the suffix but is philosophically for bundled code — consider switching backend/shared tonodenextduring the schema consolidation. Do not strip.jsfrom backend/shared imports.ui/is bundled by Vite, so imports are extensionless (current state).
- OKLCH color tokens in CSS custom properties — future-proof color space, already in place via
app.css. cn()utility (clsx+tailwind-merge) as the canonical class-building function.- UI primitives:
@base-ui/react(Button, Avatar, Menu, Toggle, Slider, Input) + lucide-react icons. (History: the original Stitch brief said shadcn/ui new-york; it was replaced by@base-ui/reactwhen the design was implemented — see log 2026-06-26.)