Skip to main content

Architecture overview

The orchestrator is a long-running stateful server and cannot run as a Netlify Function. Deploy it on a platform that supports persistent processes.
Deploy apps/site as a standalone Next.js site serving published content.

Netlify project setup

  1. Connect your repository to Netlify
  2. 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
  3. Install the Next.js plugin: add @netlify/plugin-nextjs via the Netlify UI or netlify.toml

netlify.toml (in repo root)

Environment variables (Phase 1)

In Phase 1, the site renders from published content only — no orchestrator needed.

Phase 2: Full editing stack

Deploy the editor

Create a separate Netlify site for apps/editor:
  • Base directory: apps/editor
  • Build command: cd ../.. && pnpm install --frozen-lockfile && pnpm --filter @ai-site-editor/editor build
  • Publish directory: apps/editor/dist

Editor environment variables

Deploy the orchestrator (external host)

The orchestrator requires a long-running process. Deploy on Render, Fly.io, Railway, or any container platform. See the Vercel deployment guide for Render-specific instructions.

Site environment variables (Phase 2)

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.

Other platforms

Deployment guides for the following platforms are planned:
  • AWS Amplify — Next.js hosting + Lambda for orchestrator
  • Google Cloud Run — Container-based deployment for all three services
  • Docker Compose — Self-hosted deployment on any server
The orchestrator half of each of those is already covered by Docker deployment — it runs as a container anywhere that supports a long-lived process with a persistent volume. If one of these platforms is what you need documented next, get in touch.

Troubleshooting

See the production troubleshooting section — the same postMessage, CORS, and draft mode issues apply regardless of hosting platform.