How harshitkumar135267/pravaah works
PRAVAAH is a disaster-intelligence and early-warning platform for rainfall, floods, river hazards, and landslides. Authorities and other users explore risk and telemetry in the web command center; the frontend obtains dashboard, hazard, history, and ML information through the FastAPI API. Ingestion accepts weather, river, and infrastructure data, while alerting and simulation support warnings and real-time updates. The graph includes the documented capability areas, but unsampled endpoint implementations and frontend API wiring limit which internal connections can be verified.
Main entry points: router.py API route registry · main.py API and WebSocket app · manager.py WebSocket manager · page.tsx Web command center
Components 28
Command Center
- Web command center
frontend/app/dashboard/page.tsx - GIS and risk map
frontend/components/MapComponent.tsx - Hazard pages
frontend/app/flood-risk/page.tsx - Rainfall page
frontend/app/rainfall/page.tsx - Analytics page
frontend/app/analytics/page.tsx - Event history
frontend/app/history/page.tsx - Admin console
frontend/app/admin/page.tsx - Alert WebSocket hook
frontend/hooks/useAlertWebSocket.ts
API and Operations
- API and WebSocket app
backend/app/main.py - API route registry
backend/app/api/v1/router.py - Authentication
backend/app/api/v1/endpoints/auth.py - Alert endpoints
backend/app/api/v1/endpoints/alerts.py - Ingestion endpoints
backend/app/api/v1/endpoints/ingestion.py - Hazard and telemetry APIs
backend/app/api/v1/endpoints - Analytics endpoint
backend/app/api/v1/endpoints/analytics.py - ML endpoints
backend/app/api/v1/endpoints/ml.py - Disaster simulation
backend/app/api/v1/endpoints/simulation.py
Risk and Response
- Telemetry ingestion
backend/app/services/ingestion_service.py - Risk prediction
backend/app/services/ml_service.py - Alert lifecycle
backend/app/services/alert_service.py
Data Layer
- Domain records
backend/app/models - API contracts
backend/app/schemas - Relational database
backend/app/core/database.py - Runtime configuration
backend/app/core/config.py - Demo data seeding
backend/app/seed_data.py
Live Updates
- WebSocket manager
backend/app/websocket/manager.py
Other components
- Authorities and users
- Browser user
Connections 25
- Authorities and users → Web command center: explores risks
README.md - Web command center → Hazard pages: navigates to
README.md - Browser user → API and WebSocket app: uses API
README.md - API and WebSocket app → API route registry: mounts routes
backend/app/main.py - API route registry → Authentication: registers
backend/app/api/v1/router.py - API route registry → Alert endpoints: registers
backend/app/api/v1/router.py - API route registry → Ingestion endpoints: registers
backend/app/api/v1/router.py - API route registry → Hazard and telemetry APIs: registers
backend/app/api/v1/router.py - API route registry → Analytics endpoint: registers
backend/app/api/v1/router.py - API route registry → ML endpoints: registers
backend/app/api/v1/router.py - API route registry → Disaster simulation: registers
backend/app/api/v1/router.py - Ingestion endpoints → Telemetry ingestion: processes telemetry
backend/app/api/v1/endpoints/ingestion.py - Telemetry ingestion → Domain records: writes observations
backend/app/services/ingestion_service.py - ML endpoints → Risk prediction: requests predictions
backend/app/api/v1/endpoints/ml.py - Risk prediction → API contracts: uses contracts
backend/app/services/ml_service.py - Alert endpoints → Alert lifecycle: manages alerts
backend/app/api/v1/endpoints/alerts.py - Analytics endpoint → Domain records: queries records
backend/app/api/v1/endpoints/analytics.py - API and WebSocket app → Relational database: creates schema
backend/app/main.py - Relational database → Runtime configuration: uses settings
backend/app/core/database.py - API and WebSocket app → Demo data seeding: seeds database
backend/app/main.py - API and WebSocket app → WebSocket manager: connects clients
backend/app/main.py - Browser user → Alert WebSocket hook: receives warnings
README.md - Alert WebSocket hook → API and WebSocket app: opens alert socket
- Disaster simulation → WebSocket manager: broadcasts warning
- Alert lifecycle → WebSocket manager: broadcasts alerts