How manobalaji07/bhurakshak works
BhuRakshak is a mine-safety monitoring and decision-support application. Operators use the web dashboard to inspect node health, telemetry trends, analytics, alerts, notifications, and SMS controls; mine nodes submit telemetry to the backend. The backend exposes REST APIs, maintains node and alert state, evaluates ML signals, and can dispatch SMS alerts. The sampled code confirms alert processing, authentication, health timeouts, SMS dispatch, and WebSocket broadcasting; telemetry ingestion and several router-to-service links are represented only at the documented API boundary because their implementations were not sampled.
Main entry points: main.py FastAPI Application · App.tsx Web Application · auth.py Authentication API · store.py Application Store
Components 29
Operator Console
- Web Application
frontend/src/App.tsx - API Client
frontend/src/api/client.ts - Dashboards
frontend/src/pages/user/UserDashboard.tsx - Analytics View
frontend/src/pages/admin/AdminAnalytics.tsx - Node Detail
frontend/src/pages/shared/NodeDetail.tsx - Alert Management
frontend/src/pages/admin/AdminAlerts.tsx - SMS Controls
frontend/src/pages/admin/AdminSms.tsx - Notifications
frontend/src/components/common/NotificationDrawer.tsx
Backend API
- FastAPI Application
backend/app/main.py - Telemetry API
backend/app/api/telemetry.py - Nodes API
backend/app/api/nodes.py - Analytics API
backend/app/api/analytics.py - Alerts API
backend/app/api/alerts.py - Notifications API
backend/app/api/notifications.py - Authentication API
backend/app/api/auth.py - SMS API
backend/app/api/sms.py
Monitoring and Decisions
- ML Inference
backend/app/ml/inference.py - Feature Extraction
backend/app/ml/feature_extractor.py - Alert Decisions
backend/app/services/alert_service.py - Node Health
backend/app/services/node_health_service.py - Kinematic Trends
backend/app/services/kinematic_service.py - SMS Dispatch
backend/app/services/sms_service.py - WebSocket Broadcast
backend/app/websocket/manager.py
State and Identity
- Application Store
backend/app/db/store.py - Mongo User Store
backend/app/db/mongo_user_store.py - JWT Authentication
backend/app/auth/jwt.py
Other components
- Mine Operator
- Mine Sensor Nodes
- SMS Gateway
Connections 29
- Mine Operator → Web Application: uses
- Web Application → API Client: requests data
- Web Application → Dashboards: routes to
- Web Application → Analytics View: routes to
- Web Application → Node Detail: routes to
- Web Application → Alert Management: routes to
- Web Application → SMS Controls: routes to
- Web Application → Notifications: renders
- API Client → FastAPI Application: HTTP requests
- FastAPI Application → Telemetry API: registers route
- FastAPI Application → Nodes API: registers route
- FastAPI Application → Analytics API: registers route
- FastAPI Application → Alerts API: registers route
- FastAPI Application → Notifications API: registers route
- FastAPI Application → Authentication API: registers route
- FastAPI Application → SMS API: registers route
- Mine Sensor Nodes → Telemetry API: submits readings
- FastAPI Application → Node Health: checks timeouts
- Node Health → Application Store: reads and updates
- Node Health → WebSocket Broadcast: broadcasts changes
- ML Inference → Feature Extraction: builds features
- Alert Decisions → Application Store: stores alerts
- Alert Decisions → SMS Dispatch: dispatches subsidence alert
- SMS Dispatch → Application Store: reads config and logs
- SMS Dispatch → SMS Gateway: sends messages
- Authentication API → Mongo User Store: looks up users
- Authentication API → Application Store: fallback lookup
- Authentication API → JWT Authentication: verifies and issues tokens
- FastAPI Application → WebSocket Broadcast: accepts telemetry socket