This repository is part of the AVefi project.
It includes the Nuxt 4 (v4.1+) frontend with full Docker support for local development and production deployment.
In production, all containers run in a shared Docker network. Traefik acts as the reverse proxy.
The frontend is prebuilt into a production Docker container and served as a Node.js app.
- Traefik routes frontend requests (
/) to the containerav-efi-frontend - Backend requests (
/api/v1/,/auth/, etc.) are routed separately - The frontend is served via Nuxtβs
.output/server/index.mjs
-
Build and start the full stack (Traefik + Frontend + Backend):
docker compose up -d --build
-
Open in browser:
http://localhost:8080/
Do not access
localhost:3000in production. The only correct entry point is through Traefik on port 8080.
To work on the frontend code with hot module replacement (HMR), you must run a dummy container named av-efi-frontend to simulate the production network.
This is necessary because Traefik expects a container with that name for service routing.
- Docker Desktop (with WSL2 if on Windows)
- VPN connection to GWDG must be active to retrieve backend and Elasticsearch data
- Nuxt development server runs on your host machine
- The dummy container proxies to
host.docker.internal:3000
docker compose -f docker-compose.dev.yml up -dThis creates a lightweight dummy container called av-efi-frontend:
version: "3.8"
services:
av-efi-frontend:
image: alpine/socat
container_name: av-efi-frontend
command: tcp-listen:3000,fork,reuseaddr tcp-connect:${DEV_FORWARD_HOST:-host.docker.internal}:${DEV_FORWARD_PORT:-3000}
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- proxy-network
restart: unless-stopped
networks:
proxy-network:
name: proxy-network
external: trueyarn install
yarn devNuxt will be served locally at:
http://localhost:3000/
But you must access it through Traefik:
http://localhost:8080/
If you open
localhost:3000directly, you bypass Traefik and backend/API routes will fail.
If http://localhost:8080/ returns 502 Bad Gateway while http://localhost:3000/ works, the problem is the Docker forwarding hop, not Nuxt itself.
Check in this order:
-
Restart the dummy proxy container:
docker compose -f docker-compose.dev.yml down docker compose -f docker-compose.dev.yml up -d
-
If Docker Desktop still cannot reach
host.docker.internal, override the forward target explicitly:$env:DEV_FORWARD_HOST="192.168.2.32" docker compose -f docker-compose.dev.yml up -d
-
If you need a non-default port:
$env:DEV_FORWARD_HOST="192.168.2.32" $env:DEV_FORWARD_PORT="3000" docker compose -f docker-compose.dev.yml up -d
Use your actual host IP from ipconfig, not the example above.
If you don't need to edit the code or use HMR:
docker compose up --buildThen open:
http://localhost:8080/
rm -rf node_modules .yarn/cache .yarn/install-state.gz
yarn cache clean
yarn installtaskkill /F /IM node.exeDummy container for Nuxt local development, required to keep Traefik routing intact.
Includes vite.hmr.port = 24678 and watch.usePolling for file reload in WSL2/Docker.
Example snippet for routing:
http:
routers:
local-home:
entryPoints: [local]
rule: "Host(`localhost`)"
service: home
services:
home:
loadBalancer:
servers:
- url: "http://av-efi-frontend:3000"This repository has three test families:
- Unit tests β component and API contract behavior (
tests/unit/) - E2e / backend contract tests β live backend API regression + OpenAPI contract + facet combination 500-error guards (
tests/e2e/api/) - Elasticsearch data-quality reporting β non-blocking report suite (
tests/data-quality/)
yarn test:ci:fast # lint + unit β required CI gate
yarn test:ci:api # backend API contract + edge-case lanes
yarn test:data-quality:reportAll API e2e tests run against the live backend (https://www.av-efi.net/rest/v1 by default).
Override with E2E_BACKEND_BASE and set PLAYWRIGHT_NO_WEBSERVER=true to skip starting a local server:
$env:PLAYWRIGHT_NO_WEBSERVER="true"
$env:E2E_BACKEND_BASE="https://www.av-efi.net/rest/v1"
npx playwright test tests/e2e/api/ --reporter=listExpected baseline: 40 passed, 5 skipped (the 5 skipped are test.fixme() β known Python backend bug: has_issuer_name combined with item-level facets triggers an Elasticsearch nested inner_hits conflict β 500. Will be unfixed once the backend is patched).
creators is accepted natively by the backend. No alias mapping is needed at the frontend layer β mapFacetAttributeForBackend is now a pass-through.
Human-readable explanation of the data-quality suite:
- it is a reporting suite, not a deployment gate
- it checks for patterns that usually indicate quality risk (missing fields, malformed IDs, placeholder-like titles, duplicate identifiers)
- heuristic findings are warning signals for triage and sampling, not guaranteed defects
- output is written as markdown so each stakeholder can read only the view they need
Generated outputs:
logs/data-quality/quality-statistics.md: full technical reportlogs/data-quality/quality-failing-identifiers.md: sampled failing document handles per rulelogs/data-quality/quality-snapshot.json: trend baseline/deltaslogs/data-quality/stakeholders/*.md: focused stakeholder views (frontend-ux, backend, data-engineer, project-manager, data-delivering-institutions)
For detailed test structure and environment knobs, see tests/README.md.
CMS mutation endpoints are guarded behind an explicit feature switch as a temporary control:
CMS_MUTATIONS_ENABLED=falseby default (recommended until authorization rollout is completed)- affected endpoints:
PUT /api/cms/usertooltipsPOST /api/cms/usertooltips_seed
- mutation requests also require same-origin headers (
Origin/Referer) and optionally accept extra trusted origins via:CMS_MUTATION_ORIGIN_ALLOWLIST=https://example-a,https://example-b
This is intended as a stopgap while full admin authorization is being finalized.
When a change is considered "done", this repo expects all three steps below:
- Update or add tests for the changed behavior.
- Run the relevant local test commands (at least the impacted suite).
- Update documentation to reflect the new runtime and operational status.
Minimum checklist before merge:
- behavior changes in API/UI/composables must have matching unit/e2e coverage
- security-relevant changes must update both guards and tests
- environment variable changes must be reflected in:
.env.tmpltests/README.mdenvironment knobs- this
README.mdwhen operational workflow changes
For CI lane details and test commands, see tests/README.md.
| Environment | Access URL | Use Case |
|---|---|---|
| π³ Production | http://localhost:8080/ |
Full setup with reverse proxy |
| π Local Dev (Nuxt) | http://localhost:8080/ |
Via dummy container + Nuxt HMR |
| β Wrong Access | http://localhost:3000/ |
β Bypasses Traefik β no API |
Β© AVefi Project 2025