Parent
#1095
What to build
One shape for how the frontend reaches the api, in all three environments.
After #999, development and production both serve the api same-origin under /api. The system-test stack does not: docker-compose.ci.yml runs the production nginx image, and services/frontend/nginx.conf has no /api location, so .github/workflows/validate.yml builds that image with VITE_APP_URL=http://localhost:8080 and the tests drive a request path no developer and no visitor takes any more.
Give nginx.conf an /api location that proxies to the api and strips the prefix — the same rule as the Traefik middleware and the vite dev proxy. Then VITE_APP_URL has no remaining caller and can go, along with the resolveBaseURL() branch that reads it and the ARG VITE_APP_URL in the frontend Dockerfile.
The production image gains an /api location it does not use, since Traefik routes /api before the request reaches nginx. That is the cost, and it is also the point: the image behaves the same wherever it runs.
Acceptance criteria
Blocked by
#999
Parent
#1095
What to build
One shape for how the frontend reaches the api, in all three environments.
After #999, development and production both serve the api same-origin under
/api. The system-test stack does not:docker-compose.ci.ymlruns the production nginx image, andservices/frontend/nginx.confhas no/apilocation, so.github/workflows/validate.ymlbuilds that image withVITE_APP_URL=http://localhost:8080and the tests drive a request path no developer and no visitor takes any more.Give
nginx.confan/apilocation that proxies to the api and strips the prefix — the same rule as the Traefik middleware and the vite dev proxy. ThenVITE_APP_URLhas no remaining caller and can go, along with theresolveBaseURL()branch that reads it and theARG VITE_APP_URLin the frontend Dockerfile.The production image gains an
/apilocation it does not use, since Traefik routes/apibefore the request reaches nginx. That is the cost, and it is also the point: the image behaves the same wherever it runs.Acceptance criteria
/apiby proxying to the api with the prefix strippedVITE_APP_URLVITE_APP_URLis gone: the env var, the build argument, the workflow input and the branch inresolveBaseURL()/api/*in production, so the nginx location is never consulted there/apiis stated in each of the three places that need it, each naming the othersVITE_APP_URLcurrently puts the api cross-origin and strips every role (absorbed from The frontend e2e suite cannot run in the dev container: VITE_APP_URL puts the api cross-origin and silently strips every role #853)Blocked by
#999