Builder
What it is
A static-site builder that deterministically generates a website from an owner's Resources (REA) and publishes it — optionally bound to a custom domain via DNS connectors. Available to both first-class users and groups (global homes both).
Where it lives
/builder— builder UI ·src/app/(main)/builder/page.tsx(builder-client.tsx)- Model/service ·
src/lib/builder/{site-model,site-service,dns-write}.ts - API ·
src/app/api/builder/{site,publish,domain}/route.ts - Schema ·
site_versions+site_publications(migration0055_site_builder.sql)
Every interaction
- Preview —
GET/POST /api/builder/siterenders a server-side preview from the owner's Resources (no client-side generation). - Publish —
POST /api/builder/publishsnapshots a version and publishes it. - Bind a custom domain —
POST /api/builder/domainplans + applies DNS records via the owner's DNS connector (Cloudflare zone API, NamecheapsetHosts, or Squarespace manual-instruction fallback). Credentials are decrypted server-side from the owner's stored connector — never accepted from the client.DELETEunbinds. - Choose a theme — theme presets mirror the profile presets.
Permissions / gating
- Owner resolution reuses
resolveConnectionSubject(auth-derived self vs group-admin); an owner id is never taken from the client. - Site publications are home-authority and are never federated.