About

sprout · Oct 7, 2026 · 6 min read

OhAlam, knowing the air is safe

Live at: app.oh-alam.my

Source: alam-api · alam-dashboard

How it started

Haze from fires across the region used to drift over Malaysia, and earthquake tremors in the region kept coming up in the news. Every time that happened, I found myself hopping between several websites just to answer one simple question: is it safe to go out right now? Air quality sat on one government site, the weather on another, the earthquake feed on a third, the flood warnings on a fourth. I kept wishing there was a single calm answer, something I could open on any phone, tablet, or computer. That is why I built OhAlam.

What it does

It is a website at app.oh-alam.my. Pick a town and it shows you, in one place:

It works in English or Bahasa Malaysia, in light or dark mode, and stays usable offline after your first visit. When you want to warn your family about haze or a flood, there is a one-tap share card, a tidy image you can send in a chat.

Where the data comes from

I create none of it. OhAlam gathers pieces that public services already publish, cleans them into one consistent shape, and serves them from one place:

What Source
Air quality Malaysia's own monitoring (DOE / APIMS) [1]
Weather and forecast Open-Meteo [2]
Earthquakes USGS [3]
Official forecasts and warnings MET Malaysia [4]
Flood and rain alerts InfoBanjir [5]
El Niño and La Niña phase NOAA [6]
Hazard news Malaysian news feeds

How it stays fresh and free

A quiet background job checks the sources every few minutes and saves anything new. It follows two simple rules: it only adds, and it never writes the same reading twice. Adding keeps a history you can look back on; not repeating keeps the running cost at zero, because the whole thing lives on free tiers (Cloudflare for the serverless code, GitHub Actions for the timer). No server of mine, nothing hosted on my computer.

How a town loads

The screen asks for one small summary for the town you are looking at, not the whole country. In one line, the data moves like this:

public sources → my tidy database → one simple API → your browser → you

A small rule keeps it honest: latest wins. If a slow, old reply arrives late, it can never overwrite a newer one, so you always see the freshest reading.

A quick tour of the app

The app has five screens, opened from a bar at the bottom: Home, Weather, Air, Hazards, News. On any of them you can switch your view between three scopes: the town nearest to you, your whole state, or all of Malaysia. Together they answer one question: is my town okay right now.

Every screen draws from the same one town summary, and only fetches a little extra when you ask for it (for example the air-quality trend for a station, or the flood list). It never downloads the whole country at once.

Why I built it this way

Building it, some honest notes

A lot of the work was the boring kind: keeping a free service free, and keeping the data good. A few notes for anyone building something similar.

Staying under the free database write limit

The cloud database (D1) that stores what I gather comes with a free daily cap of roughly 100,000 row writes. The first time I ran a full data load, it burned a whole day's budget at once. Three habits keep it well under the cap:

Populating data without touching the limit twice

The loading job runs on GitHub Actions, not inside the database, so the heavy work never counts against the database's CPU or write budget. It sends the store data in small, repeatable chunks, and a chunk is skipped if it already exists. A re-run therefore never double-counts writes.

Refreshing data on the screen

The browser is the last cache in the chain, and the easiest to get wrong:

Getting the data good in the first place

A few simple words

Sources

  1. DOE APIMS air quality, https://apims.doe.gov.my
  2. Open-Meteo, https://open-meteo.com
  3. USGS earthquakes, https://earthquake.usgs.gov
  4. MET Malaysia, https://www.met.gov.my
  5. InfoBanjir, https://publicinfobanjir.water.gov.my
  6. NOAA El Niño / La Niña, https://www.cpc.ncep.noaa.gov/products/analysis_monitoring/ensostuff/ONI_v5.php

The project lives in the alam-api and alam-dashboard repositories linked at the top of this note.