Skip to content

Karinateii/DisasterManagementSystem

Repository files navigation

🌍 Global Disaster Management System (GDMS)

.NET License SQL Server Docker

A comprehensive disaster management and emergency response platform supporting multiple disaster types (floods, earthquakes, fires, hurricanes, tsunamis). Built with ASP.NET Core 8.0, ML.NET, SignalR for real-time communications, and IoT sensor integration.

πŸŽ“ Academic Project

Institution: Babcock University
Course: Computer Science Final Year Project
Academic Year: 2023
Status: In Development


✨ Key Features

🚨 Multi-Disaster Emergency Response

  • Multi-disaster support: floods, earthquakes, fires, hurricanes, tsunamis, landslides
  • Real-time alerts: SignalR-powered instant notifications
  • Incident reporting: Citizen reports with photo uploads and GPS geolocation
  • Emergency shelter management: Real-time capacity tracking, check-in/check-out system
  • Interactive dashboards: Admin and citizen views with live data
  • Evacuation planning: Dynamic route planning based on current conditions

πŸ“± Multi-Channel Communication System

  • SMS Notifications - Bulk SMS via Twilio for mass emergency alerts
  • USSD Gateway - Feature phone support for offline/low-connectivity areas
  • WhatsApp Integration - Rich media messages via Twilio Business API
  • Voice/IVR System - Automated multilingual voice calls for critical alerts
  • Push Notifications - Firebase Cloud Messaging for mobile apps
  • Multi-Language Support - 8 languages: English, French, Arabic, Spanish, Portuguese, Hausa, Yoruba, Igbo

🌐 IoT Real-Time Monitoring

  • Water level sensors: Live flood monitoring with threshold alerts
  • Rainfall tracking: Intensity measurement and forecasting
  • Weather stations: Temperature, humidity, wind speed, pressure
  • Real-time dashboards: Chart.js visualizations with SignalR updates
  • Historical data: Time-series analysis and trend detection
  • REST API: Sensor data ingestion endpoints

πŸ€– Machine Learning & Predictions

  • ML.NET integration: Fast Tree binary classifier for flood risk prediction
  • Historical analysis: Pattern detection from past disaster data
  • Risk scoring: Automated threat level assessment
  • Alert automation: Threshold-based notifications
  • Weather forecasting: Integration with external weather APIs

🏒 Shelter Management System

  • Shelter registration: Comprehensive facility information
  • Capacity tracking: Real-time occupancy monitoring
  • Check-in/Check-out: Individual and family tracking
  • Occupant management: View and manage current residents
  • Facility details: Amenities, contact info, accessibility features
  • Geographic mapping: Location-based shelter search

πŸ› οΈ Technology Stack

Backend

  • Framework: ASP.NET Core 8.0 MVC
  • Database: SQL Server 2022 with Entity Framework Core 8.0
  • Machine Learning: ML.NET 3.0 (Fast Tree Classifier)
  • Real-time: SignalR for live updates
  • Logging: Serilog with file and console sinks
  • Authentication: ASP.NET Core Identity with role-based authorization

Communication Services

  • SMS/WhatsApp/Voice: Twilio API integration
  • Push Notifications: Firebase Cloud Messaging (FCM)
  • Email: SMTP with MailKit

Frontend

  • UI Framework: Bootstrap 5.3
  • Charts: Chart.js 4.4 for data visualization
  • Maps: Leaflet.js for geographic features
  • Real-time Client: SignalR JavaScript client
  • Icons: Font Awesome 6

DevOps & Testing

  • Containerization: Docker & Docker Compose
  • CI/CD: GitHub Actions
  • Testing: xUnit for unit tests
  • API Documentation: Swagger/OpenAPI 3.0

πŸ“Š Current Implementation Status

βœ… Completed Features

  • Core disaster management system (multiple disaster types)
  • User authentication and authorization (admin/citizen roles)
  • Incident reporting with photo upload and GPS
  • Emergency shelter management with check-in/check-out
  • SMS notification system via Twilio
  • USSD interactive menus
  • WhatsApp Business API integration
  • Voice/IVR system with multilingual support
  • Push notification infrastructure (Firebase)
  • IoT sensor monitoring (water level, rainfall, weather)
  • Real-time dashboards with SignalR
  • Multi-language support (8 languages)
  • ML-based flood prediction system
  • REST API with Swagger documentation
  • Admin dashboard with analytics

🚧 In Progress

  • Mobile applications (iOS/Android)
  • Advanced analytics dashboard
  • Evacuation route optimization
  • Extended ML model training

