https://github.com/afranche7/airpollutiontracker
A Celery backend application using Redis as a broker to periodically fetch air quality data (AQI and pollutant concentrations) from the OpenWeatherMap API for specified coordinates. The data is stored as time series in Redis and visualized on a Grafana dashboard via Prometheus.
https://github.com/afranche7/airpollutiontracker
celery celery-redis celery-task celerybeat docker docker-compose grafana grafana-dashboard prometheus prometheus-client prometheus-metrics python redis redis-cache redistimeseries
Last synced: 9 months ago
JSON representation
A Celery backend application using Redis as a broker to periodically fetch air quality data (AQI and pollutant concentrations) from the OpenWeatherMap API for specified coordinates. The data is stored as time series in Redis and visualized on a Grafana dashboard via Prometheus.
- Host: GitHub
- URL: https://github.com/afranche7/airpollutiontracker
- Owner: afranche7
- License: mit
- Created: 2024-12-27T20:26:20.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-07T04:16:00.000Z (about 1 year ago)
- Last Synced: 2025-04-30T05:04:08.830Z (9 months ago)
- Topics: celery, celery-redis, celery-task, celerybeat, docker, docker-compose, grafana, grafana-dashboard, prometheus, prometheus-client, prometheus-metrics, python, redis, redis-cache, redistimeseries
- Language: Python
- Homepage:
- Size: 32.2 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Air Pollution Tracker
# Overview
Celery backend application, using Redis as a broker, that will periodically fetch the current air quality (index and concentrations of pollutants) from the
openweathermap API at specified latitude and longitude.
After fetching the pollution data, it is then stored as time series data in the same Redis instance used by Celery.
The time series data from Redis is then displayed in a Grafana dashboard using Prometheus as a data source.

## How to get started
1. Create account and get API key from https://openweathermap.org/ (verify email and there might be a short delay for API key to become active)
2. Create .env file in the root of the project with variables LATITUDE, LONGITUDE, API_KEY, INTERVAL_IN_SECONDS
```
LATITUDE=40.7128
LONGITUDE=-74.0060
API_KEY=
INTERVAL_IN_SECONDS=10
```
3. Optionally you can add to .env file variables FROM_EMAIL, FROM_PASSWORD, TO_EMAIL to create email alerts for air quality index above 4 using smtp.gmail.com
4. 'Run docker-compose build' command in the root of the project
5. 'Run docker-compose up' command in the root of the project
6. Navigate to http://localhost:3000/ to consult the Grafana dashboard.
- Username and password are 'admin'
- Skip change password step
- Navigate to Air Pollution Tracker under dashboards section
## OpenWeather Pollution API Documentation
https://openweathermap.org/api/air-pollution