A comprehensive dashboard for tracking and predicting pollution levels and their impact on public health in Atchutapuram, Andhra Pradesh.
- Backend/: Python/Flask API that handles data simulation and health predictions.
- Frontend/: A modern, interactive dashboard built with vanilla JavaScript and CSS.
Follow these steps to run the project locally on your machine.
The backend is a Flask API that serves pollution and hospital data.
Prerequisites:
- Python 3.x installed on your system.
Steps:
- Open your terminal or command prompt.
- Navigate to the
Backenddirectory:cd Project/Backend - Install the required dependencies:
pip install -r requirements.txt
- Start the server:
python app.py
[!NOTE] The backend will run at
http://127.0.0.1:5000.
The frontend is a static web application that communicates with the backend.
Steps:
- Navigate to the
Frontenddirectory:cd Project/Frontend - Open
index.htmlin your browser.- Recommended: For the best experience (and to handle Firebase module imports correctly), use a local web server like Live Server (VS Code extension).
- Alternatively, use Python's built-in server:
Then visit
python -m http.server 8000
http://localhost:8000in your browser.
- Real-time Pollution Tracking: Monitor AQI, PM2.5, PM10, and NO2.
- Health Predictions: View predicted hospital cases for various diseases (COPD, Stroke, etc.) based on pollution levels.
- Interactive Maps: Locate hospitals in Atchutapuram.
- Theme Switching: Seamlessly toggle between Light and Dark modes.
- Data Export: Download data in CSV format.
GET /data: Returns aggregated pollution and prediction data for all hospitals.GET /predict?month=...&year=...&hospital=...: Returns health predictions for a specific location.
You can deploy this project to Render either automatically (using a Blueprint) or manually (setting up separate services).
This is the fastest way to get both services running at once.
- Push your code to GitHub.
- Login to your Render Dashboard.
- Click New + and select Blueprint.
- Connect your GitHub repository.
- Render will automatically use the
render.yamlfile to set up both the Backend and Frontend.
Use this if you want to manage the Backend and Frontend independently.
- Click New + on Render and select Web Service.
- Connect your GitHub repository.
- Set the following configuration:
- Name:
pollution-backend - Root Directory:
Project/Backend - Runtime:
Python 3 - Build Command:
pip install -r requirements.txt - Start Command:
gunicorn app:app
- Name:
- Click Create Web Service.
- Wait for the Backend to deploy, then copy its URL (e.g.,
https://pollution-backend.onrender.com). - Update the
APIconstant inProject/Frontend/script.jswith your backend URL:const API = "https://your-backend-name.onrender.com";
- Commit and push this change to GitHub.
- Click New + on Render and select Static Site.
- Connect your GitHub repository.
- Set the following configuration:
- Name:
pollution-frontend - Root Directory:
Project/Frontend - Build Command: (Leave empty)
- Publish Directory:
.
- Name:
- Click Create Static Site.