πŸ“… Planned

  • Community engagement features
  • Volunteer coordination system
  • Resource allocation optimization
  • Integration with government emergency systems

πŸš€ Quick Start

Prerequisites

Local Development Setup

# 1. Clone the repository
git clone https://github.com/Karinateii/FloodManagementSystem.git
cd FloodManagementSystem

# 2. Update database connection string in appsettings.json
# Edit: FloodManagementSystem/appsettings.json
# Update: ConnectionStrings:DefaultConnection

# 3. Configure external services (optional but recommended)
# Update appsettings.json with your keys:
#   - Twilio (SMS/WhatsApp/Voice)
#   - Firebase (Push notifications)
#   - SMTP (Email)

# 4. Restore dependencies
dotnet restore

# 5. Apply database migrations
cd FloodManagementSystem
dotnet ef database update

# 6. Run the application
dotnet run

# Access the application at:
# - Web: https://localhost:5001 or http://localhost:5293
# - API Docs: https://localhost:5001/api/docs

Docker Setup

# Build and run with Docker Compose
docker-compose up -d

# Access at: http://localhost:8080
# Swagger: http://localhost:8080/api/docs

# View logs
docker-compose logs -f

# Stop containers
docker-compose down

Default Admin Credentials

Email: admin@gdms.com
Password: Admin@123

⚠️ Important: Change default admin password on first login!


πŸ“š API Documentation

The system exposes RESTful APIs for external integrations:

IoT Sensor Endpoints

POST   /api/IoTSensor/{type}/register        # Register new sensor
POST   /api/IoTSensor/{deviceId}/{type}      # Submit sensor reading
GET    /api/IoTSensor/{sensorId}/latest      # Get latest reading
GET    /api/IoTSensor/{sensorId}/history     # Historical data
GET    /api/IoTSensor/active                 # List active sensors

Communication APIs

POST   /api/Sms/send                         # Send SMS
POST   /api/Sms/send-bulk                    # Bulk SMS
POST   /api/WhatsApp/send                    # WhatsApp message
POST   /api/Voice/call                       # Voice call
POST   /api/Push/send                        # Push notification

Emergency Management

GET    /api/Incidents                        # List incidents
POST   /api/Incidents                        # Report incident
GET    /api/Incidents/{id}                   # Incident details
PUT    /api/Incidents/{id}                   # Update incident
GET    /api/Shelters                         # List shelters
GET    /api/Shelters/nearby                  # Find nearby shelters
POST   /api/Shelters                         # Create shelter (admin)
GET    /api/Predictions/flood-risk/{cityId}  # Flood risk prediction

SignalR Hubs (WebSocket)

  • DisasterAlertHub - Real-time disaster alerts and notifications
  • IoTMonitoringHub - Live sensor data streaming

Full API Documentation: Access Swagger UI at /api/docs when running the application.


πŸ›οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        Presentation Layer                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚  β”‚  MVC Views   β”‚  β”‚  REST API    β”‚  β”‚  SignalR     β”‚     β”‚
β”‚  β”‚  (Razor)     β”‚  β”‚  (JSON)      β”‚  β”‚  (WebSocket) β”‚     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      Application Layer                       β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚              Controllers (30+)                        β”‚  β”‚
β”‚  β”‚  Admin β€’ Incidents β€’ Shelters β€’ IoT β€’ Analytics      β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚              Services (15+)                           β”‚  β”‚
β”‚  β”‚  Incident β€’ Shelter β€’ IoT β€’ SMS β€’ ML β€’ Analytics     β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         Data Layer                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚       Repositories (Repository Pattern)               β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚       Entity Framework Core (ORM)                     β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚       SQL Server Database                             β”‚  β”‚
β”‚  β”‚  50+ Tables β€’ Migrations β€’ Stored Procedures          β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    External Integrations                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Twilio  β”‚  β”‚ Firebase β”‚  β”‚  ML.NET  β”‚  β”‚   IoT    β”‚  β”‚
β”‚  β”‚ SMS/Voiceβ”‚  β”‚   FCM    β”‚  β”‚ Predict  β”‚  β”‚ Sensors  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Design Patterns

  • MVC Pattern: Separation of concerns (Model-View-Controller)
  • Repository Pattern: Data access abstraction
  • Dependency Injection: Loose coupling and testability
  • Service Layer: Business logic encapsulation
  • Unit of Work: Transaction management

πŸ—‚οΈ Project Structure

