How ruthwikreddy14/sih26069-weather-analytics works
This repository is a weather-event reporting and analytics platform: reports are submitted and stored, verification signals assess their credibility, and reports can be clustered into events for risk assessment and alerts. Its frontend includes public reporting, dashboard, and authority views. The backend route-registration and core report, clustering, risk, and verification relationships are supported by excerpts or the source index. Frontend-to-backend wiring and several unsampled capabilities are not visible in the supplied evidence, so those connections are omitted.
Main entry points: __init__.py API router · pipeline.py Verification pipeline · events.py Event clusters API · database.py Database sessions
Components 34
Application entry
- FastAPI application
backend/app/main.py - API router
backend/app/api/__init__.py - Configuration
backend/app/core/config.py - Database sessions
backend/app/core/database.py - Redis client
backend/app/core/redis_client.py
Reports and verification
- Report submission and retrieval
backend/app/api/reports.py - Weather report records
backend/app/models/weather_report.py - Verification pipeline
backend/app/ml/pipeline.py - Weather verification
backend/app/ml/verifier.py - Image deduplication
backend/app/ml/image_hash.py - Text deduplication
backend/app/ml/deduplicator.py - Location verification
backend/app/ml/location_verifier.py - Confidence scoring
backend/app/ml/confidence.py
Event analytics
- Event clusters API
backend/app/api/events.py - Event clustering
backend/app/ml/event_clustering.py - Analytics API
backend/app/api/analytics.py - Risk assessment API
backend/app/api/risk.py - Risk detection
backend/app/ml/risk_detection.py
Alerts and operations
- Alerts API
backend/app/api/alerts.py - Alert services
backend/app/services/alerts.py - Health API
backend/app/api/health.py
Web interface
- Submit report page
frontend/app/submit/page.tsx - Dashboard page
frontend/app/page.tsx - Authority page
frontend/app/authority/page.tsx - Frontend API client
frontend/lib/api.ts - Reports list
frontend/components/ReportsList.tsx - Weather map
frontend/components/WeatherMap.tsx - Active alerts
frontend/components/ActiveAlerts.tsx - High-risk events
frontend/components/HighRiskEvents.tsx - Weather events
frontend/components/WeatherEvents.tsx - Filter panel
frontend/components/FilterPanel.tsx - Statistics cards
frontend/components/StatCards.tsx
Other components
- Citizen
- Authority user
Connections 33
- FastAPI application → Configuration: reads settings
backend/app/main.py - FastAPI application → Database sessions: initializes database
backend/app/main.py - FastAPI application → Redis client: connects Redis
backend/app/main.py - FastAPI application → API router: registers routes
backend/app/main.py - API router → Report submission and retrieval: registers
backend/app/api/__init__.py - API router → Event clusters API: registers
backend/app/api/__init__.py - API router → Risk assessment API: registers
backend/app/api/__init__.py - API router → Alerts API: registers
backend/app/api/__init__.py - API router → Analytics API: registers
backend/app/api/__init__.py - API router → Health API: registers
backend/app/api/__init__.py - Report submission and retrieval → Database sessions: uses sessions
backend/app/api/reports.py - Report submission and retrieval → Weather report records: queries and saves
backend/app/api/reports.py - Report submission and retrieval → Verification pipeline: triggers verification
backend/app/api/reports.py - Database sessions → Weather report records: maps records
backend/app/core/database.py - Verification pipeline → Weather report records: loads report
backend/app/ml/pipeline.py - Verification pipeline → Weather verification: checks weather
backend/app/ml/pipeline.py - Verification pipeline → Image deduplication: checks images
backend/app/ml/pipeline.py - Verification pipeline → Text deduplication: checks duplicates
backend/app/ml/pipeline.py - Verification pipeline → Location verification: checks location
backend/app/ml/pipeline.py - Verification pipeline → Confidence scoring: scores signals
backend/app/ml/pipeline.py - Weather verification → Redis client: caches weather
backend/app/ml/verifier.py - Weather verification → Configuration: reads API key
backend/app/ml/verifier.py - Event clusters API → Database sessions: queries reports
backend/app/api/events.py - Event clusters API → Weather report records: reads report fields
backend/app/api/events.py - Event clusters API → Event clustering: clusters reports
backend/app/api/events.py - Risk assessment API → Event clusters API: gets clusters
backend/app/api/risk.py - Risk assessment API → Risk detection: assesses events
backend/app/api/risk.py - Alerts API → Database sessions: uses sessions
backend/app/api/alerts.py - Alerts API → Alert services: uses alert service
backend/app/api/alerts.py - Alerts API → Risk assessment API: references risk API
backend/app/api/alerts.py - Citizen → Submit report page: submits report
- Authority user → Authority page: reviews events
- Dashboard page → Frontend API client: loads data