Skip to main content

Building & deployment

Build pipeline​

docs-site/ --docusaurus build--> docs-site/build/
--copy (clean)------> public/docs/
vite build ---------------------> dist/ (includes dist/docs/)

Docs are built by scripts/build-docs.mjs into public/docs/ and committed, because the Lovable build environment may not be able to run the Docusaurus build. Docs pages use trailing-slash URLs (trailingSlash: true).

Hosting​

  • Lovable hosting — the production host for www.novareport.net. Serves the SPA build of main; publish from Lovable after a pull request is merged. No Puppeteer prerender or sitemap generation runs there, and Lovable's build does not read environment variables — values the production site needs (the Worker URL, Clerk's publishable key) are defaults committed in src/config/backend.ts and src/utils/.

  • Vercel — configured via vercel.json; also builds main with the full pipeline (npm run build:prerender: sitemap generation and Puppeteer prerendering of the 28 public routes). It is not the production host for the domain.

  • Cloudflare Worker (workers/news-api) — deployed separately:

    cd workers/news-api
    npm ci
    npm run typecheck && npm test # tests run against an in-process Postgres (PGlite)
    npx wrangler deploy
    curl -s https://novareport-news-api.michelduek.workers.dev/api/health

    Secrets are set with npx wrangler secret put <NAME> (see Environment variables); database migrations with npm run db:migrate. A bad release is undone with npx wrangler rollback. Full procedure: Neon + Clerk cutover.

CI runs two jobs on every pull request: build (lint, typecheck, unit tests, docs build, production build with prerender) and worker (typecheck, tests, wrangler deploy --dry-run).

Future: docs.novareport.net​

The docs can be deployed to a subdomain by building with:

DOCS_URL=https://docs.novareport.net DOCS_BASE_URL=/ npm --prefix docs-site run build

This requires a static host and a DNS record, which are not set up today.