Skip to main content

Deployment

Apps (static export)

npm run build tracking # or: npm run build portal

Each app's next.config.ts sets output: "export" in production, emitting a fully static site to the app's out/. Any static host can serve it — no Node server required.

TODO: there is no committed app hosting/CI deploy config yet. Document the chosen host and pipeline here once it exists.

Native (Capacitor)

The tracking app's static export is wrapped by Capacitor for iOS/Android (apps/tracking/capacitor.config.ts, apps/tracking/ios, apps/tracking/android). Build output is copied into the native shell via cap copy / Xcode; native build artefacts are git-ignored, the shells are committed.

TODO: document the exact cap command sequence and signing steps for a release build.

Documentation site → Cloudflare Pages

The docs website is built separately from the apps:

npm run docs:build # → docs-site/build
npm run docs:serve # preview at http://localhost:4000

The built site is a single-page app and must be served over HTTP — opening docs-site/build/index.html as a file:// URL will not work.

It deploys to Cloudflare Pages from main via the dashboard Git integration — Cloudflare builds the site itself on every push, with no secrets stored in the repo. Build settings come from wrangler.toml (project enode-tracking-docs, output docs-site/build) and .nvmrc (Node 22).

One-time setup

The deploy config (wrangler.toml, .nvmrc, the docs build) must be on main first — Cloudflare builds the branch you connect.

  1. Merge the documentation setup into main.
  2. Cloudflare dashboard → Workers & Pages → Create → Pages → Connect to Git, select this repository.
  3. Configure the build:
    • Production branch: main
    • Build command: npm run docs:build
    • Build output directory: docs-site/build
    • Root directory: / (repo root)
    • Environment variable: NODE_VERSION=22 (or rely on .nvmrc). If the build can't find the dev dependencies, also set NPM_FLAGS=--include=dev.
  4. Save and Deploy. Every push to main now builds and deploys automatically; pull requests get preview URLs.

After the first deploy

  • The site is live at https://enode-tracking-docs.pages.dev.
  • For a custom domain, attach it in Cloudflare and set the DOCS_URL env var to the final URL (baseUrl stays /).

Cloudflare builds TypeDoc + Storybook + Docusaurus in one npm run docs:build run (a few minutes). The build is not coupled to GitHub Actions — docs-check still runs on PRs as the quality gate, but it does not deploy.