Skip to main content

Deployment and reverse proxy

Imported component documentation. Source: melodee-project/melodee-admin-ui at commit e0ed63ec61a069159a1482d1ecd11dd480a6a60f. Version 2026.11.0-rc.0. License MIT. Status: release candidate; not published, deployed, production-qualified or security-reviewed. This is the component's committed documentation, not proof of a distribution release or production qualification.

This document describes a supportable deployment shape. It does not authorize a deployment: the release candidate has not been published, production-qualified or security-reviewed.

Same-origin shape​

Serve three applications on one HTTPS origin:

PathService
/api/…melodee-api
/auth/…separately built melodee-auth-ui
/admin/…this application

The API deployment examples already provision /auth/ and /admin/ on the same origin. Cookies, CSRF origin checks and the browser session therefore remain same-origin. Do not build a cross-origin API URL into the bundle and do not add a credentialed CORS fallback.

Build​

npm ci
npm run gate
npm run build

The build emits dist/ with index.html, hashed assets and version.json. VITE_BASE_PATH defaults to /admin/; the router basename follows Vite's base. SOURCE_REVISION is recorded in version.json and the System Status screen.

Configuration​

VariableDefaultUse
VITE_API_PROXYhttp://127.0.0.1:8080Development proxy target only
VITE_AUTH_UI_BASE/authSame-origin Auth UI path used for sign-in links
VITE_ENVIRONMENT_LABELunsetOptional visible environment label; never invent one
VITE_BASE_PATH/admin/Public base path
SOURCE_REVISIONdevelopmentBuild provenance string

No API secret, provider key, account identifier or token belongs in a VITE_* variable; Vite variables are public.

Reverse proxy requirements​

  • Serve /admin/ with SPA fallback to /admin/index.html.
  • Proxy /api/ to the API unchanged, preserving Origin, Sec-Fetch-* and X-Forwarded-* as required by the API's same-origin checks.
  • Do not cache index.html, version.json or API responses with credentials.
  • Cache hashed /admin/assets/* immutably.
  • Terminate TLS with a valid certificate. HSTS is required for production.
  • Apply a restrictive Content-Security-Policy. The current build needs default-src 'self', img-src 'self' data:, style-src 'self' 'unsafe-inline' (Mantine runtime styles), script-src 'self', connect-src 'self', font-src 'self', frame-ancestors 'none', base-uri 'self' and form-action 'self'. Re-verify after any dependency change; do not add a remote font/CDN or wildcard connect source.
  • Set X-Content-Type-Options: nosniff, Referrer-Policy: no-referrer and X-Frame-Options: DENY/frame-ancestors 'none'.
  • Do not strip or rewrite the CSRF or session cookies.

Operational verification​

After a candidate deployment:

  1. GET /healthz returns the expected service/version.
  2. /admin/ loads with assets and no console errors.
  3. Unauthenticated access redirects to the Auth UI handoff; no sign-in form is rendered by the admin app.
  4. Sign in through the Auth UI, return to /admin/, and verify the session status and capability probes.
  5. Open System Status; the served OpenAPI hash/version must match the pinned artifact. Treat a mismatch as a release blocker.
  6. Verify a safe read and a non-destructive mutation in a disposable environment. Never test destructive actions against production data.
  7. Confirm CSP/security headers and that no secrets appear in the page, network log or version.json.

Rollback​

Keep the previous static artifact by content hash. Because this UI owns no server-side state, rollback is a static artifact switch; do not roll back the API contract independently of the pinned artifact without re-running the drift gate.

Known deployment blockers​

  • Auth UI post-sign-in continuation to /admin/… is not implemented upstream.
  • Independent security review and production qualification are outstanding.
  • No publication, registry push, image publication or deployment is authorized by the repository state.