This project provides real-time monitoring of Air Quality Index (AQI), Water Quality Index (WQI), weather conditions, and disaster management. It utilizes multiple APIs to fetch real-time data, helping users stay informed and take preventive measures during environmental hazards.
- Real-time AQI & WQI Data 📊
- Live Weather Updates ⛅
- Disaster Management Alerts
⚠️ - Preventive Measures & Awareness System 🏥
- Database Storage for Historical Analysis 📜
- FastAPI for Efficient API Management ⚡
- FastAPI - Web framework
- MySQL - Database for storing AQI & WQI data
- Requests - Fetching real-time data
- OpenWeather API - AQI, Weather, and Disaster Alerts
- Clone the repository:
git clone https://github.com/itz-Mayank/NILAYAN.git
- Install dependencies:
pip install -r requirements.txt
- Set up MySQL Database:
CREATE DATABASE environment_db; CREATE TABLE aqi_data ( id INT AUTO_INCREMENT PRIMARY KEY, city VARCHAR(100), aqi FLOAT, timestamp DATETIME ); CREATE TABLE wqi_data ( id INT AUTO_INCREMENT PRIMARY KEY, location VARCHAR(100), wqi FLOAT, timestamp DATETIME );
- Run the Flask on local server:
Flask run
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Root endpoint |
GET |
/get_aqi/{city} |
Fetch real-time AQI of a city |
GET |
/get_wqi/{location} |
Fetch real-time WQI of a location |
GET |
/weather/{city} |
Fetch real-time weather conditions |
GET |
/disaster_alerts/{city} |
Get disaster alerts for a city |
POST |
/store_aqi |
Store AQI data in MySQL |
POST |
/store_wqi |
Store WQI data in MySQL |
- Live Disaster Alerts: Alerts based on weather API.
- Emergency Protocols: Steps to take in case of extreme weather or pollution levels.
- Public Awareness & Prevention: Information on health hazards and protective measures.
- 📍 Interactive Map: Display AQI & WQI visually.
- 📡 IoT Integration: Real-time sensor data for better accuracy.
- 📊 Predictive Analysis: AI-powered forecasting of AQI & disasters.
🌱 Stay Safe, Stay Aware! 🌱