D12 — Architecture: central = Livewire backoffice, tenant = headless REST API
Architecture decision record, relocated verbatim from the retired single-file
docs/tenancy/decision log. Status, thematic clusters, and how to record a new ADR: the decision log index.
- Central app (backoffice): Livewire 4 + Flux, Fortify session auth, runs in CENTRAL
context (BYPASSRLS). Routes in
routes/web.php+routes/settings.php. Never initializes tenancy. Operators see across tenants (subject to backoffice authorization). - Tenant app (client-facing): a separate TanStack Start SPA consuming this app as a
headless REST API under
/api/*inroutes/tenant.php, identified by theX-Tenantheader (request-data). Stateless; auth (Sanctum/token) + thetenant.memberguard layer on top. Runs in TENANT context (RLS role).