Build and Deployment
The frontend is designed as a standard browser-based SPA build served by Nginx.
Production build
Build the app with:
pnpm build
This produces static assets in dist.
Docker image
The repository includes a two-stage Dockerfile.
Build stage
- base image:
guergeiro/pnpm:lts-latest-alpine - working directory:
/build - installs
openjdk21 - runs
pnpm iandpnpm build
The Java runtime is needed because the project uses OpenAPI Generator during dependency installation or regeneration.
Runtime stage
- base image:
nginx:stable-alpine - clears the default Nginx web root
- copies
deployment/default.conf - copies the built
distassets into/usr/share/nginx/html - exposes port
80
Nginx routing behavior
The shipped Nginx config is set up for an SPA with hashed assets:
/assets/files are served directly and cached for a long time/index.htmlis kept non-cached so new deployments pick up new hashed assets quickly- all other unmatched paths fall back to
/index.html
That fallback is required because the app uses BrowserRouter and expects client-side routes such as /browse, /compare, and /auth/callback to resolve correctly after a page refresh.
Security headers in the Nginx config
The provided config adds headers such as:
Strict-Transport-SecurityContent-Security-PolicyReferrer-PolicyX-Frame-OptionsX-Content-Type-OptionsPermissions-Policy
If you change hosting behavior, keep those headers or replace them with equivalents.
Deployment checklist
- Set the correct
VITE_API_BASE_URLand OIDC variables before building. - Make sure the OIDC provider allows the deployed callback and logout URLs.
- Confirm the backend CORS configuration includes the deployed frontend origin.
- Serve the frontend with SPA fallback routing.
- Verify
/auth/callbackand/auth/silent-callbackwork in the deployed environment.
Regenerating the API client in CI or image builds
Because the project generates the OpenAPI client as part of installation, your build environment should either:
- allow access to the hosted backend spec, or
- have the local backend spec available for the fallback generation path
If that is not possible in a deployment environment, you may want to commit generated client output or adjust the install/generation workflow accordingly.