All work

01 / 03

Hour-by-hour air quality for 20 African cities, read against the WHO guidelines and laid out like a flight briefing.

Role
Design and build (solo project)
Year
2026
Type
Dashboard
Stack
Next.js / TypeScript / TanStack Query / Tailwind CSS / Zustand / Recharts / Playwright
Harmattan preview

The problem

Most of the air-quality tools I found are built around Europe, North America or Asia. African cities show up, if at all, as a few more rows in a global list. I wanted one place to see how the air in Lagos, Kano, Nairobi or Cairo is doing hour by hour, and how far it sits from what the World Health Organization recommends.

The name comes from the harmattan, the dry-season wind that carries Saharan dust across West Africa.

The other half of the problem was honesty. I trained in a science lab before I wrote code, and a figure without its method and its limits makes me uneasy. The data that covers the whole continent is a model's estimate on a grid of about 45 km, not a reading from a sensor on the ground. A dashboard that hides that looks more precise than it is.

My role

This is a solo project. I chose the data source and the stack, set the design direction, and took it through four screens, tests and deployment:

  • Overview ranks the 20 cities by fine particles (PM2.5) over the last 24 hours, beside a map of the continent with the wind at each city.
  • City charts any of seven pollutants over 24 hours to 90 days, with a weekday-by-hour heatmap and a daily table.
  • Compare puts up to four cities on one chart.
  • Data lists every hourly reading in a table that can be sorted, filtered and downloaded as CSV.

The Lagos page: the latest mean for each of seven pollutants, marked as within or above its WHO guideline.

Constraints

  • Open data, no server of my own. The figures come from Open-Meteo's free air-quality API, which needs no key. The browser asks for the data directly, so there is nothing secret to protect and nothing to keep running.
  • Twenty cities means twenty requests. Any of them can be slow or fail, at any time.
  • A lot of rows. Ninety days of hourly readings for every city is 43,200 rows in one table.
  • It has to work for everyone. Keyboard only, light or dark, and with motion switched off for people who ask their device for that.

Key decisions

A briefing, not a dashboard

Most dashboards look alike: rounded cards, soft shadows, a sidebar. I designed this one as the briefing board from a flight game instead. Olive drab, khaki and gunmetal, with amber kept for warnings. Stencil lettering, figures that turn over like a departures board, and a tactical map with range rings and the wind on a compass tape.

A flight briefing has the same job as this page: tell someone the conditions, quickly.

The look is strict about motion. There is one start-up screen, numbers settle once, and section headings draw in as you reach them. All of it is off under reduced motion. Even the dropdowns are my own, because a native one broke the look, so I gave them full keyboard support: arrow keys, Home and End, type to search, Escape to close.

Every city on its own

Each city is its own request through TanStack Query, cached for 15 minutes. A timeout or a server error is retried up to three times, waiting longer each time. A request the source rejects is not retried, because asking again won't change the answer. If one city fails, it says so in its own row with a way to try again, and the other nineteen carry on. The map and the ranking still work when the wind can't be loaded.

Say what the numbers are

The page states that its figures are modelled, where they come from and how coarse the grid is. Each pollutant is averaged over the window its guideline is written for: 24 hours for most, 8 hours for ozone. The coloured bands are multiples of the WHO guideline that I chose for this dashboard, and the page says they are not an official index. Desert dust has no WHO guideline, so it gets a figure and no verdict.

Only build what's on screen

The data table draws only the rows in view, so 43,200 rows scroll like forty. The charting code loads when a chart is about to appear, not with the first page.

The data screen: 3,360 hourly readings, one per city per hour for the last seven days, ready to sort or download.

What went wrong

The start-up screen kept people waiting. My first version lifted the screen once the page's script had finished loading. On a slowed-down phone that took over five seconds, and the headline stayed hidden the whole time. I moved the timing into a few lines that run before anything else, so the screen lifts on time however much is still loading, and the page is already painted underneath it. Later I cut the screen itself from 2.4 seconds to 1.6.

That fix made one number misleading. Lighthouse now reports the main content as painted in about a second, because it is, under the start-up screen. A visitor sees it at 1.6 seconds. That is the figure I'd quote, and Lighthouse's speed index marks the page down for it, which is fair. The start-up screen is a cost I chose, and any key or tap skips it.

Forty-five clocks. Every split-flap figure ran its own timer, and the overview has about forty-five of them. Together they blocked the page while they turned. Now they share one clock.

Results

  • Live, with 20 cities in 17 countries, seven pollutants, and ranges from 24 hours to 90 days.
  • 56 unit tests and 22 end-to-end tests. Eight of those check each screen for accessibility problems in both the light and dark themes.
  • Lighthouse scores of 100 for accessibility, best practices and SEO on all four screens of the live site.

Compare: Lagos, Accra and Nairobi lined up, each with its latest 24-hour mean of fine particles.

What I'd do next

Put ground-station readings beside the modelled figures wherever a station exists, so you can see how far the model is from the air people are breathing. Then add more cities: twenty is a start, not the continent.