A professional full-stack web application for monitoring, comparing, and forecasting Air Quality Index (AQI) data across Indian cities.
SMOGSLAYER/
├── app.py # Flask entry point
├── config.py # DB + app configuration
├── extensions.py # MySQL connection pool
├── requirements.txt
│
├── routes/
│ ├── auth.py # /login /logout
│ ├── dashboard.py # /dashboard
│ ├── compare.py # /compare
│ └── forecast.py # /forecast
│
├── charts/
│ ├── aqi_chart.py # AQI trend line chart
│ ├── pollutant_chart.py # Radar chart
│ ├── heatmap_chart.py # Seasonal heatmap
│ ├── compare_chart.py # Multi-city comparison
│ └── forecast_chart.py # Forecast chart
│
├── utils/
│ ├── db.py # DB init + helpers
│ └── aqi_helpers.py # Pandas processing + AQI logic
│
├── templates/
│ ├── base.html # Shared layout + navbar
│ ├── login.html
│ ├── dashboard.html
│ ├── compare.html
│ └── forecast.html
│
├── static/
│ └── css/style.css # Full dark-theme stylesheet
│
└── SQL/
└── schema.sql # DB schema + sample data
pip install -r requirements.txtEdit config.py and set your MySQL credentials:
MYSQL_USER = 'root'
MYSQL_PASSWORD = 'your_password'
MYSQL_HOST = 'localhost'
MYSQL_PORT = 3306
MYSQL_DB = 'smogslayer'Or set environment variables:
export MYSQL_USER=root
export MYSQL_PASSWORD=your_passwordpython app.pyOn first run, app.py automatically:
- Creates the
smogslayerdatabase - Runs
SQL/schema.sql(tables + sample data) - Seeds two demo users
http://localhost:5000
| Username | Password |
|---|---|
| admin | password123 |
| demo | demo1234 |
| Feature | Description |
|---|---|
| 🔐 Authentication | Secure login with bcrypt-hashed passwords |
| 📊 Dashboard | AQI trend, pollutant radar, seasonal heatmap |
| ⚖️ Compare | Multi-city AQI comparison with pollution ranking |
| 🔮 Forecast | 7–90 day AQI prediction with confidence band |
| 📅 Date Filter | Filter all views by custom date range |
| 📋 Data Table | Full pollutant breakdown table |
| 📱 Responsive | Mobile-friendly layout |
Delhi · Mumbai · Bangalore · Chennai · Kolkata · Hyderabad
- Backend: Python 3.10+ / Flask 3.0
- Database: MySQL 8.0
- Data Processing: Pandas, NumPy
- Visualization: Plotly
- Frontend: HTML5, CSS3, JavaScript