How abhijith-cel/crowdsafe-ai-based-stampede-risk-reporting-system works
CrowdSafe accepts citizen crowd reports or media, estimates headcount and density, analyzes trends and hazard risk, persists reports and telemetry, and alerts responders when risk is high. Authorities monitor zones and alerts, acknowledge incidents, and issue manual dispatches; analytics and heatmaps provide the documented historical and spatial views. The graph combines sampled route/service behavior with README-documented frontend and analytics capabilities; those unsampled links are shown only where the product workflow is explicit. Details of analytics and auxiliary services are not verified from source excerpts.
Main entry points: report_routes.py Report routes · App.jsx Web application · database.py CrowdSafe database · AuthorityDashboard.jsx Authority dashboard
Components 24
Web experience
- Web application
frontend/src/App.jsx - Citizen upload
frontend/src/pages/CitizenUpload.jsx - Authority dashboard
frontend/src/pages/AuthorityDashboard.jsx - Analytics view
frontend/src/pages/Analytics.jsx - Heatmap view
frontend/src/components/HeatmapView.jsx - Alert banner
frontend/src/components/AlertBanner.jsx
Backend API
- Authentication routes
backend/app/routes/auth_routes.py - Report routes
backend/app/routes/report_routes.py - Authority routes
backend/app/routes/authority_routes.py - Analytics routes
backend/app/routes/analytics_routes.py
Crowd analysis
- Frame extraction
backend/app/services/frame_extractor.py - Crowd counter
backend/app/services/crowd_counter.py - Trend analysis
backend/app/services/trend_analyzer.py - Risk classification
backend/app/services/risk_classifier.py - Heatmap generation
backend/app/services/heatmap_generator.py - Zone matching
backend/app/services/geo_matcher.py - Background task queue
backend/app/services/task_queue.py
Persistence
- CrowdSafe database
backend/app/database.py
Alerts and operations
- Alert cooldown
backend/app/services/rate_limiter.py - Notification dispatch
backend/app/services/notifier.py
Other components
- Citizens
- Authorities
- PostgreSQL
- Emergency responders
Connections 23
- Citizens → Web application: use
- Authorities → Web application: use
- Web application → Citizen upload: offers reporting
- Web application → Authority dashboard: offers monitoring
- Web application → Analytics view: offers analytics
- Citizen upload → Report routes: submits reports
- Authority dashboard → Authority routes: fetches and dispatches
- Authority dashboard → Alert banner: shows alerts
- Authority dashboard → Heatmap view: shows zones
- Analytics view → Analytics routes: requests trends
- Authentication routes → CrowdSafe database: reads and writes
- Report routes → CrowdSafe database: reads and writes
- Authority routes → CrowdSafe database: reads and writes
- Analytics routes → CrowdSafe database: reads
- CrowdSafe database → PostgreSQL: queries
- Report routes → Frame extraction: extracts video frame
- Report routes → Crowd counter: estimates crowd
- Frame extraction → Crowd counter: provides frames
- Report routes → Trend analysis: records and analyzes
- Report routes → Risk classification: classifies hazard
- Report routes → Alert cooldown: checks cooldown
- Report routes → Notification dispatch: dispatches alert
- Notification dispatch → Emergency responders: sends notification