Architecture overview
The orchestrator keeps drafts, undo history and the version log in a SQLite
file, so it needs a persistent disk and a single instance. A Netlify Function
has neither. That includes library mode mounted inside a site deployed to
Netlify: it answers requests, but its drafts do not survive. See
state and backups.
This repository’s demo site
These settings deployapps/site from this repository. For your own site, use
your usual Netlify settings and the variables below.
- Connect your repository to Netlify.
- Configure build settings:
- Base directory:
apps/site - Build command:
cd ../.. && pnpm install --frozen-lockfile && pnpm --filter @ai-site-editor/site build - Publish directory:
apps/site/.next
- Base directory:
- Install the Next.js plugin: add
@netlify/plugin-nextjsvia the Netlify UI ornetlify.toml.
With
ORCHESTRATOR_URL unset, the demo site renders from
lib/published-content.json and needs no orchestrator.
The editor
Create a separate Netlify site forapps/editor:
- Base directory:
apps/editor - Build command:
cd ../.. && pnpm install --frozen-lockfile && pnpm --filter @ai-site-editor/editor build - Publish directory:
apps/editor/dist
/index.html.
Site environment variables, with editing
PUBLISH_TOKEN is what makes publishing work at all here: the site’s
POST /api/editor/publish refuses every request with a 401 under
NODE_ENV=production when no secret is configured, and a production build is
what Netlify serves. The same deploy also has a read-only filesystem, so a
publish handler that rewrites a JSON file in the repository succeeds locally and
fails here. Publish to a CMS, a database, or a commit that triggers a rebuild.