Skip to main content
This page is for the self-hoster putting a site that uses Avocado Studio on Netlify. The constraints are the same as on Vercel: the site and the editor deploy well, and the orchestrator’s state needs a persistent disk.

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 deploy apps/site from this repository. For your own site, use your usual Netlify settings and the variables below.
  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.
With ORCHESTRATOR_URL unset, the demo site renders from lib/published-content.json and needs no orchestrator.

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
The editor is a single-page app, so add a rewrite of every path to /index.html.
Do not set VITE_SITE_DRAFT_SECRET or VITE_PUBLISH_TOKEN on a public editor. Vite compiles VITE_* values into JavaScript anyone can download. Give the orchestrator DRAFT_MODE_SECRET, PUBLISH_TOKEN and ACCESS_PASSWORD_HASH instead. The editor fetches the first two from GET /editor/credentials after sign-in.

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.

Other platforms

The orchestrator half of any other platform is covered by Docker deployment: it runs anywhere that supports one long-lived process with a persistent volume.

Troubleshooting

See production troubleshooting. The same draft-secret, preview-bridge and CORS issues apply on every host.