Skip to content

Build, runtime, and deployment operations

Build, runtime, and deployment operations

Runtime model

This repository is a Vite-built React frontend that can run in development, be built as static assets, and be packaged behind Nginx for deployment.

Scripts in package.json

package.json defines the primary operational commands:

  • npm run dev — Vite dev server
  • npm run build — production build
  • npm run test / npm run test:run / npm run test:coverage — Vitest suites
  • npm run lint — ESLint over the repo
  • npm run preview — local production preview
  • npm run security:audit, security:lint, security:full — security-oriented checks
  • npm run prerender and npm run build:seo — static prerendering layer
  • npm run quality:analyze / quality:fix — code-quality scripts

Environment handling

src/config.js is the important runtime config gate.

  • It reads from window._env_ first when present.
  • It falls back to import.meta.env.
  • It blocks access to forbidden frontend keys.
  • It returns an empty API base URL in dev so the browser can use the Vite proxy rather than hitting the backend directly.

That means environment precedence is intentional, not incidental: runtime injection wins over build-time values when both exist.

Dev-server proxying and static assets

The API client assumes the frontend can talk to a backend through the Vite development proxy in local mode. The build/runtime docs and Vite config establish the reverse-proxy/static-asset behavior used for development and production parity.

Deployment shape

The root README and deployment files describe a containerized path:

  • multi-stage Docker build,
  • static asset output from Vite,
  • Nginx serving the built app,
  • runtime env injection via env.sh and window._env_.

Operational files worth checking together

  • Dockerfile
  • docker-compose.yml
  • nginx.conf
  • env.sh
  • vite.config.js
  • playwright.config.ts
  • vitest.config.ts
  • unified-deployment.yaml

What to validate after changes

  • Build changes: npm run build
  • Runtime config changes: npm run dev plus the relevant contract test(s)
  • Deployment wiring: container build/run and the affected route workflow
  • Security changes: npm run security:full plus the focused unit/contract tests

Scope boundary

This page is about repository operations and frontend deployment behavior. It does not document backend deployment internals or cloud infrastructure beyond what is needed to understand this frontend’s runtime assumptions.