Initial scaffold: Turborepo monorepo + design wiki

Turborepo (pnpm workspaces) with all dependencies pinned to latest
mutually-compatible versions: turbo 2.9, TypeScript 6, Fastify 5,
React 19, Vite 8, better-sqlite3 12 + Drizzle ORM 0.45.

Layout:
- apps/server   Fastify backend (local JWT auth + role guard, /health)
- apps/web      React 19 + Vite 8 operator SPA
- packages/db   Drizzle schema on SQLite/WAL; append-only events + users
- packages/devices  reader/printer/relay adapter interfaces (intent-only relay)
- packages/shared   shared domain types

Architecture constraints from the design wiki are encoded in the scaffold:
append-only hash-chained + signed event log, device-agnostic adapters,
"a barrier is not a door" (relay expresses intent only), fully-local
offline-first auth.

wiki/ is an LLM-maintained Obsidian knowledge base (28 pages) ingested
from the architecture & design notes, with its own maintenance schema.

Verified: pnpm install, full turbo build (5/5), server boots and serves
/health, drizzle-kit generates the initial migration.
This commit is contained in:
2026-06-14 00:34:11 +02:00
commit bfe64032d8
74 changed files with 4970 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
---
type: entity
tags: [parking, stack, database]
sources: [parking-system-architecture]
updated: 2026-06-14
---
# SQLite
The local database (`better-sqlite3` driver, accessed via [[drizzle-orm]]). The right call
for a **single-site, single-writer** system. (See [[parking-system-architecture]] §2, §4.)
## Why it fits
Its only practical limit is **write concurrency** — one writer at a time, mitigated by **WAL
mode** (many concurrent readers + one writer). A parking workload never approaches this.
Other official limits are far beyond reach: ~281 TB max DB size, effectively unlimited rows,
32,767 columns/table, 1 GB per text/blob cell.
You'd only outgrow SQLite with multiple machines writing the same DB (**never do this over a
network share**) or sustained high-frequency concurrent writes — neither applies here.
## Relation to PostgreSQL
The move to remote PostgreSQL is a **business/durability** decision (the remote sync target),
**not a capacity** one. [[drizzle-orm]] schemas port over with minimal change.
Open risk: a disk failure currently means total revenue-history loss — see
[[open-questions]] #5 (durability/backup). Part of the [[technology-stack]].