Footfall API: Live Connection & Simulator
The dashboard loads footfall centrally via GET /api/analytics/footfall?centerId=<uuid>.
Resolution order: Live → Simulator → empty — no scattered hardcoded mocks.
Data mode (global)
| Mode | Behavior |
|---|---|
live | Real partner/sensor data only (when env is configured) |
simulator | Deterministic demo numbers (center + date as seed) |
off | No simulated data — empty states when live is missing |
Priority: COCKPIT_DATA_MODE (env) → IntegrationConfig (service: cockpit-data-mode) → default (simulator when no live footfall env).
- API:
GET /api/system/data-mode,PATCHsuper admin only - UI: “Data simulator” card on
/dashboard/analytics/footfall - KPIs:
GET /api/analytics/footfall/summary?centerId=<uuid>(admin dashboard tiles)
# Optional: env override (locks UI toggle)
COCKPIT_DATA_MODE=simulator # live | simulator | off
Already in the code
| Component | Path |
|---|---|
| Types (incl. zones) | apps/dashboard/src/lib/analytics/footfall/types.ts |
| Central resolution | resolve-footfall.ts |
| Simulator | simulator.ts |
| Data mode | apps/dashboard/src/lib/data-mode/ |
| Env + live stub | integration.ts |
| API routes | footfall/route.ts, footfall/summary/route.ts |
| UI | FootfallIntegrationStatusAlert, DataSimulatorSettings, DataSourceBadge |
Legacy mock-footfall-data.ts is for tests only — not production.
Related
Nutzungsstatistik: Seitenaufrufe werden anonymisiert erfasst. Im Umami-Dashboard nach diesem Pfad filtern: /en/developer-guide/footfall-integration-prep