A full-stack, real-time air quality monitoring web application that provides live AQI (Air Quality Index) data across major cities in India. AERIS combines automated data scraping, secure user authentication, personalized dashboards, and interactive visualizations to help users make informed decisions about outdoor activities and health precautions.
WhatsApp.Video.2026-02-04.at.3.03.51.PM.mp4
Air pollution is a growing concern in urban India, yet most people lack access to:
- Real-time pollution data for their location
- Health recommendations based on current air quality
- Historical trends and predictions
- Interactive visualizations to understand regional variations
AERIS solves this by providing:
β
Live AQI Data β Updated every 20 seconds from WAQI API
β
Automated Scraping β Python-based scraper runs continuously
β
User Authentication β Secure JWT-based login system
β
Personalized Dashboards β Save locations, customize themes, set preferences
β
Interactive Maps β Leaflet.js-powered regional AQI visualization
β
Health Insights β Dynamic advice based on current pollution levels
β
7-Day Predictions β Forecast trends with Chart.js visualizations
WAQI API β Python Scraper β aqi.json β Node.js Server β Frontend β User Dashboard
β β β β β
Live Data Continuous Local File REST API Interactive UI
(20s cycle) Storage Endpoints + Charts
- Location:
AQI_Scraper/scraper.py - Technology: Python 3.x,
requests,python-dotenv - Function:
- Fetches AQI data from WAQI (World Air Quality Index) API
- Scrapes 17 major Indian cities every 20 seconds
- Extracts: AQI, PM2.5, PM10, NOβ, SOβ, Oβ, CO, Temperature
- Saves to
aqi.jsonwith ISO timestamps - Runs as a child process spawned by Node.js server
- Key Features:
- Automatic retry on failure
- Detailed logging to
scraper.log - Rate limiting to respect API quotas
- Location:
server.js+backend/modules - Technology: Node.js (vanilla HTTP, no Express)
- Port: 8000
- Responsibilities:
- Static File Serving β HTML, CSS, JS, images
- REST API β Authentication, user data, preferences, locations
- AQI Data Endpoint β Serves
aqi.jsonto frontend - Scraper Management β Spawns and monitors Python scraper process
- Database Operations β SQLite CRUD via custom modules
- File:
aqi_users.db - Tables:
usersβ User accounts (id, name, email, password_hash, created_at)preferencesβ User settings (theme, units, default city, notifications, etc.)saved_locationsβ Favorite cities per user
- Security: bcrypt password hashing, JWT token authentication
- Main Pages:
index.htmlβ Dashboard with live AQI, weather, insightsauth.htmlβ Login/Registrationaccount.htmlβ User profile and saved locationssettings.htmlβ Preferences configurationmap-section/map.htmlβ Interactive Leaflet.js map
- Key Scripts:
script.jsβ Core AQI display, user authentication, settingssimple-aqi-chart.jsβ Chart.js integration for trendswhat-is-aqi.jsβ Educational content renderingstate.jsβ State-level AQI search and filtering
- Real-Time AQI Display β Live data from 17+ Indian cities
- Automatic Location Detection β Geolocation API finds nearest city
- Fallback Mechanism β Defaults to Muzaffarnagar if geolocation fails
- Dynamic Character Animations β Visual indicators change with AQI levels
- Color-Coded Categories β Good, Moderate, Unhealthy, Hazardous, etc.
- Secure Registration β Email validation, bcrypt password hashing
- JWT-Based Login β 24-hour token expiration
- Session Management β Persistent login across page refreshes
- Profile Management β View account details, creation date
- Logout Functionality β Secure token invalidation
Users can customize:
- Theme β Light, Dark, or System-based
- Temperature Units β Celsius or Fahrenheit
- Default City β Auto-load preferred location
- AQI Scale β US or India standard
- Notifications β Enable/disable alerts with custom thresholds
- Dashboard Widgets β Toggle 24hr forecast, 7-day predictions, health advice
- Add/remove favorite cities
- Quick-switch between saved locations
- Check if location is already saved (prevents duplicates)
- Technology: Leaflet.js
- Features:
- Color-coded markers for AQI levels
- Click markers to view detailed city data
- Zoom/pan controls
- Responsive design for mobile/desktop
- 24-Hour Forecast β Hourly AQI predictions
- 7-Day Trend Graph β Chart.js line charts
- Stacked Bar Charts β Pollutant breakdown (PM2.5, PM10, NOβ, etc.)
- Health Impact Indicators β Visual warnings for sensitive groups
- Dynamic Advice β Changes based on current AQI
- Today's Air Insight Card β Expandable card with:
- Short message (e.g., "Air quality is great today! πβ¨")
- Full explanation
- Professional health recommendations
- Character-Based Feedback β Different images for AQI ranges:
gd_char.pngβ Good (0-50)md_char.pngβ Moderate (51-100)SV_char.pngβ Unhealthy for Sensitive (101-150)haz_char.pngβ Hazardous (151+)
- Mobile-first CSS
- Hamburger menu for small screens
- Touch-friendly UI elements
- Optimized for tablets and desktops
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/auth/register |
Create new user account | β |
| POST | /api/auth/login |
Authenticate user, get JWT token | β |
| POST | /api/auth/logout |
Invalidate session | β |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/user |
Get current user profile | β |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/preferences |
Get user preferences | β |
| PUT | /api/preferences |
Update preferences | β |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/locations |
Get all saved locations | β |
| POST | /api/locations |
Add new location | β |
| DELETE | /api/locations/:id |
Remove location | β |
| GET | /api/location-check/:name |
Check if location is saved | β |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/aqi |
Get latest AQI data for all cities | β |
- HTML5 β Semantic markup
- CSS3 β Custom styling, animations, glassmorphism effects
- JavaScript (ES6+) β Vanilla JS, no frameworks
- Chart.js β Data visualization
- Leaflet.js β Interactive maps
- Font Awesome 6.5 β Icons
- Node.js β Server runtime
- HTTP Module β Custom routing (no Express)
- bcrypt β Password hashing
- jsonwebtoken β JWT authentication
- SQLite3 β Database driver
- Python 3.x β Scraping logic
- requests β HTTP client
- python-dotenv β Environment variable management
- SQLite β Lightweight, file-based database
AERIS/
β
βββ AQI_Scraper/ # Python scraper module
β βββ scraper.py # Main scraper script
β βββ aqi.json # Live AQI data (auto-generated)
β βββ scraper.log # Scraper logs
β βββ .env # WAQI API token (not in repo)
β βββ README.md # Scraper documentation
β
βββ backend/ # Node.js backend modules
β βββ auth.js # Authentication logic
β βββ db.js # Database initialization
β βββ users.js # User CRUD operations
β βββ preferences.js # Preferences management
β βββ locations.js # Saved locations logic
β
βββ map-section/ # Map visualization
β βββ map.html # Full-screen map page
β βββ map.js # Leaflet.js logic
β βββ map.css # Map styling
β βββ preview-card.css # Map preview card
β βββ assets/ # Map icons/images
β
βββ css/ # Stylesheets
β βββ (various CSS files)
β
βββ js/ # JavaScript modules
β βββ (various JS files)
β
βββ index.html # Main dashboard
βββ auth.html # Login/Registration page
βββ account.html # User account page
βββ settings.html # Preferences page
βββ state.html # State-level AQI view
βββ server.js # Node.js server entry point
βββ script.js # Main frontend logic
βββ style.css # Main stylesheet
βββ aqi_users.db # SQLite database
βββ package.json # Node.js dependencies
βββ package-lock.json # Dependency lock file
βββ README.md # This file
- Node.js 14.x or higher (Download)
- Python 3.8 or higher (Download)
- WAQI API Token (Get Free Token)
git clone https://github.com/DepthStrider-x/AERIS
cd AERISnpm installcd AQI_Scraper
pip install requests python-dotenvCreate AQI_Scraper/.env:
WAQI_TOKEN=your_waqi_api_token_here# From project root
node server.jsThe server will:
- Start on
http://localhost:8000 - Automatically spawn the Python scraper
- Begin collecting AQI data every 20 seconds
Open your browser and navigate to:
http://localhost:8000
- Register an Account β Click "Account" β "Signup"
- Login β Use your credentials to access personalized features
- Set Preferences β Go to Settings to customize theme, units, default city
- Save Locations β Add your favorite cities for quick access
- Main Dashboard β Shows AQI for your location (auto-detected or default)
- Click AQI Circle β View detailed pollutant breakdown
- Map View β Click "Map Overview" to see regional data
- Search β Use the search bar to find specific cities/states
| AQI Range | Category | Color | Health Advice |
|---|---|---|---|
| 0-50 | Good | π’ Green | Safe for outdoor activities |
| 51-100 | Moderate | π‘ Yellow | Sensitive groups be cautious |
| 101-150 | Unhealthy (Sensitive) | π Orange | Limit outdoor time |
| 151-200 | Unhealthy | π΄ Red | Avoid outdoor activities |
| 201-300 | Very Unhealthy | π£ Purple | Stay indoors |
| 301+ | Hazardous | π€ Maroon | Emergency conditions |
- Password Hashing β bcrypt with salt rounds (10)
- JWT Tokens β 24-hour expiration, signed with secret key
- SQL Injection Protection β Prepared statements for all queries
- Session Management β Server-side token validation
- CORS Headers β Configured for API security
β οΈ Production Note: ReplaceSECRET_KEYinbackend/auth.jswith an environment variable before deploying.
- API:
https://api.waqi.info/ - Coverage: 17 Indian cities (Delhi, Mumbai, Noida, Lucknow, Muzaffarnagar, etc.)
- Update Frequency: Every 20 seconds
- Data Points: AQI, PM2.5, PM10, NOβ, SOβ, Oβ, CO, Temperature
New Delhi, Mumbai, Dwarka, Agra, Jaipur, Goa, Udaipur, Kochi,
Varanasi, Amritsar, Manali, Noida, Lucknow, Indore, Kanpur, Muzaffarnagar
This project is designed for educational purposes and public awareness.
- β Respects WAQI API rate limits (1-second delay between requests)
- β Uses official API with authentication token
- β Provides proper attribution to data sources
- β Does not redistribute raw API data commercially
Users are responsible for:
- Obtaining their own WAQI API token
- Complying with WAQI's Terms of Service
- Not using scraped data for commercial purposes without permission
- Check:
scraper.logfor error messages - Verify:
.envfile exists with validWAQI_TOKEN - Test: Run
python AQI_Scraper/scraper.pymanually
- Delete:
aqi_users.dbto reset (β οΈ loses all user data) - Check: File permissions on database file
- Change: Port in
server.js(line 14:const PORT = 8000;) - Kill Process:
netstat -ano | findstr :8000(Windows) orlsof -i :8000(Mac/Linux)
- Verify:
AQI_Scraper/aqi.jsonexists and has recent timestamp - Check: Browser console for API errors
- Test:
http://localhost:8000/api/aqidirectly
- Push Notifications β Browser alerts when AQI exceeds threshold
- Historical Data β Store and visualize past AQI trends
- More Cities β Expand to 100+ Indian cities
- Weather Integration β Combine AQI with weather forecasts
- Mobile App β React Native version
- Social Sharing β Share AQI reports on social media
- Air Purifier Recommendations β Based on current AQI
- Multi-Language Support β Hindi, Tamil, Bengali, etc.
Your Name
Full-Stack Developer β’ Environmental Tech Enthusiast
This project is open-source and available under the MIT License.
MIT License
Copyright (c) 2026 Your Name
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
- WAQI β For providing free air quality data API
- Leaflet.js β Open-source mapping library
- Chart.js β Beautiful data visualization
- Font Awesome β Comprehensive icon library
Found a bug? Have a feature request? Want to contribute?
- Issues: GitHub Issues
- Email: your.email@example.com
- Discussions: GitHub Discussions
Made with β€οΈ for cleaner air and healthier communities
β Star this repo if you find it useful!