Sense β Fuse β Predict β Alert β Respond β Learn
A full-stack disaster intelligence and decision-support platform for vulnerable hilly and mountainous regions.
- Overview
- Problem Statement
- Core Workflow
- Key Capabilities
- System Architecture
- Technology Stack
- Application Modules
- Project Structure
- Risk Intelligence
- AI Emergency Assistant
- Security Architecture
- REST API
- Local Development
- Optional Python Tools
- Testing
- Deployment
- Production Security Checklist
- Development Workflow
- Roadmap
- Engineering Philosophy
- Documentation
- License
- Disclaimer
HillGuard is an AI-powered, IoT-enabled, GIS-based disaster intelligence platform designed for rapidly developing hazards in hilly and mountainous environments.
The platform brings multiple information streams into a unified Disaster Command Center:
- π‘ Environmental and IoT telemetry
- π¦οΈ Weather information
- π Risk and prediction analysis
- πΊοΈ GIS-based hazard visualization
- π Historical disaster intelligence
- π¨ Alert and escalation workflows
- π₯ Emergency-response coordination
- π€ AI-assisted disaster reasoning and decision support
The core idea is simple:
Turn distributed environmental information into localized, understandable, and operationally useful disaster intelligence.
HillGuard is designed as a human-in-the-loop system. Automated predictions and AI outputs support operational teams; they do not replace official warnings, trained emergency personnel, or established emergency procedures.
Hilly and mountainous regions can be exposed to fast-changing hazards such as:
| Hazard | Example Signals |
|---|---|
| π Flash Floods | Heavy rainfall, rising water levels |
| β°οΈ Landslides | Soil saturation, slope instability |
| π§οΈ Cloudbursts | Extreme short-duration rainfall |
| π River Surges | Rapid river/water-level increase |
| π± Ground Instability | Soil moisture and terrain-related indicators |
Traditional monitoring can become difficult when information is distributed across different data sources and operational teams.
MULTI-SOURCE INFORMATION
β
βββββββββββββΌββββββββββββ
βΌ βΌ βΌ
IoT Weather Historical
Sensors Data Data
βββββββββββββΌββββββββββββ
βΌ
DATA FUSION
βΌ
RISK INTELLIGENCE
βΌ
ββββββββββββββΌβββββββββββββ
βΌ βΌ βΌ
Flood Landslide Overall
Risk Risk Risk
ββββββββββββββΌβββββββββββββ
βΌ
ALERT / ESCALATE
βΌ
DASHBOARD + GIS + RESPONSE
βΌ
HUMAN DECISION
HillGuard follows an operational pipeline:
βββββββββββ
β SENSE β Collect environmental information
ββββββ¬βββββ
βΌ
βββββββββββ
β FUSE β Combine telemetry + weather + history
ββββββ¬βββββ
βΌ
ββββββββββββ
β PREDICT β Estimate multi-hazard risk
ββββββ¬ββββββ
βΌ
βββββββββββ
β ALERT β Generate risk-aware warnings
ββββββ¬βββββ
βΌ
βββββββββββ
β RESPOND β Coordinate emergency resources
ββββββ¬βββββ
βΌ
ββββββββββ
β LEARN β Review incidents and improve models
ββββββββββ
HillGuard provides centralized visibility into distributed environmental monitoring stations.
- π§οΈ Rainfall
- π River / water level
- π± Soil moisture
- β°οΈ Slope stability
- π‘οΈ Temperature
- π Station and location information
- π’ Sensor health and connectivity
The dashboard can display station state and telemetry trends so operators can monitor environmental changes from one place.
HillGuard combines environmental indicators to produce separate risk dimensions.
Rainfall ββββββββββββββββ
ββββΊ Flood Risk
Water Level βββββββββββββ
Soil Moisture βββββββββββ
ββββΊ Landslide Risk
Slope Stability βββββββββ
Historical Risk ββββββββββββΊ Overall Risk Intelligence
- Overall risk
- Flood risk
- Landslide risk
- Risk trend
- Lead-time estimate
- Model version
- Prediction inputs
- Confidence / uncertainty information where available
β οΈ Risk predictions are decision-support outputs. They should be validated against official monitoring and emergency-management procedures before real-world action.
The GIS module provides a geographic view of hazard intelligence and response resources.
- π Flood-risk areas
- β°οΈ Landslide-risk areas
- π‘ IoT monitoring stations
- π₯ Population / vulnerable communities
- π₯ Emergency shelters
- π¨ Active alerts
- π Monitored locations
- Leaflet
- React-Leaflet
- OpenStreetMap-compatible map tiles
The map is intended to help operators understand the spatial relationship between hazards, monitoring stations, exposed communities, and emergency resources.
HillGuard provides centralized warning and alert workflows.
LOW
β
MODERATE
β
HIGH
β
CRITICAL
| Field | Description |
|---|---|
| Hazard | Flood, landslide, etc. |
| Severity | Current alert level |
| Location | Affected area |
| Message | Operator-facing warning |
| Timestamp | Alert creation time |
| Expiration | Alert validity |
| Status | Active / inactive |
| Response | Current response state |
- SOS broadcasts
- Alert escalation
- Operator acknowledgement
- Targeted notifications
- Emergency-response workflows
The command dashboard consolidates operational indicators into one interface.
- Overall risk
- Flood risk
- Landslide risk
- Active alerts
- Sensor status
- Weather conditions
- Telemetry trends
- Monitored locations
- Emergency-response information
Dashboard data can be refreshed periodically to provide updated operational visibility.
The Simulation Lab supports controlled what-if analysis.
Rainfall β
+
Soil Saturation β
+
River Level β
β
βΌ
Potential Hazard Risk β
- Flood scenarios
- Landslide scenarios
- What-if analysis
- Risk comparison
- Model-input inspection
- Prediction-output inspection
- Historical comparison
- Model-performance information
This allows users to study how changes in environmental inputs can affect calculated risk.
Historical data supports analysis, comparison, and post-incident review.
- Incident timeline
- Disaster type
- Location
- Severity
- Historical patterns
- Seasonal trends
- Risk comparison
- Post-incident analysis
- CSV export
- PDF reports
- Incident summaries
- After-action analysis
The Emergency Hub connects risk intelligence with response coordination.
- π Shelter availability
- π₯ Shelter capacity
- π Responder information
- π¦ Resource allocation
- π Emergency contacts
- π£οΈ Evacuation planning
- π Situation Report generation
- π’ Community communication
HillGuard includes an AI-assisted disaster intelligence interface.
Rather than sending a request directly to a single generation step, the emergency workflow uses a controlled multi-stage pipeline:
User Request
β
βΌ
βββββββββββββββββ
β Planner β
βββββββββ¬ββββββββ
βΌ
ββββββββββββββββββββ
β Safety Auditor β
ββββββββββ¬ββββββββββ
βΌ
βββββββββββββββββ
β Writer β
βββββββββ¬ββββββββ
βΌ
ββββββββββββββββββ
β Reviewer β
ββββββββββ¬ββββββββ
βΌ
Final Response
- Disaster-risk explanations
- Emergency scenario analysis
- Project knowledge
- Learning modules
- Incident reasoning
- Situation-report generation
- Emergency-response guidance
π§ The AI assistant is intended as decision support, not as a replacement for emergency authorities or official warnings.
HillGuard includes application-security controls across authentication, authorization, API protection, and account recovery.
- JWT authentication
- Password hashing with bcrypt
- Protected routes
- Role-based access control
- Session expiration
- Login / logout handling
- Password reset workflow
- Password recovery
Forgot Password
β
βΌ
Secure Random Token
β
βΌ
SHA-256 Token Hash
β
βΌ
Database
β
βΌ
Expiring Reset Link
β
βΌ
Password Reset
β
βΌ
Token Invalidated
- Helmet security headers
- CORS configuration
- Express rate limiting
- Input validation
- MongoDB / Mongoose validation
- Protected API routes
- Environment-variable configuration
- Request logging
HillGuard supports role-oriented access.
| Role | Example Responsibilities |
|---|---|
| π Admin | User management, configuration, administration |
| π’ Authority | Risk monitoring, alerts, incident coordination |
| π Responder | Emergency response, resource coordination |
| π§βπ» Operator | Monitoring and operational workflows |
| π€ Citizen | Public-facing information where enabled |
Authorization is enforced on protected application routes and backend APIs.
flowchart TD
A[IoT Sensors] --> D[Data Fusion / API Layer]
B[Weather Data] --> D
C[Historical Data] --> D
U[User Input] --> D
D --> R[Risk & Prediction Engine]
R --> F[Flood Risk]
R --> L[Landslide Risk]
R --> O[Overall Risk]
F --> X[Alert / Escalation]
L --> X
O --> X
X --> DB[Command Dashboard]
X --> GIS[GIS Risk Map]
X --> EH[Emergency Hub]
DB --> HD[Human Decision]
GIS --> HD
EH --> HD
| Technology | Purpose |
|---|---|
| React 19 | User interface |
| React Router v7 | SPA routing |
| Vite | Development and build tooling |
| Axios | API communication |
| Leaflet | Interactive maps |
| React-Leaflet | React GIS integration |
| Chart.js | Data visualization |
| Lucide React | Icons |
| Motion | UI animations |
| CSS3 | Styling and responsive design |
| Technology | Purpose |
|---|---|
| Node.js | Runtime |
| Express.js 5 | REST API |
| MongoDB | Database |
| Mongoose 9 | ODM |
| JWT | Authentication |
| bcryptjs | Password hashing |
| Helmet | Security headers |
| CORS | Cross-origin control |
| Morgan | HTTP logging |
| Express Rate Limit | API protection |
- Google Gemini / GenAI integration
- Python emergency tools
- NASA GPM IMERG precipitation data tooling
- MongoDB-backed AI memory
- Risk-calculation engine
- Historical disaster dataset
HillGuard/
β
βββ frontend/
β βββ public/
β β βββ assets/
β βββ src/
β β βββ components/
β β βββ context/
β β βββ pages/
β β βββ services/
β β βββ styles/
β β βββ utils/
β β βββ App.jsx
β β βββ main.jsx
β β βββ index.css
β βββ index.html
β βββ package.json
β βββ vite.config.js
β
βββ backend/
β βββ config/
β βββ controllers/
β βββ middleware/
β βββ models/
β βββ routes/
β βββ scripts/
β βββ services/
β βββ utils/
β βββ server.js
β βββ package.json
β
βββ my_project/
β βββ chat_terminal.py
β βββ chat_api.py
β βββ download_files_GPM_3IMERGDF_07.py
β βββ requirements.txt
β βββ .env.example
β
βββ OPERATOR_MANUAL.md
βββ README.md
βββ LICENSE
| Module | Route | Purpose |
|---|---|---|
| π Home | / |
Project overview |
| π Login | /login |
Authentication |
| π Forgot Password | /forgot-password |
Account recovery |
| π Reset Password | /reset-password |
Password reset |
| π Dashboard | /dashboard |
Command center |
| π‘ Live Monitoring | /dashboard/monitoring |
IoT telemetry |
| πΊοΈ Risk Map | /dashboard/risk-map |
GIS risk visualization |
| π¨ Alerts | /dashboard/alerts |
Warning management |
| π§ͺ Simulation Lab | /dashboard/simulation |
What-if analysis |
| π Historical Data | /dashboard/history |
Disaster archive |
| π₯ Emergency Hub | /dashboard/emergency-hub |
Response coordination |
| π€ AI Assistant | /dashboard/ai-assistant |
AI intelligence |
| βοΈ Mission Control | /dashboard/admin |
Administration |
HillGuard uses a normalized 0β100 risk score for its displayed classification.
| Score | Classification |
|---|---|
| 0β29 | π’ Low |
| 30β54 | π‘ Moderate |
| 55β74 | π High |
| 75β100 | π΄ Critical |
The system can expose:
- Flood risk
- Landslide risk
- Overall risk
- Risk trends
- Prediction inputs
- Model version
- Lead-time estimate
- Confidence / uncertainty information where available
Important: The scoring and classifications are application decision-support outputs. Real-world emergency action must follow official monitoring, trained personnel, and established protocols.
Authentication
POST /api/auth/register
POST /api/auth/login
GET /api/auth/me
POST /api/auth/forgot-password
POST /api/auth/reset-password/:token
Sensors
GET /api/sensors
GET /api/sensors/:id
POST /api/sensors
POST /api/sensors/:id/data
DELETE /api/sensors/:id
Risk & Prediction
GET /api/risk
POST /api/risk/predict
GET /api/predictions
POST /api/risk/historical
Alerts
GET /api/alerts
POST /api/alerts
GET /api/alerts/:id
PUT /api/alerts/:id
Weather
GET /api/weather
GET /api/weather/forecast
AI
POST /api/ai/chat
GET /api/ai/session
PATCH /api/ai/session
DELETE /api/ai/session
POST /api/ai/emergency
GET /api/ai/study-modules
GET /api/ai/project-context
Install:
- Node.js 18+
- npm 9+
- MongoDB 6+
- Git
- Python 3.11+ for optional Python tooling
git clone https://github.com/ROHIT3470/Disaster-Management.git
cd Disaster-Managementcd backend
npm installCreate:
backend/.env
Example:
PORT=5000
MONGO_URI=mongodb://127.0.0.1.............
JWT_SECRET=replace-with-a-long-random-secret
JWT_EXPIRES_IN=7d
CLIENT_URL=http://localhost:5173
NODE_ENV=development
SMTP_HOST=smtp.gmail.com
SMTP_PORT=465
SMTP_USER=your-email@gmail.com
SMTP_PASSWORD=your-gmail-app-password
SMTP_FROM=HillGuard <your-email@gmail.com>Start the backend:
npm run devBackend:
http://localhost:5000
Health endpoint:
http://localhost:5000/api/health
Open another terminal:
cd frontend
npm installCreate:
frontend/.env
Example:
VITE_API_URL=http://localhost:5000/apiStart the frontend:
npm run devFrontend:
http://localhost:5173
From the backend directory:
npm run seed
β οΈ The current seed workflow clears existing application collections before inserting demo data. Do not run it against a production database containing important data.
cd backend
npm testcd frontend
npm run buildnpm run previewAdditional Python utilities are provided under:
my_project/
Install dependencies:
cd my_project
python -m pip install -r requirements.txtConfigure environment variables locally:
GEMINI_API_KEY=your-key
MONGO_URI=your-mongodb-uripython download_files_GPM_3IMERGDF_07.py \
--start 2025-08-31T00:00:00.000Z \
--end 2025-09-30T23:59:59.000Z \
--bbox 91.55,25.95,91.9,26.3 \
--output-dir ./GPM_3IMERGDF_07 \
--workers 5The platform is designed around the following engineering targets:
| Metric | Target |
|---|---|
| API response | <100 ms for typical cached/simple requests |
| Database query | <50 ms for indexed operations |
| Alert processing | Near-real-time |
| Dashboard refresh | ~30 seconds |
| Frontend bundle | Optimized through code splitting |
| Availability | Dependent on production infrastructure |
Actual performance depends on infrastructure, database configuration, network conditions, traffic, and external APIs.
The Vite frontend can be deployed to:
- Vercel
- Netlify
- Static hosting / CDN
Build:
cd frontend
npm run buildOutput:
frontend/dist/
Production API configuration:
VITE_API_URL=https://your-backend-domain/apiThe Express backend requires a Node.js-compatible hosting provider.
Production environment example:
NODE_ENV=production
PORT=5000
MONGO_URI=mongodb+srv://...
JWT_SECRET=strong-random-production-secret
JWT_EXPIRES_IN=7d
CLIENT_URL=https://your-frontend-domain
SMTP_HOST=...
SMTP_PORT=...
SMTP_USER=...
SMTP_PASSWORD=...
SMTP_FROM=...For production deployment:
- Create a MongoDB Atlas cluster.
- Create a database user.
- Configure network access.
- Create the database connection string.
- Set the connection string in
MONGO_URI.
Example:
MONGO_URI=mongodb+srv://USERNAME:PASSWORD@CLUSTER.mongodb.net/disaster_managementNever expose database credentials in frontend code.
Before exposing HillGuard publicly:
[ ] Remove or disable demo credentials
[ ] Generate a strong random JWT_SECRET
[ ] Configure MongoDB Atlas securely
[ ] Restrict CORS origins
[ ] Enforce HTTPS
[ ] Configure SMTP securely
[ ] Never commit .env files
[ ] Rotate any exposed credentials
[ ] Enable production rate limiting
[ ] Validate API inputs
[ ] Review authorization on every protected endpoint
[ ] Disable development reset-link responses
[ ] Configure secure logging
[ ] Review MongoDB indexes
[ ] Test password recovery
[ ] Test expired JWT handling
[ ] Test unauthorized API access
[ ] Test admin authorization
Keep credentials in local environment files or your hosting provider's secret/environment-variable manager:
.env
.env.local
.env.production
Use .env.example files only for safe placeholders.
User
β
βΌ
Login
β
βΌ
Credentials
β
βΌ
bcrypt Verification
β
βΌ
JWT Issued
β
βΌ
Protected API
Forgot Password
β
βΌ
Random Token
β
βΌ
SHA-256 Hash
β
βΌ
Database
β
βΌ
Expiring Reset Link
β
βΌ
Password Reset
β
βΌ
Token Invalidated
- Refresh-token rotation
- HttpOnly secure cookies
- CSRF protection where cookie authentication is used
- MFA
- Audit-log integrity controls
- Security event monitoring
- Strong password policy
- Account lockout / risk-based authentication
- API schema validation
- Automated dependency scanning
- SAST / DAST in CI/CD
Recommended Git workflow:
git checkout -b feature/<feature-name>
git add .
git commit -m "feat: add <feature>"
git push origin feature/<feature-name>Then open a Pull Request.
| Prefix | Usage |
|---|---|
feat: |
New functionality |
fix: |
Bug correction |
refactor: |
Code restructuring |
docs: |
Documentation |
style: |
UI / formatting |
test: |
Tests |
security: |
Security improvement |
perf: |
Performance improvement |
- Production authentication architecture
- Advanced RBAC
- Audit logging
- API validation
- Automated testing
- CI/CD security checks
- Improved ML models
- Model evaluation pipeline
- Feature-importance visualization
- Prediction-confidence calibration
- Model-version registry
- Continuous model monitoring
- MQTT integration
- Device authentication
- Sensor heartbeat monitoring
- Offline sensor detection
- Telemetry anomaly detection
- Real-time streaming
- Advanced hazard polygons
- Evacuation-route analysis
- Shelter proximity analysis
- Population exposure estimation
- Terrain / elevation integration
- Satellite-data integration
- Multi-agency coordination
- Resource tracking
- Incident-command workflows
- Automated SITREP generation
- Notification-provider integration
- Offline emergency mode
HillGuard is built around a human-in-the-loop disaster intelligence model.
SENSE
β
Collect environmental information
FUSE
β
Combine telemetry + weather + historical context
PREDICT
β
Estimate hazard risk
ALERT
β
Generate actionable warnings
RESPOND
β
Coordinate emergency resources
LEARN
β
Analyze historical incidents and improve models
Operational clarity
Present complex environmental information in a form that operators can interpret quickly.
Multi-source intelligence
Combine telemetry, weather, historical data, and geospatial context rather than relying on one signal.
Security by design
Treat authentication, authorization, secret management, input validation, and API protection as first-class concerns.
Human oversight
Use automation to support decisions, while keeping final operational authority with responsible human teams.
Additional project documentation includes:
OPERATOR_MANUAL.mdARCHITECTURE.mdSETUP.mdDEPLOYMENT.mdPROJECT_SUMMARY.mdBUILD_VERIFICATION.mdCOMPLETION_CHECKLIST.mdHillGuard_Official_4_Page_Summary.md
| Field | Details |
|---|---|
| Project | HillGuard |
| Category | Disaster Management / Software |
| Focus | Flash Flood & Landslide Early Warning |
| Architecture | MERN + AI + IoT + GIS |
| Development Model | Full-stack web application |
| Repository | ROHIT3470/Disaster-Management |
This project is licensed under the MIT License.
See LICENSE for details.
HillGuard is a software research/development project intended for disaster-management intelligence, simulation, education, and decision-support purposes.
Risk predictions, simulations, alerts, and AI-generated recommendations must not be treated as a substitute for:
- Official government warnings
- Trained emergency personnel
- Hydrological / geotechnical assessments
- Established emergency-response protocols
For real-world emergencies, follow instructions from the relevant official emergency-management authorities.