How yashkumawat143/city_pulse works
CityPulse’s current React/FastAPI application monitors simulated civic signals, derives anomalies and possible multi-signal events, and presents live city intelligence through dashboard views. The main user workflow runs from authenticated access, through REST/WebSocket snapshot updates, to dashboard, event, alert, source, and simulation views; users can also inspect events. The backend excerpt identifies its simulated-data analytics stages, while the README documents broader capabilities. Backend internals share one source file; wiring beyond the sampled excerpts is represented only where documented.
Main entry points: App.jsx App routing · main.py REST and WebSocket API · useCityPulse.js Live data hook · Auth.jsx Sign-in views
Components 20
Civic intelligence backend
- Signal simulator
CityPulse/backend/main.py - Anomaly analysis
CityPulse/backend/main.py - Event analysis
CityPulse/backend/main.py - Health and risk
CityPulse/backend/main.py - Replay history
CityPulse/backend/main.py - REST and WebSocket API
CityPulse/backend/main.py
Web application
- App routing
CityPulse/frontend/src/App.jsx - Sign-in views
CityPulse/frontend/src/pages/Auth.jsx - Live data hook
CityPulse/frontend/src/hooks/useCityPulse.js - API client
CityPulse/frontend/src/lib/api.js - Event inspection
CityPulse/frontend/src/components/EventDrawer.jsx
Monitoring views
- City dashboard
CityPulse/frontend/src/pages/Dashboard.jsx - Event monitoring
CityPulse/frontend/src/pages/Events.jsx - Anomaly view
CityPulse/frontend/src/pages/Anomalies.jsx - Alert view
CityPulse/frontend/src/pages/Alerts.jsx - Source status
CityPulse/frontend/src/pages/Sources.jsx - Scenario simulation
CityPulse/frontend/src/pages/Simulation.jsx
Browser identity
- Local account logic
CityPulse/frontend/src/lib/auth.js
Other components
- CityPulse user
- Browser local storage
Connections 22
- CityPulse user → App routing: opens
- App routing → Sign-in views: routes
- Sign-in views → Local account logic: authenticates
- Local account logic → Browser local storage: reads and writes
- App routing → Live data hook: starts monitoring
- Live data hook → API client: requests data
- API client → REST and WebSocket API: calls REST and WebSocket
- Signal simulator → Anomaly analysis: generates signals for
- Signal simulator → Event analysis: generates signals for
- Anomaly analysis → REST and WebSocket API: serves findings through
- Event analysis → REST and WebSocket API: serves events through
- Health and risk → REST and WebSocket API: serves scores through
- Replay history → REST and WebSocket API: serves replay through
- REST and WebSocket API → Live data hook: streams and returns snapshots
- App routing → City dashboard: routes snapshot to
- App routing → Event monitoring: routes snapshot to
- App routing → Anomaly view: routes snapshot to
- App routing → Alert view: routes snapshot to
- App routing → Source status: routes snapshot to
- App routing → Scenario simulation: routes snapshot to
- App routing → Event inspection: opens selected event
- CityPulse user → City dashboard: monitors