FloodManagementSystem/
β”œβ”€β”€ Controllers/              # MVC & API Controllers (30+)
β”‚   β”œβ”€β”€ AdminController.cs
β”‚   β”œβ”€β”€ IncidentController.cs
β”‚   β”œβ”€β”€ ShelterController.cs
β”‚   β”œβ”€β”€ IoTMonitoringController.cs
β”‚   └── API/                  # REST API Controllers
β”œβ”€β”€ Models/                   # Data models and entities (50+)
β”‚   β”œβ”€β”€ Incident.cs
β”‚   β”œβ”€β”€ EmergencyShelter.cs
β”‚   β”œβ”€β”€ IoTSensorReading.cs
β”‚   └── DTO/                  # Data transfer objects
β”œβ”€β”€ Views/                    # Razor views
β”‚   β”œβ”€β”€ Incident/
β”‚   β”œβ”€β”€ Shelter/
β”‚   β”œβ”€β”€ Admin/
β”‚   └── Shared/
β”œβ”€β”€ Services/                 # Business logic
β”‚   β”œβ”€β”€ Interfaces/
β”‚   └── Implementations/
β”œβ”€β”€ Repositories/             # Data access
β”‚   β”œβ”€β”€ Interfaces/
β”‚   └── Implementations/
β”œβ”€β”€ Data/                     # EF Core context & migrations
β”‚   β”œβ”€β”€ DisasterDbContext.cs
β”‚   β”œβ”€β”€ Migrations/
β”‚   └── Seeders/
β”œβ”€β”€ Hubs/                     # SignalR hubs
β”‚   β”œβ”€β”€ DisasterAlertHub.cs
β”‚   └── IoTMonitoringHub.cs
β”œβ”€β”€ Resources/                # Multi-language resources
β”‚   β”œβ”€β”€ SharedResource.en.resx
β”‚   β”œβ”€β”€ SharedResource.fr.resx
β”‚   └── ... (8 languages)
β”œβ”€β”€ wwwroot/                  # Static files
β”‚   β”œβ”€β”€ css/
β”‚   β”œβ”€β”€ js/
β”‚   └── uploads/
└── appsettings.json          # Configuration

FloodManagementSystem.Tests/  # Unit tests
β”œβ”€β”€ Controllers/
β”œβ”€β”€ Services/
└── Repositories/

docs/                         # Documentation
β”œβ”€β”€ progress/                 # Development progress logs
β”‚   β”œβ”€β”€ PHASE_4_MOBILE_APPS_PROGRESS.md
β”‚   └── PHASE_5_ANALYTICS_COMPLETE.md
β”œβ”€β”€ DEPLOYMENT.md             # Deployment guide
└── QUICK_START.md            # Quick start guide

πŸ§ͺ Testing

The project includes a comprehensive test suite using xUnit:

# Run all tests
cd FloodManagementSystem.Tests
dotnet test

# Run tests with coverage
dotnet test /p:CollectCoverage=true /p:CoverageReportFormat=cobertura

# Run specific test class
dotnet test --filter "FullyQualifiedName~ShelterControllerTests"

Test Coverage

  • Controllers: Unit tests for all major controllers
  • Services: Business logic validation
  • Repositories: Data access tests
  • Integration: End-to-end API tests

🐳 Docker Deployment

Using Docker Compose (Recommended)

# Start all services
docker-compose up -d

# View logs
docker-compose logs -f app

# Stop services
docker-compose down

# Rebuild after changes
docker-compose up -d --build

Manual Docker Build

# Build image
docker build -t gdms:latest .

# Run container
docker run -d -p 8080:8080 \
  -e ConnectionStrings__DefaultConnection="your-connection-string" \
  gdms:latest

πŸ“– Additional Documentation


🀝 Contributing

This is an academic project. Contributions, suggestions, and feedback are welcome!

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • Babcock University - Computer Science Department
  • Project Supervisor - [Supervisor Name]
  • Twilio - Communication APIs
  • Firebase - Push notification infrastructure
  • Microsoft - .NET platform and Azure services
  • Open Source Community - Various libraries and tools

πŸ“ž Contact

Project Team: Babcock University Computer Science Department
Institution: Babcock University, Ilishan-Remo, Ogun State, Nigeria
Academic Year: 2023

Repository: https://github.com/Karinateii/FloodManagementSystem


πŸ“Š Project Statistics

  • Lines of Code: ~50,000+
  • Controllers: 30+
  • Models: 50+
  • Services: 15+
  • Database Tables: 50+
  • API Endpoints: 100+
  • Supported Languages: 8
  • Test Coverage: Growing

Built by Ebenezer

About

Multi-disaster management system with IoT monitoring, emergency response & real-time alerts

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors