π₯οΈ Dashboard UI
This is the graphical user interface for the CONDOR project, built with React 19, Vite, and Microsoft Fluent UI.
Getting Startedβ
Prerequisitesβ
- Node.js (v22+)
- npm
Installationβ
cd server/ui
npm install
Local Development (against a deployed environment)β
The UI can be run locally while pointing all API calls, authentication, and static assets to a deployed CONDOR backend. A Vite dev proxy handles routing and cookie rewriting so login works on http://localhost.
1. Generate the OpenAPI clientβ
The API client is auto-generated from the backend's OpenAPI spec. Fetch it from the deployed environment:
curl -o openapi.json https://<deployed-server-url>/openapi.json
This file is git-ignored. The predev script will regenerate the TypeScript client from it automatically when you run npm run dev.
2. Create .env.developmentβ
Create a .env.development file in the server/ui/ directory (git-ignored):
VITE_OPENAPI_BASE=
VITE_NEARBY_CAMERAS_DISTANCE_KM=50
VITE_PROXY_TARGET=https://<deployed-server-url>
| Variable | Description |
|---|---|
VITE_OPENAPI_BASE | Leave empty for local dev β API calls go through the Vite proxy. In production this is set during the Docker build. |
VITE_NEARBY_CAMERAS_DISTANCE_KM | Distance in km for the nearby cameras feature. |
VITE_PROXY_TARGET | Full URL of the deployed CONDOR backend. The Vite dev server proxies /api, /static, /health, /openapi.json, and the login page to this target. |
3. Start the dev serverβ
npm run dev
Open http://localhost:5173 β you'll see the login page served from the deployed environment. After logging in, the local React app is served with hot-module replacement.
How the dev proxy worksβ
/api/**,/health,/openapi.json,/docsβ proxied to the deployed backend.GET /(no session cookie) β proxied to the deployed backend, which returns the server-rendered login page.GET /(with session cookie) β Vite serves the local React app./static/**β proxied to the deployed backend (login page CSS, images, video).Set-Cookierewriting β The proxy strips theSecureflag and adjustsSameSiteso cookies work onhttp://localhost.
All proxy configuration is dev-only β guarded behind mode === 'development' and the presence of VITE_PROXY_TARGET. Nothing affects vite build.
Buildβ
npm run build
Outputs the production bundle to ../private/ (served by the FastAPI backend).
Production Dependenciesβ
| Package | Version | Purpose |
|---|---|---|
@fluentui/react-components | ^9.72.6 | Microsoft Fluent UI React components |
@fluentui/react-datepicker-compat | ^0.6.19 | Fluent UI datepicker component |
bootstrap | ^5.3.8 | CSS framework for responsive design |
chart.js | β | Charting library (peer dependency of react-chartjs-2) |
maplibre-gl | ^5.12.0 | Open-source mapping library |
proj4 | ^2.20.2 | Coordinate transformation library |
react | ^19.2.0 | JavaScript library for building user interfaces |
react-chartjs-2 | ^5.3.1 | React wrapper for Chart.js |
react-dom | ^19.2.0 | React DOM rendering |
wgpu-matrix | ^3.4.0 | WebGPU matrix math library |