Skip to content

Varaxion/DSN3099

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

52 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Sahay Logo

Sahay

Predictive Disaster Intelligence & Rapid Emergency Response

Advanced hydrological forecasting, rainfall analysis, blood bank locator, emergency guidelines, and incident-reporting simulation for public safety and preparedness.


Version Status License Python Flask TensorFlow scikit-learn


Note

Sahay was originally developed in 2025 as part of the academic curriculum for the EPICS course at VIT Bhopal University. It has now been completely overhauled into a modern, dynamic web application, upgrading its model speed, repository structure, and visual aesthetics to state-of-the-art glassmorphic standards.


πŸ“‘ Table of Contents

Click to Expand/Collapse Table of Contents

🌍 Overview

Sahay is a comprehensive Flask-based disaster resilience platform that fuses machine-learning hydrological intelligence with practical, on-the-ground emergency support utilities. Designed with a stunning dark glassmorphic UI, it provides a unified hub to:

  • Forecast river flood risks
  • Analyze monthly subdivision rainfall patterns
  • Locate life-saving blood banks
  • Access direct-dial emergency helplines
  • Study interactive disaster Standard Operating Procedures (SOPs)
  • Simulate mock incident-reporting for training and demonstrations

(The active v1.0 application is housed inside app/, while the preserved v0 legacy prototype is kept under v0Archive/ to document the project's evolution.)


✨ Core Features

  • Flood Prediction (ARIMA + LDA): Forecasts water-level metrics for major rivers (Cauvery, Godavari, Krishna, Mahanadi, Son) and classifies real-time flood risk using Machine Learning.
  • Rainfall Analysis (1D-CNN + RF): Predicts April-December monthly rainfall for Indian meteorological subdivisions using either a cached Deep Learning CNN or a Random Forest Regressor.
  • Blood Assistance Portal: A lightning-fast, AJAX-powered locator to find local blood bank records by state and city, complete with copy actions, direct dialers, and donor eligibility guidelines.
  • Emergency Contacts: A quick-dial public safety directory for Police, Ambulance, Fire, NDRF, NDMA, and Women Helplines.
  • Interactive Disaster SOPs: Actionable, tabbed do's and don'ts checklists for Floods, Earthquakes, Cyclones, Landslides, Tsunamis, Wildfires, and Thunderstorms.
  • Incident Reporting Simulator: A visually engaging prototype workflow simulating emergency dispatch routing and coordinate generation.

πŸ“Έ Screenshots

Platform Preview

Homepage Landing


Core Features

Flood Forecasting Rainfall Analysis
Flood Prediction Rainfall Prediction
Blood Bank Locator Disaster SOPs
Blood Locator SOPs
Incident Reporting About
Incident About

Click to view all detailed screenshots (Module-wise)

1. Home

  • Homepage Landing
  • Home Features
  • Home End

2. Flood Prediction

  • Flood Landing Input
  • Flood Processing
  • Flood Chart
  • Flood Metrics

3. Rainfall Analysis

  • Rainfall Landing Input
  • Rainfall Processing
  • CNN Chart
  • CNN Metric
  • Random Forest Chart
  • Random Forest Metric

4. Blood Assistance

  • Blood Eligibility Input
  • Blood Eligibility Result
  • Blood Locate Input
  • Blood Locate Result

5. SOPs & Helplines

  • SOP Landing
  • SOP Guideline
  • Emergency Helplines 1
  • Emergency Helplines 2

6. Incident Reporting

  • Incident Landing
  • Incident Input
  • Incident Details
  • Incident Process
  • Incident Output

7. About & System

  • About Landing
  • About Technical
  • About Modules
  • About Team
  • 404 Error

πŸ› οΈ Technology Stack

Layer Technologies Used
Frontend UI HTML5, Jinja2, Vanilla CSS3 (Glassmorphism), Vanilla JavaScript
Backend Framework Python 3.10+, Flask, Werkzeug
Data Processing Pandas, NumPy, openpyxl
Flood Models statsmodels (ARIMA), scikit-learn (LDA), imblearn (SMOTE)
Rainfall Models TensorFlow/Keras (1D-CNN), scikit-learn (Random Forest)
Visualizations Matplotlib (Agg backend) for dynamic dark-mode server charting

πŸ“‚ Project Architecture

πŸ“¦ DSN3099
 ┣ πŸ“‚ screenshots/         # High-resolution UI mockups and dashboards
 ┣ πŸ“‚ v0Archive/           # Legacy v0 source code and conceptual media
 ┣ πŸ“‚ app/                 # Modern Optimized Application (v2.0)
 ┃ ┣ πŸ“‚ core/              # Isolated Machine Learning & pipeline logic
 ┃ ┃ ┣ πŸ“œ hydrology.py     # Flood ARIMA forecasting & LDA classification
 ┃ ┃ β”— πŸ“œ rainfall.py      # CNN / RF rainfall prediction pipelines
 ┃ ┣ πŸ“‚ data/              # Datasets: River workbooks, IMD rainfall, Blood banks
 ┃ ┣ πŸ“‚ static/            # Frontend assets, stylesheets, and visual graphics
 ┃ ┃ ┣ πŸ“‚ css/             # CSS design system (sahay.css)
 ┃ ┃ ┣ πŸ“‚ images/          # Brand graphics and standalone SVGs
 ┃ ┃ β”— πŸ“‚ charts/          # Dynamic chart target outputs (flood.png, rainfall.png)
 ┃ ┣ πŸ“‚ templates/         # Modular camelCase Jinja2 HTML views (base.html, index.html, etc.)
 ┃ ┣ πŸ“‚ trained/           # Serialized model artifacts (.h5, .pkl)
 ┃ ┣ πŸ“œ __init__.py        # Flask app factory & blueprint registration
 ┃ β”— πŸ“œ routes.py          # Core routing, form handling, AJAX endpoints
 ┣ πŸ“œ .env.example         # Environment configuration template
 ┣ πŸ“œ requirements.txt     # Python package dependencies
 ┣ πŸ“œ run.py               # Local WSGI development server entry point
 β”— πŸ“œ README.md            # Project documentation & specifications

βš™οΈ How the System Works

1. Flood Prediction Pipeline

User inputs River & Date βž” hydrology.py reads historical river workbook βž” Generates ARIMA future trend βž” Extracts structural features βž” Passes vector to LinearDiscriminantAnalysis βž” Classifies Normal vs. High Risk βž” Renders Matplotlib chart & metrics table.

2. Rainfall Analysis Pipeline

User inputs Subdivision, Year & Model βž” rainfall.py parses IMD dataset βž” If CNN, loads cached Keras .h5 model (or trains on-the-fly) βž” If RF, trains RandomForestRegressor βž” Predicts April–December mm βž” Calculates MAE & Variance βž” Renders comparative chart.

3. Blood Bank Search

routes.py loads blood_banks_india.csv globally on server start βž” Normalizes strings (Title Case) βž” Exposes /getCities and /searchBloodBanks JSON endpoints βž” Client-side JS fetches and renders results instantly without page reloads.


πŸš€ Getting Started

1. Clone the Repository

git clone https://github.com/Varaxion/DSN3099.git
cd DSN3099

2. Create and Activate a Virtual Environment

Windows:

python -m venv epicsenv
.\epicsenv\Scripts\Activate.ps1

macOS/Linux:

python3 -m venv epicsenv
source epicsenv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

4. Run the Server

python run.py

The Sahay portal will be live at http://127.0.0.1:5000


⚠️ Limitations & Assumptions

  • ARIMA Horizons: Flood forecasting relies on historical moving averages; long-term horizon accuracy decays naturally.
  • LDA Covariance: Flood risk classification assumes equal covariance matrices across normal and high-risk classes.
  • Rainfall Granularity: Both CNN and RF models operate on aggregated monthly subdivision data, not hyperlocal or daily weather metrics.
  • Incident Reporting: The reporting module is strictly a UI prototype/simulation. It does not dispatch or alert real-world NDRF agencies.
  • Medical Data: Blood bank contact numbers and addresses are sourced from open datasets and should be independently verified in a real emergency.

πŸ“š Data Sources

This academic project relies on several historical and open-source datasets to power its machine learning models and locator utilities:

  • Hydrological River Data (Cauvery.xlsx, Godavari.xlsx, etc.): Historical water level and runoff metrics sourced from the Central Water Commission (CWC) and India-WRIS (Water Resources Information System).
  • Subdivision Rainfall Data (imd-rainfall-2021.csv): Historical subdivision-wise monthly rainfall metrics provided by the Indian Meteorological Department (IMD) (frequently hosted on Open Government Data platforms).
  • Blood Bank Directory (blood-banks-india.csv): Nationwide blood bank addresses and contact details aggregated from the Ministry of Health and Family Welfare (e-RaktKosh) and the Open Government Data Platform India (data.gov.in).

πŸ“„ License

This repository is licensed under the MIT License. You are free to use, modify, and distribute this code for your own academic or personal projects.

Warning

Exclusions & Third-Party Licenses:
The MIT License applies only to the original source code. The following assets are strictly excluded:

  1. Datasets: Data files in app/data/ (CWC, IMD, e-RaktKosh) are government property and are included for demonstration purposes only.
  2. Academic Documents: Reports and videos in v0Archive/docs/ are fully copyrighted by the authors and VIT Bhopal University.
  3. Hyperspace Template: The legacy template in v0Archive/hyperspaceTemplate/ is governed by a separate Creative Commons Attribution 3.0 Unported (CCA 3.0) license.

πŸŽ“ Academic Origins & Credits

This repository originated as an academic project for VIT Bhopal University by Team-EPICS348 as part of the EPICS course in 2025. The original conceptual prototype was a collaborative effort by the following team members:

Name Registration No.
Chelsi Patel 22BAI10005
Aditya Nayak 22BAI10424
Rushabh Wagh 22BCE10364
Kavya 22BCE10385
Tejas Pathak 22BCE10853
Simarpreet Singh 22BCE10914
Sneha Mishra 22BCE10932
Pooja 22BCE10984
Ruturaj Bhoite 22BHI10027
Archana Prasad Nair 22BSA10238

Important

v1.0 Overhaul: While the initial data gathering, research support, and legacy model iterations were developed collaboratively by Team-EPICS348, the complete system architectural overhaul, 1D-CNN model cache integration, dynamic dark-mode Matplotlib engine, responsive glassmorphic loaders, Flask app restructuring, repository documentation, and premium v1.0 CSS design system were engineered by Kavya.



Sahay - Advancing predictive intelligence for rapid emergency response.

β€” Re-engineered by Kavya β€”

About

Sahay - A predictive disaster intelligence and rapid emergency response platform. Features ML-driven river flood forecasting (ARIMA), CNN-based rainfall analysis, a lightning-fast blood bank locator, and interactive disaster SOPs. Built for DSN3099 Engineering Project in Community Service @ VIT

Topics

Resources

License

Stars

Watchers

Forks

Contributors