How liso-27/nivaranai works
NivaranAI is a ward-level, multi-hazard warning and citizen-government coordination platform. Its principal cycle fuses weather feeds and corroborating citizen reports into auditable, confidence-scored ward risks; a scheduled runner persists changes and dispatches deterministic alerts. Citizens can view hazards, report conditions, find safe places, and receive notifications, while officials triage reports and manage camps and administrators oversee the platform. The React client reaches Flask services through its API layer, with Appwrite-backed state and Firebase/Twilio notification integrations. Backend connections are based chiefly on README architecture; unsampled modules are represented by documented responsibilities, not inspected internals.
Main entry points: App.tsx Role dashboards · api.py Flask API · risk_engine.py Ward risk scoring · DisasterDataContext.tsx Disaster data state
Components 27
User experience
- Role dashboards
ReGenX/src/App.tsx - Citizen tools
ReGenX/src/components/citizen - Official tools
ReGenX/src/components/government - Admin dashboard
ReGenX/src/components/admin/AdminDashboard.tsx - Disaster map
ReGenX/src/components/map/DisasterMap.tsx - Disaster data state
ReGenX/src/context/DisasterDataContext.tsx - Authentication state
ReGenX/src/context/AuthContext.tsx - Notification state
ReGenX/src/context/NotificationContext.tsx - REST client
ReGenX/src/services/api.ts
API and coordination
- Flask API
api.py - Role access and audit
auth_service.py - Crowd reports
crowd_updates.py
Risk intelligence
- Ward risk scoring
risk_engine.py - Scheduled risk cycle
scheduled_runner.py - Hazard map zones
map_zones.py - Weather data providers
Response operations
- Safe-place services
emergency_locations.py - News service
news_service.py - Alert dispatch
notification_service.py - SMS controls
sms_service.py
External platform
- Appwrite
- Firebase messaging
- Twilio SMS
- Gemini explanations
Other components
- Citizens
- Government officials
- Administrators
Connections 35
- Citizens → Role dashboards: use
ReGenX/src/App.tsx - Government officials → Role dashboards: use
ReGenX/src/App.tsx - Administrators → Role dashboards: use
ReGenX/src/App.tsx - Role dashboards → Citizen tools: renders
ReGenX/src/App.tsx - Role dashboards → Official tools: renders
ReGenX/src/App.tsx - Role dashboards → Admin dashboard: renders
README.md - Role dashboards → Disaster map: renders
ReGenX/src/App.tsx - Role dashboards → Disaster data state: provides
ReGenX/src/App.tsx - Role dashboards → Authentication state: uses
ReGenX/src/App.tsx - Citizen tools → Disaster data state: reads and updates
ReGenX/src/components/citizen/CitizenDashboard.tsx - Official tools → Disaster data state: reads and updates
ReGenX/src/components/government/CampManagerView.tsx - Disaster map → Disaster data state: reads layers
ReGenX/src/components/map/DisasterMap.tsx - Disaster data state → REST client: requests data
ReGenX/src/context/DisasterDataContext.tsx - Authentication state → REST client: authenticates through
ReGenX/src/context/AuthContext.tsx - REST client → Flask API: REST requests
README.md - Flask API → Role access and audit: delegates auth
README.md - Flask API → Crowd reports: routes reports
README.md - Flask API → Safe-place services: routes locations
README.md - Flask API → Hazard map zones: routes map zones
README.md - Flask API → News service: routes news
README.md - Crowd reports → Ward risk scoring: supplies corroboration
crowd_updates.py - Ward risk scoring → Weather data providers: fetches signals
README.md - Scheduled risk cycle → Ward risk scoring: runs scoring
README.md - Scheduled risk cycle → Alert dispatch: dispatches changes
README.md - Ward risk scoring → Appwrite: writes risk rows
risk_engine.py - Scheduled risk cycle → Appwrite: persists changes
README.md - Hazard map zones → Ward risk scoring: transforms risk
map_zones.py - Hazard map zones → Appwrite: reads risk zones
map_zones.py - Safe-place services → Appwrite: stores locations
emergency_locations.py - Alert dispatch → SMS controls: sends SMS through
README.md - Alert dispatch → Firebase messaging: sends push
README.md - SMS controls → Twilio SMS: sends messages
README.md - Notification state → REST client: syncs tokens
ReGenX/src/context/NotificationContext.tsx - Notification state → Firebase messaging: registers token
ReGenX/src/context/NotificationContext.tsx - Ward risk scoring → Gemini explanations: explains scores
README.md