← All projects

Air Clear — Air-Quality Outlook for Schools

A live service that tells Delhi NCR schools, station by station, whether outdoor practice is a good idea today and over the next five days.

Python / Apache Airflow / PostgreSQL + TimescaleDB / FastAPI / Docker / TypeScript / React

Problem

A school deciding on outdoor practice has one current AQI number to go on: nothing station-level for the days ahead, and public feeds that go silent without saying so.

Approach

Hourly ingestion from three sources into TimescaleDB, orchestrated by nine Airflow DAGs. Each of the next five days is graded on the official CPCB scale and served by a FastAPI API to a React dashboard, with a watchdog, tested backups and a nightly evaluation behind it.

Trade-off

Served a simple statistical rule instead of the gradient-boosted models I had already built. In block-holdout backtests no model beat "the next days look like the last 24 hours", so I kept the option that was as accurate, better calibrated and unable to learn a sensor fault.

What broke / what I'd change

A sensor reading of 2.9 million µg/m³ became a training label and the API served a forecast of 8,243. I now look at the extremes of every new data source before anything is computed from it.

Result

Live for about 80 stations. In backtests the grade is exactly right on about 6 in 10 days for tomorrow, and a missing forecast is never shown as "go".

Live dashboard ↗