How satyasahu8317/heatgaurd works
HeatGuard presents heat-risk forecasts and safety guidance for Indian locations. Users choose a location or scan the map; the map can request a forecast, while the backend prediction endpoint fetches hourly weather, computes WBGT and daily heat indicators, applies prediction models, and returns a typed forecast for display. The graph preserves the major forecast, map, chart, and safety-view branches. Some frontend-to-backend wiring and unsampled component relationships are not shown in the excerpts, so uncertain links are omitted.
Main entry points: index.jsx Forecast dashboard · prediction_services.py Forecast assembly · main.py Prediction API · main.jsx React entry
Components 17
Forecast experience
- React entry
heatguard-frontend/src/main.jsx - Forecast dashboard
heatguard-frontend/src/routes/index.jsx - State risk map
heatguard-frontend/src/components/heatguard/StateRiskMap.jsx - Forecast client
heatguard-frontend/src/lib/api.js - Forecast summaries
heatguard-frontend/src/components/heatguard/ForecastList.jsx - Forecast charts
heatguard-frontend/src/components/heatguard/Charts.jsx - Safety guidance
heatguard-frontend/src/components/heatguard/SafetySection.jsx
Forecast API
- Prediction API
SIH-main/backend/main.py - Response schemas
SIH-main/backend/schemas.py
Weather input
- Hourly weather fetch
SIH-main/backend/weather_services.py
Risk computation
- Forecast assembly
SIH-main/backend/prediction_services.py - Hourly WBGT
SIH-main/backend/wbgt_services.py - Daily indicators
SIH-main/backend/wbgt_services.py - Heatwave rule
SIH-main/backend/wbgt_services.py - ML risk predictions
SIH-main/backend/prediction_services.py
Other components
- Location explorer
- Open-Meteo
Connections 15
- Location explorer → React entry: opens
heatguard-frontend/src/main.jsx - React entry → Forecast dashboard: renders
heatguard-frontend/src/main.jsx - Forecast dashboard → State risk map: renders
- State risk map → Forecast client: requests forecasts
heatguard-frontend/src/components/heatguard/StateRiskMap.jsx - Forecast dashboard → Forecast summaries: renders
heatguard-frontend/src/routes/index.jsx - Forecast dashboard → Forecast charts: renders
heatguard-frontend/src/routes/index.jsx - Forecast dashboard → Safety guidance: renders
- Prediction API → Hourly weather fetch: fetches weather
SIH-main/backend/main.py - Prediction API → Forecast assembly: builds forecast
SIH-main/backend/main.py - Prediction API → Response schemas: validates response
SIH-main/backend/main.py - Hourly weather fetch → Open-Meteo: requests hourly data
SIH-main/backend/weather_services.py - Forecast assembly → Hourly WBGT: calculates WBGT
SIH-main/backend/prediction_services.py - Forecast assembly → Daily indicators: derives indicators
SIH-main/backend/prediction_services.py - Forecast assembly → Heatwave rule: applies rule
SIH-main/backend/prediction_services.py - Forecast assembly → ML risk predictions: runs predictions
SIH-main/backend/prediction_services.py