All runtime configuration for the UrbanViable frontend is supplied through Vite environment variables. Because Vite inlines environment variables into the JavaScript bundle at build time (viaDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/danizd/urbanviable/llms.txt
Use this file to discover all available pages before exploring further.
import.meta.env), there is no runtime config file to edit on the server — you set the values before building, and they are baked into the output bundle permanently.
Environment Variables
Create a.env file at frontend/.env (copy frontend/.env.example as a starting point) and set the following variables:
| Variable | Default | Description |
|---|---|---|
VITE_REACT_APP_TILE_URL | "" (empty string) | Base URL prepended when fetching galicia_scouting.geojson. In development, leave empty so the file is loaded from public/. In production, set to your TileServer GL origin, e.g. http://localhost:8080 |
REACT_APP_DATA_STATUS_URL | "/api/status" | Full URL for the DataStatus freshness check. Nginx serves a static last_update.json at this path in production |
VITE_REACT_APP_SOURCE_NAME | "galicia-scouting" | The MapLibre source ID registered with map.addSource() |
Example .env
How Variables Are Consumed in Code
Building for Production
frontend/build/. The build/ directory contains index.html and the hashed JS/CSS assets.
Serving with Nginx
Thedocker-compose.yml mounts ./frontend/build into the Nginx container:
index.html so that react-router-dom handles client-side navigation.
Integration Checklist
Before declaring the frontend functional, verify these five steps in order:- Tile metadata reachable —
GET http://localhost:8080/data/galicia-scouting.jsonreturns a JSON metadata document ✅ - Tile bytes reachable —
GET http://localhost:8080/data/galicia-scouting/7/31/50.pbfreturns binary protobuf data ✅ - No CORS errors — DevTools → Network tab shows
.pbfrequests completing without a CORS or preflight error ✅ source-layermatches — MapLibre console shows no warningsource-layer "secciones" not found; if it does, the--layervalue ingenerate_tiles.shdoes not matchsource-layerinMapViewer.jsx✅setPaintPropertysucceeds — Moving a slider in the UI produces nosetPaintPropertyerrors in the console; if errors appear, the map has not yet completed itsloadevent when the hook first fires ✅
Responsive Breakpoints
The layout adapts to the viewport width without any JavaScript — breakpoints are handled in CSS:| Breakpoint | Sidebar behaviour |
|---|---|
| ≥ 1024 px | Sidebar fixed at 320 px on the left (grid-template-columns: 320px 1fr); map fills the remaining width |
| ≤ 1023 px | Single-column layout (grid-template-columns: 1fr); sidebar stacks above the map and its right border becomes a bottom border |
Environment variables are baked into the JavaScript bundle at build time by
Vite. Changing any
VITE_REACT_APP_* or REACT_APP_* value in .env has no
effect on a previously built bundle — you must run npm run build again and
redeploy the new frontend/build/ output. If the browser shows stale behaviour
after a rebuild, restart the urbanviable-web Nginx container to clear any
cached responses.