// wf-bootstrap.jsx — Section 5: Bootstrap (PUC-10 / PUC-11, INV-1/INV-7). // Operator & developer surfaces — terminals and a runbook, not app screens. const { Screen: BScreen, Wordmark: BWordmark, WF_T: BT, WF_DS: BDS } = window; const { Eyebrow: BEyebrow, Soul: BSoul, Tag: BTag, Callout: BCallout } = BDS; const MONO = 'ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace'; // ── Terminal window ──────────────────────────────────────────────────────── function Terminal({ title, lines, style = {} }) { return (
{['rgba(155,140,255,.5)', 'rgba(244,199,107,.5)', 'rgba(237,234,255,.3)'].map((c, i) => ( ))} {title}
{lines.map((ln, i) => )}
); } function TLine({ ln }) { const [k, t] = ln; if (k === 'sp') return
; if (k === 'cmd') return
$ {t}
; if (k === 'step') return
{t}
; if (k === 'ok') return
{t}
; if (k === 'hl') return
{t}
; if (k === 'note') return
{t}
; return
{t}
; } // ── Wrap a section artboard on the sky ───────────────────────────────────── function Bay({ children, pad = 30 }) { return
{children}
; } function BayHead({ kicker, title, sub }) { return (
{kicker}

{title}

{sub &&

{sub}

}
); } // ── 1 · The principle — empty is a working state (INV-1) ─────────────────── function BootstrapPrinciple() { const steps = [ ['Operator starts the app', 'scripts/dev.sh locally · flotilla deploy when deployed', 'lilac'], ['App migrates itself', 'pending .sql migrations apply in order, fail-stop (INV-7)', 'lilac'], ['/healthz goes green', 'process up · DB reachable · migrations current', 'gold'], ['First merchant walks the product', 'sign up → create storefront → admin (PUC-2 / 4 / 6)', 'gold'], ['First rows exist', 'created through the flows alone — nothing placed by hand', 'lilac'], ]; return (
{steps.map(([t, d, c], i) => { const col = c === 'gold' ? BT.gold : BT.lilac; return (
{i + 1} {i < steps.length - 1 && }
{t}
{d}
); })}
); } // ── 2 · The runbook — docs/BOOTSTRAP.md (paper) ──────────────────────────── function RunbookDoc() { const envs = [ ['localhost', './scripts/dev.sh', 'Docker is the one prerequisite. Brings up Postgres, migrates, serves on :5173.'], ['pre-prod (PPE)', 'flotilla deploy ecomm --env ppe', 'Provisions Cloud SQL, resolves secrets, migrates at startup. Rehearse here first.'], ['production', 'flotilla deploy ecomm --env prod', 'The identical gesture. Day-one prod is simply the bootstrap state.'], ]; return (
docs/BOOTSTRAP.md the documented gesture

Bringing ecomm up from empty

One gesture, three environments. No hand-seeded data — the first merchant arrives through the product flows alone.

{envs.map(([env, cmd, note], i) => (
{env}
{cmd}
{note}
))}
Empty is a working state — there is no seed.
); } // ── 3 · localhost — scripts/dev.sh ───────────────────────────────────────── function DevTerminal() { const lines = [ ['cmd', 'git clone …/wiggleverse-ecomm && cd wiggleverse-ecomm'], ['cmd', './scripts/dev.sh'], ['sp'], ['step', 'datastore: starting postgres (docker compose up)…'], ['ok', 'postgres healthy · ecomm_dev · :5432'], ['step', 'migrations: applying pending…'], ['ok', '0001_init applied · schema current'], ['step', 'backend: uvicorn on :8000'], ['step', 'web: vite on :5173 (proxying /api)'], ['ok', '/healthz 200 {status:"ok", migrations:"current"}'], ['sp'], ['out', ' ecomm is up against an empty database.'], ['hl', ' open http://localhost:5173'], ['sp'], ['note', 'one-time codes print to this log (LogMailer) — no real mail in dev.'], ]; return ( ); } // ── 4 · The code channel — dev log vs real email ─────────────────────────── function DevChannel() { return (
Dev — the code prints to the backend log
Deployed — the code arrives as real email
ecomm <no-reply@ecomm.wiggleverse.org>now
Your ecomm code: 419 204
Enter this code to sign in. It's good for 10 minutes. If you didn't request it, ignore this email.
); } function ChanLabel({ children, tone }) { const c = tone === 'gold' ? BT.gold : BT.lilac; return
{children}
; } // ── 5 · deployed — flotilla (PPE then Prod) ──────────────────────────────── function DeployTerminal() { const lines = [ ['cmd', 'flotilla deploy ecomm --env ppe'], ['sp'], ['step', 'provision: Cloud SQL (postgres) · backups + PITR…'], ['ok', 'database ready · secrets resolved from Secret Manager'], ['step', 'deploy: image → single VM · fail-stop'], ['step', 'migrations: applying at startup…'], ['ok', '0001_init applied'], ['ok', '/healthz 200 — ppe live'], ['out', ' rehearsal: real sign-up (real email) → storefront → admin ✓'], ['sp'], ['cmd', 'flotilla deploy ecomm --env prod'], ['ok', 'same gesture — day-one prod is the bootstrap state'], ]; return ( ); } Object.assign(window, { BootstrapPrinciple, RunbookDoc, DevTerminal, DevChannel, DeployTerminal });