How devsansure/oose_project_aqi works
Canada AQI Map collects Canadian air-quality readings, calculates AQI, stores current conditions and history, and serves map, city, search, source-status, and admin data to a browser interface. The collector is orchestrated by the scheduler; the web API reads through a facade and repository. Source excerpts support the backend call paths. The frontend files are listed as read, but their contents were not provided, so frontend wiring is left unverified.
Main entry points: scheduler.py Data scheduler · main.js Interface controller · openmeteo_source.py Open-Meteo source · repository.py City repository
Components 21
Collection and AQI
- Data scheduler
backend/aqi/scheduler.py - City seed data
backend/aqi/models.py - OpenAQ source
backend/aqi/sources/openaq_source.py - Open-Meteo source
backend/aqi/sources/openmeteo_source.py - Source validation
backend/aqi/sources/base.py - AQI calculator
backend/aqi/aqi_calculator.py - City and readings
backend/aqi/models.py
Persistence
- City repository
backend/aqi/repository.py - AQI database
backend/aqi/repository.py - Repository factory
backend/aqi/db.py
API and interface
- Flask API
backend/app.py - Air quality facade
backend/aqi/facade.py - Interface controller
public/js/main.js - Map view
public/js/MapView.js - City details popup
public/js/CityPopup.js - API client
public/js/api.js - Theme controls
public/js/theme.js
External services
- OpenAQ API
- Open-Meteo API
Other components
- Collector operator
- Map user
Connections 24
- Collector operator → Data scheduler: runs collection
backend/aqi/scheduler.py - Data scheduler → City repository: prepares and saves
backend/aqi/scheduler.py - Data scheduler → City seed data: loads cities
backend/aqi/scheduler.py - Data scheduler → OpenAQ source: collects readings
backend/aqi/scheduler.py - Data scheduler → Open-Meteo source: collects readings
backend/aqi/scheduler.py - Data scheduler → Open-Meteo source: fetches history
backend/aqi/scheduler.py - Data scheduler → AQI calculator: evaluates readings
backend/aqi/scheduler.py - Data scheduler → City and readings: uses city readings
backend/aqi/scheduler.py - OpenAQ source → OpenAQ API: requests station data
backend/aqi/sources/openaq_source.py - Open-Meteo source → Open-Meteo API: requests air data
backend/aqi/sources/openmeteo_source.py - OpenAQ source → Source validation: uses HTTP helper
backend/aqi/sources/openaq_source.py - Open-Meteo source → Source validation: uses HTTP helper
backend/aqi/sources/openmeteo_source.py - Repository factory → City repository: builds repository
backend/aqi/db.py - City repository → AQI database: reads and writes
backend/aqi/repository.py - Flask API → Air quality facade: routes data requests
backend/app.py - Flask API → Repository factory: creates repository
backend/app.py - Air quality facade → City repository: queries and updates
backend/aqi/facade.py - Air quality facade → AQI calculator: formats AQI colours
backend/aqi/facade.py - Map user → Interface controller: uses map interface
- Interface controller → API client: requests API data
- API client → Flask API: calls API
- Interface controller → Map view: presents map
- Interface controller → City details popup: shows city details
- Interface controller → Theme controls: controls appearance