4 months ago
732e270one command serves a fully seeded, presentable app — the WEB HEAD ONLY (no docker, no worker, no api, no queue). a demo never processes a webhook; it looks at a dashboard with a story in it. - database is embedded PGlite (in-process WASM postgres) at .demo/, running the SAME drizzle schema and SAME generated migrations as prod. one dialect, no drift — sqlite was rejected because it would fork the read path (lateral query, jsonb, timestamptz) for no benefit pglite doesn't already give. - createPgliteDb + applyPgliteMigrations land in @tripwire/db; getDb() branches on PGLITE_DATA_DIR between the pglite instance and the pg pool. the shared Db type stays single-driver via one documented cast. - no queue in demo, so the lone write needing pg-boss (approve/deny) degrades to a worker-free markModerationDecided; a stub pool throws loudly if anything else reaches for .pool. - @electric-sql/pglite is hoisted at the ROOT: it's drizzle-orm's optional peer, so declaring it per-package forked drizzle into a second variant and broke web↔db type identity. one root declaration collapses it back to a single drizzle instance. - the script seeds the story (owning the single-connection pglite dir), closes, then spawns vite pointed at the same dir with a fixed dev BETTER_AUTH_SECRET so the gates + persona switcher work. readme documents the command; .demo/ is gitignored. new test: prod migrations + services + the worker-free decision path all run on pglite. checks: typecheck all, biome, boundaries, 216 tests.
Parent26c2dfb