Operations

Run and deploy

For maintainers of the Docs Studio itself.

The platform, the Studio and every docs.<domain> are one Next.js app on a Cloudflare Worker (documentation-catalog), built with OpenNext. Domains, sites and pages live in the D1 database documentation-catalog-db; uploaded images live in the R2 bucket documentation-catalog-documents.

Run locally

Terminal
npm install
npm run db:migrate:local
npm run dev

Put EDIT_PASSCODE=… in .dev.vars to unlock the Studio at http://localhost:3000/studio. To see a domain's docs locally, send its docs. host name:

Terminal
curl -H 'Host: docs.appneural.com' http://localhost:3000/

Checks

Terminal
npm run typecheck
npm run lint
npm run build

Deploy

The wrangler login sees several Cloudflare accounts, so set CLOUDFLARE_ACCOUNT_ID to the APPNEURAL account in the shell first. Then:

Terminal
npm run db:migrate:remote
npm run deploy

Secrets:

Secret Needed for
EDIT_PASSCODE Unlocking the Studio. Required.
CLOUDFLARE_API_TOKEN One-click Connect docs.<domain> and domain suggestions. Optional.
Terminal
npx wrangler secret put CLOUDFLARE_API_TOKEN

Hosts

Host Served by
documentation.appneurox.com Custom domain in wrangler.jsonc: the platform and Studio.
docs.appneural.com Custom domain in wrangler.jsonc: APPNEURAL's docs.
documentation.appneurox.com Custom domain in wrangler.jsonc: redirects to the platform.
docs.<other domain> Worker routes created from Studio → Domains, never listed in wrangler.jsonc.

Caution

Keep routes in wrangler.jsonc to custom domains only. Once a plain route is listed there, a deploy replaces all of the Worker's routes and disconnects every docs.<domain>.

Regenerating the catalog docs

The docs of the other catalogs were generated from their READMEs, wrangler.jsonc files and API routes:

Terminal
node scripts/generate-catalog-docs.mjs

It writes migrations/0019_seed_catalog_docs.sql: the appneural.com domain, and every catalog as a site under docs.appneural.com/<catalog>. The migration only adds rows that do not exist yet, so edits made in the Studio are kept.

Last updated 2 November 2026