How mritunjay20253162-code/weather-analytics works
NWBDAP collects citizen and external weather observations, processes them into classified and deduplicated reports, and exposes those reports for verification, mapping, and analytics. Users enter through the React dashboards; Firebase authentication and backend role checks protect identity-sensitive actions. The README also documents satellite/AWS data capabilities, though their ingestion implementation is not represented in the supplied tree. Edges are limited to excerpted calls, SOURCE INDEX references, or explicit README documentation; some UI-to-API links are therefore omitted or marked unverified.
Main entry points: server.js API server · processWeatherReport.js Report processing · WeatherReport.js Weather report records · analyticsRoutes.js Analytics API
Components 26
Web experience
- Application router
src/App.jsx - User dashboard
src/pages/UserDashboard.jsx - Admin dashboard
src/pages/AdminDashboard.jsx - Analytics charts
src/components/AnalyticsCharts.jsx - Weather map
src/components/WeatherMap.jsx - Astra chatbot
src/components/GeminiChatbot.jsx - Theme state
src/context/ThemeContext.jsx
Identity and access
- Auth state
src/context/AuthContext.jsx - Firebase client
src/services/firebase.js - Token and role checks
backend/middleware/authMiddleware.js - User account API
backend/routes/userRoutes.js
Weather data processing
- Citizen report API
backend/routes/weatherRoutes.js - Weather API ingestion
backend/routes/weatherApiRoutes.js - External data ingestion
backend/routes/socialDataRoutes.js - Report processing
backend/services/processWeatherReport.js - Weather classifier
backend/services/weatherClassifier.js - Duplicate detection
backend/services/duplicateDetector.js
Mapping and analytics
- Analytics API
backend/routes/analyticsRoutes.js - Weather AI API
backend/routes/aiRoutes.js
Backend and records
- User records
backend/models/User.js - API server
backend/server.js - Weather report records
backend/models/WeatherReport.js
Other components
- Citizen observer
- Administrator
- Open-Meteo
- Google Gemini
Connections 37
- Citizen observer → User dashboard: submits reports
- Administrator → Admin dashboard: reviews reports
- Application router → User dashboard: routes to
src/App.jsx - Application router → Admin dashboard: routes to
src/App.jsx - Application router → Auth state: provides auth
src/App.jsx - Auth state → Firebase client: uses
src/context/AuthContext.jsx - Auth state → User account API: syncs account
- API server → User account API: mounts
backend/server.js - API server → Citizen report API: mounts
backend/server.js - API server → Weather API ingestion: mounts
backend/server.js - API server → External data ingestion: mounts
backend/server.js - API server → Analytics API: mounts
backend/server.js - API server → Weather AI API: mounts
backend/server.js - User account API → Token and role checks: checks access
backend/routes/userRoutes.js - User account API → User records: reads and writes
backend/routes/userRoutes.js - Token and role checks → User records: checks role
backend/middleware/authMiddleware.js - Citizen report API → Weather report records: creates reports
backend/routes/weatherRoutes.js - Citizen report API → Report processing: processes report
backend/routes/weatherRoutes.js - Weather API ingestion → Open-Meteo: fetches conditions
backend/routes/weatherApiRoutes.js - Weather API ingestion → Weather report records: creates reports
backend/routes/weatherApiRoutes.js - Weather API ingestion → Report processing: processes report
backend/routes/weatherApiRoutes.js - External data ingestion → Weather report records: creates reports
backend/routes/socialDataRoutes.js - External data ingestion → Report processing: processes report
backend/routes/socialDataRoutes.js - Report processing → Weather report records: updates report
backend/services/processWeatherReport.js - Report processing → Weather classifier: classifies
backend/services/processWeatherReport.js - Report processing → Duplicate detection: checks duplicates
backend/services/processWeatherReport.js - Analytics API → Weather report records: queries reports
backend/routes/analyticsRoutes.js - User dashboard → Analytics charts: renders
src/pages/UserDashboard.jsx - Admin dashboard → Analytics charts: renders
src/pages/AdminDashboard.jsx - User dashboard → Weather map: renders
src/pages/UserDashboard.jsx - Admin dashboard → Weather map: renders
src/pages/AdminDashboard.jsx - Analytics charts → Analytics API: fetches analytics
- Weather map → Analytics API: fetches map data
- Astra chatbot → Google Gemini: requests AI answers
- Application router → Astra chatbot: renders
src/App.jsx - Weather map → Theme state: reads theme
src/components/WeatherMap.jsx - Analytics API → Weather report records: provides map and statistics
backend/routes/analyticsRoutes.js