Files
parking_solution/wiki/concepts/offline-first.md
julian bfe64032d8 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.
2026-06-14 00:34:11 +02:00

32 lines
1.2 KiB
Markdown

---
type: concept
tags: [parking, constraint, foundational]
sources: [parking-system-architecture]
updated: 2026-06-14
---
# Offline-First
One of the **two foundational forces** shaping the whole system (the other is the
[[threat-model]]). (See [[parking-system-architecture]] §1.)
A park may have **no internet, intermittent connectivity, or be fully air-gapped**. **Nothing
in the core operation may depend on a network being present.**
## What it forces
- **Local auth** — no external identity provider; hence [[local-jwt-auth]] and the rejection of
[[logto-zitadel-oidc]].
- **Local database** — [[sqlite]] on-site; remote PostgreSQL is a *deferred*, optional sync
target, never a runtime dependency.
- **Autonomous device decisions** where possible — [[wiegand]]-into-controller lets the
[[uhppote-controller]] decide even if the host is down; [[lpr-camera]] uses edge AI so
recognition runs with no internet.
## What it does NOT mean
Offline-first does **not** mean "no [[reconciliation]]." It means **deferred, intermittent**
reconciliation — a manager's weekly USB stick, a daily phone hotspot, a monthly export. Only
design for "never, by anyone" if that's genuinely true (see [[reconciliation]] for the
network-free fallback controls).