How abdelrahmanibrahim11/crovia works
CROVIA is a crowd-danger monitoring and warning system for Lusail. Its principal workflow is to monitor network congestion, check reachability, sample phones with location verification, judge arrival flow against bottleneck capacity, and—after an alarm—retrieve more precise location context and send warnings while prioritizing responders. The graph also includes the documented AI and operator/citizen app capabilities. Some backend wiring and screens are unsampled; edges are limited to README statements and relationships listed in the SOURCE INDEX.
Main entry points: engine.py Detection engine · runtime.py Service runtime · AdminDashboardScreen.tsx Operator dashboard · UserDashboardScreen.tsx Citizen dashboard
Components 27
Sensing and detection
- Detection engine
backend/app/detect/engine.py - Bottleneck judgement
backend/app/detect/danger.py - CAMARA client
backend/app/camara/client.py - City capacity model
backend/app/core/city.py - Device registry
backend/app/core/registry.py - API spend control
backend/app/core/budget.py
Incident operations
- Network event handlers
backend/app/api/webhooks.py - Citizen warnings
backend/app/services/warnings.py - Responder priority
backend/app/services/priority.py - Incident records
backend/app/services/incidents.py - Device enrollment
backend/app/services/enrollment.py - AI agent tools
backend/app/ai/graph.py
Backend platform
- Service runtime
backend/app/runtime.py - Authentication API
backend/app/api/auth.py - User data services
backend/app/usersDB/services.py - User database
backend/app/usersDB/db.py
User experience
- App navigation
crovia-ui/App.tsx - Operator dashboard
crovia-ui/src/screens/AdminDashboardScreen.tsx - Citizen dashboard
crovia-ui/src/screens/UserDashboardScreen.tsx - City map
crovia-ui/src/components/CityMap.tsx - Live state polling
crovia-ui/src/useLiveState.ts - Backend API client
crovia-ui/src/api.ts - Session handling
crovia-ui/src/session.ts - Lusail geography
crovia-ui/src/geo/index.ts
Other components
- Mobile network
- City operator
- Citizen
Connections 33
- Service runtime → Detection engine: runs
backend/app/runtime.py - Detection engine → CAMARA client: requests network data
backend/app/detect/engine.py - Detection engine → Bottleneck judgement: evaluates risk
backend/app/detect/engine.py - Detection engine → City capacity model: uses capacity model
backend/app/detect/engine.py - Detection engine → Device registry: checks devices
backend/app/detect/engine.py - Detection engine → API spend control: allocates spend
backend/app/detect/engine.py - Mobile network → CAMARA client: provides API
- Mobile network → Network event handlers: sends events
backend/app/api/webhooks.py - Network event handlers → Service runtime: feeds notifications
backend/app/api/webhooks.py - Service runtime → Citizen warnings: sends warnings
backend/app/main.py - Service runtime → Responder priority: opens responder sessions
backend/app/main.py - Service runtime → Incident records: uses incident service
backend/app/main.py - Service runtime → AI agent tools: starts agent
backend/app/main.py - Service runtime → Device enrollment: uses enrollment
backend/app/main.py - Device enrollment → Device registry: restores devices
backend/app/services/enrollment.py - Device enrollment → User database: loads consent
backend/app/services/enrollment.py - Authentication API → User data services: uses user services
backend/app/api/auth.py - User data services → User database: reads and writes
backend/app/usersDB/services.py - City operator → Operator dashboard: views city status
- Citizen → Citizen dashboard: receives warnings
- App navigation → Operator dashboard: routes to
crovia-ui/App.tsx - App navigation → Citizen dashboard: routes to
crovia-ui/App.tsx - Operator dashboard → Live state polling: polls state
crovia-ui/src/screens/AdminDashboardScreen.tsx - Citizen dashboard → Live state polling: polls state
crovia-ui/src/screens/UserDashboardScreen.tsx - Live state polling → Backend API client: fetches live data
crovia-ui/src/useLiveState.ts - Operator dashboard → City map: renders map
crovia-ui/src/screens/AdminDashboardScreen.tsx - Citizen dashboard → City map: renders map
crovia-ui/src/screens/UserDashboardScreen.tsx - City map → Lusail geography: uses geography
crovia-ui/src/components/CityMap.tsx - App navigation → Session handling: loads session
crovia-ui/App.tsx - Session handling → Authentication API: authenticates
crovia-ui/src/session.ts - Detection engine → Citizen warnings: triggers warning stage
- Detection engine → Responder priority: triggers responder priority
- CAMARA client → Mobile network: checks reachability and location