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
npm install
npm run db:migrate:local
npm run devPut 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:
curl -H 'Host: docs.appneural.com' http://localhost:3000/Checks
npm run typecheck
npm run lint
npm run buildDeploy
The wrangler login sees several Cloudflare accounts, so set CLOUDFLARE_ACCOUNT_ID to the APPNEURAL account in the shell first. Then:
npm run db:migrate:remote
npm run deploySecrets:
| Secret | Needed for |
|---|---|
EDIT_PASSCODE |
Unlocking the Studio. Required. |
CLOUDFLARE_API_TOKEN |
One-click Connect docs.<domain> and domain suggestions. Optional. |
npx wrangler secret put CLOUDFLARE_API_TOKENHosts
| 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:
node scripts/generate-catalog-docs.mjsIt 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.