Mongolia air quality monitoring app

I live in Ulaanbaatar, Mongolia, land of the eternal blue sky where Chinggis Khan used to roam. Except during winter, the blue sky turns to dense pollution over the city that is some of the worst in the world (regularly hits top ten most polluted cities). This pollution is caused by the burning of coal for heat and cooking in the areas surrounding the center of the city that don’t have the same infrastructure services.

The government in May this year decided to ban the burning of raw coal in the city in lieu of “enhanced” coal fuel. They claim this will significantly reduce air pollution. There are many air quality apps out there, but I wanted to make something that could answer one of the most important questions facing the city this year. Is this coal ban working? So I built to compare AQI for various stations around the city to help people discover and answer this question for themselves.

Features (all views have a station and pollutant selector):

  • Yearly view to get an overview. It also highlights AQI after the coal ban.
  • Monthly view that shows AQI ranges and also temperature ranges for two months.
  • Daily view that shows a selected day compared to days that are identified as having similar weather (using a cosine similarity function)

Anvil was used as a front end for this data. Data collection, processing, and cleaning happens on a separate server using a combination of Apache Airflow and Jupyter Notebooks run via Papermill. The data is loaded into a database and pulled by the Anvil app.

The biggest challenge for this project was related to the ETL pipeline for the data. Anvil made the front end development very easy. Even making it available in two languages wasn’t as hard as I expected. A big thank you to the community who are always helpful!


Very nice!

1 Like

I concur! Nice dashboard! :tada:

1 Like

Thanks for sharing, that’s a great application of Anvil!

1 Like

Hi Robert - seems like I am a late comer to this party. The link is broken however … is this still live?


The link is no longer working

I unfortunately took the app down, but I’m happy to share the source code. Here is a clone link:

If there are any keys still in the code they don’t work anymore, so not much to worry about there. If you have specific questions feel free to message me.

Hi @robert - thanks for sharing the link but unfortunately I have encountered an error when trying to run it. I will need to investigate a bit further! Thanks again

It won’t run out of the box since the database credentials and everything has changed. The screenshots tell you most of what it does.