A Vite and React app that ships 86 years of daily data, computes the climate maths on the device, and builds its own Android APK

Every weather app tells you the temperature outside. None of them tells you what that number means. Sixteen degrees in November is unremarkable in Naples and remarkable in Oslo, and the same sixteen degrees means something different in 2026 than it did in 1950. The information that answers "is this normal?" exists, is free, and is almost never put next to the forecast.

This repository is my attempt at fixing that: a weather app for any city, with the whole record since 1940 one tap away, plus an Evidence tab that walks through the global temperature, sea level, sea ice, CO2 and the counter-arguments that the data can actually test. It runs as a web app, an installable web app (a PWA, a site the browser can add to the home screen and run offline), and an Android APK built by CI.

The article explains why the project exists, what is in the repository, three files worth reading, the numbers the app produces from the data, and the four steps to add an analysis of your own. It assumes you know JavaScript, React and the command line. It assumes nothing about this project.

Repo: github.com/edgarmilvus/meteo-warming · GitHub: @edgarmilvus · Live: edgarmilvus.github.io/meteo-warming

Why it exists

The first version was written in February 2022: a React Native app, charted with victory-native, that read one file from the Met Office, the monthly weather record of Hurn — a weather station at Bournemouth airport, on the south coast of England. It plotted the monthly maximum temperature of five years: 1960, 1980, 2000, 2010 and 2020, as five overlaid lines.

It looked convincing and it was wrong in three ways that matter.

The first is scope. One station in England is not the planet, and the first reader who says "Bournemouth is not the globe, you picked one convenient place" is right.

The second is selection. Five hand-picked years are weather, not climate. In that very dataset 2010 is colder than 2000, so the chart, read honestly, shows cooling — which is what one decade of a noisy record will do.

The third is that nothing was computed. The five lines were drawn and the comparison was left to the eye, with no baseline, no anomaly, and no statement of what "normal" meant.

The rebuild inverts all three: global series instead of one station, every year instead of five, and an anomaly — a value minus the same window of years averaged — against a declared baseline, the 30-year period that defines "normal".

What is in the repository

Path What it is
src/screens/ Today, History, Evidence, About
src/lib/stats.js every historical figure: series, baselines, windows, ranks
src/lib/units.jsx Celsius to Fahrenheit, at the display edge only
src/components/ hand-drawn SVG charts, the accordion, the place picker
src/data/ the baked datasets: one JSON per city, one per Evidence section
scripts/ the bake scripts: weather archive, global record, Evidence
.github/workflows/ Pages, Android APK, iOS
capacitor.config.json the native shell: app id, name, web directory

The web app is Vite and React 19 with no chart library. The charts are SVG drawn at the measured pixel width of their container, because a chart that scales with viewBox also scales its label sizes, and 9.5px labels at 60% are unreadable.

The data, and the licence rule

Four sources, and each one had to clear a licence before it could be used. This is not pedantry: the app is public and the repository ships the data files, so a dataset that forbids redistribution cannot go in.

Dataset What it gives Licence
ERA5 via Open-Meteo daily max and min for any city, 1940 to today CC BY 4.0
NASA GISTEMP v4 global land-ocean annual means, 1880 to today public domain
NOAA GML, Mauna Loa atmospheric CO2, 1959 to today public domain
OWID, carrying NOAA, UHSLC, HadSST and NSIDC sea level, sea surface temperature, Arctic sea ice CC BY 4.0

The bake script enforces the rule instead of trusting memory. Every dataset declares its licence and a commercial flag, and the script refuses to write one that has neither:

if (!d.licence) throw new Error(`${d.id}: no licence declared`); if (d.commercial !== true) throw new Error(`${d.id}: not cleared for commercial use`); 

That guard is why the app has no satellite series. UAH and RSS are the two records that would make the "the satellites disagree" objection worth charting, and both restrict redistribution to non-commercial use. The Evidence tab names them and says why they are absent, rather than quietly dropping the objection.

One consequence worth stating: the code is MIT, and the data is not. Relicensing someone else's measurements because they are in your repository is a mistake people make; the About tab lists each dataset's licence next to the dataset.

Compute on the device, convert at the edge

Every figure in the app is computed in Celsius, from one daily record held on the device. The forecast is fetched live, the history is not: a city's 31,743 days are downloaded once, cached, and then every average, anomaly and rank is arithmetic on that array.

Converting units at the edge, rather than storing two versions, is the decision that keeps that simple. It also hides a trap: a temperature and a temperature difference do not convert the same way.

import { createContext, useContext, useMemo } from "react"; // Temperatures live in Celsius everywhere inside the app: the record, the // baseline, every calculation. Only the display converts, so switching units // never changes a single figure, just how it is written. const toF = (c) => (c * 9) / 5 + 32; const signed = (v, digits) => `${v > 0 ? "+" : v < 0 ? "\u2212" : ""}${Math.abs(v).toFixed(digits)}`; const UnitsContext = createContext(null); export function UnitsProvider({ unit, children }) { const value = useMemo(() => { const f = unit === "f"; // Absolute temperature, e.g. 12 °C -> 54 °F const t = (c) => (c === null || c === undefined ? null : f ? toF(c) : c); // A difference, e.g. an anomaly of +1.3 °C -> +2.3 °F. No 32 offset. const d = (c) => (c === null || c === undefined ? null : f ? c * 1.8 : c); return { unit, label: f ? "°F" : "°C", t, d, t0: (c) => (t(c) === null ? "—" : String(Math.round(t(c)))), t1: (c) => (t(c) === null ? "—" : t(c).toFixed(1)), d1: (c) => (d(c) === null ? "—" : d(c).toFixed(1)), dSigned: (c, digits = 1) => (d(c) === null ? "—" : signed(d(c), digits)), }; }, [unit]); return <UnitsContext.Provider value={value}>{children}</UnitsContext.Provider>; } export function useUnits() { return useContext(UnitsContext); } /** Chart colours are assigned from the Celsius value; the scale is in °C by design. */ export const isFahrenheit = (u) => u.unit === "f"; 

12 °C becomes 54 °F; an anomaly of +1.3 °C becomes +2.3 °F, not +34.3 °F, because a difference has no zero-point to shift. Getting this wrong is the most common bug in weather apps with a unit switch, and it is invisible until someone points at a chart and says the anomaly looks absurd.

The same file is why switching units never re-draws from different data: the series stays in Celsius, the axis labels change.

The Evidence tab loads what you open

Evidence has eight sections and thirteen charts. Rendering all of it on mount would be wasteful and, on a phone, visibly slow — so a section is mounted the first time it is opened, and then kept mounted and hidden, which makes reopening instant without recomputing anything.

import { useEffect, useState } from "react"; /** * One collapsible section of Evidence. The body is mounted the first time the * section is opened and then kept, hidden, so reopening is instant and the * work is never repeated. */ export default function Section({ id, title, headline, note, defaultOpen = false, children }) { const [open, setOpen] = useState(defaultOpen); const [mounted, setMounted] = useState(defaultOpen); // A deep link can arrive after the section is already mounted. useEffect(() => { if (defaultOpen) { setMounted(true); setOpen(true); } }, [defaultOpen]); const toggle = () => { if (!open) setMounted(true); setOpen(!open); }; return ( <section className={`evidence-section ${open ? "is-open" : ""}`} id={`evidence-${id}`}> <button className="evidence-head" aria-expanded={open} aria-controls={`evidence-${id}-body`} onClick={toggle} title={open ? `Collapse ${title}` : `Open ${title}`} > <span className="evidence-head-text"> <span className="section-title">{title}</span> {note && <span className="evidence-note">{note}</span>} </span> <span className="evidence-head-right"> {headline && <span className="evidence-headline tnum">{headline}</span>} <svg className="chevron" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.2" aria-hidden="true" > <path d="M9 6l6 6-6 6" strokeLinecap="round" strokeLinejoin="round" /> </svg> </span> </button> {mounted && ( <div className="evidence-body" id={`evidence-${id}-body`} hidden={!open}> {children} </div> )} </section> ); } 

Two details are doing the work. mounted is set on the first open and never cleared: the DOM survives, so closing and reopening is a display: none toggle rather than a re-render. And the body is wrapped in Suspense with a lazy() import above it, so the section's component and its JSON are separate chunks that only arrive when the reader asks for them. Measured in the build: 8 KB for Atmosphere, 8 KB for Ice, 20 KB for Oceans, plus 4 KB of shared chart code.

The collapsed header still shows a number — 427.4 ppm, 4.81 M km² — and that number cannot come from the section's data, because the data has not been loaded yet. It comes from a 1 KB index.json written by the same bake script: headlines only, no series.

The day the site served the old build

The first time a deploy changed something visible, the live site kept showing the previous version. The cause was my own service worker — the background script that serves an app offline — because it cached everything from the same origin, including the HTML, and a cache-first HTML response means a returning reader gets yesterday's page pointing at yesterday's JavaScript bundle.

// Offline shell. The app is a static bundle plus data that is already baked in; // the only network calls are the forecast and the archive, and both degrade to // the stored history when they fail. const CACHE = "climate-shell-v2"; const SHELL = ["./", "./index.html", "./manifest.webmanifest"]; self.addEventListener("install", (event) => { event.waitUntil( caches.open(CACHE).then((c) => c.addAll(SHELL)).catch(() => undefined), ); self.skipWaiting(); }); self.addEventListener("activate", (event) => { event.waitUntil( caches .keys() .then((keys) => Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k)))) .then(() => self.clients.claim()), ); }); self.addEventListener("fetch", (event) => { const { request } = event; if (request.method !== "GET") return; const url = new URL(request.url); // Never cache the weather APIs: stale forecasts are worse than none. if (url.origin !== self.location.origin) return; // A page load must always check the network first, and must not be answered // from the HTTP cache: otherwise a deploy leaves returning readers on the old // build until they clear it by hand. if (request.mode === "navigate") { event.respondWith( fetch(request, { cache: "no-store" }) .then((res) => { const copy = res.clone(); caches.open(CACHE).then((c) => c.put("./index.html", copy)).catch(() => undefined); return res; }) .catch(() => caches.match("./index.html").then((r) => r || Response.error())), ); return; } // Assets are content-hashed, so cache-first is safe and instant. event.respondWith( caches.match(request).then((hit) => { if (hit) return hit; return fetch(request).then((res) => { if (res.ok && res.type === "basic") { const copy = res.clone(); caches.open(CACHE).then((c) => c.put(request, copy)).catch(() => undefined); } return res; }); }), ); }); 

The fix is a split policy. Assets keep cache-first, because Vite writes a content hash into every filename: a new build produces new names, and a cached old asset can never be the wrong answer. Navigation requests go to the network first, with cache: "no-store" so the browser's HTTP cache cannot answer either, and fall back to the cached shell only when the network fails.

skipWaiting() and clients.claim() mean the new worker takes over without waiting for every tab to close, and the cache name is versioned (v2) so the activate handler deletes the old one. It is the kind of bug that costs an evening and teaches more than a week of features: offline support and fresh content are two different promises, and one policy cannot keep both.

Android without a toolchain

The APK is built by GitHub Actions on ubuntu-latest, which already has a JDK and the Android SDK. The workflow wraps the built web app with Capacitor 8 — a native shell that puts a WebView around the site and hands it to Android or iOS — generates the native project, and assembles a debug APK in about two and a half minutes. No Android Studio, no SDK on a laptop, and the same pipeline works from a machine that has never compiled Java.

Icons needed one workaround. @capacitor/assets turns a 1024px source into every density, but it wraps both adaptive-icon layers in an <inset 16.7%> meant for logos with a margin. This artwork is the stripes themselves, so the inset framed them in white. The fix is a script that rewrites the generated XML:

const XML = `<?xml version="1.0" encoding="utf-8"?> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <background android:drawable="@mipmap/ic_launcher_background" /> <foreground android:drawable="@mipmap/ic_launcher_foreground" /> </adaptive-icon> `; 

The background fills the whole 108dp layer, the launcher mask crops it, and the stripes reach the edge.

One practical detail if you do this: every CI run signs with a freshly generated debug key, so installing a new build over an old one fails with "App not installed". Uninstall first, or keep a release keystore and sign properly.

The numbers the app produces

All of these are computed from the files in src/data by the code in src/lib. Nothing below is typed from memory.

Figure Value Where it comes from
New York, annual mean 1991–2020 11.85 °C the city record
New York, 2025 anomaly +0.72 °C against that baseline
New York, warmest year 2024, +1.34 °C same
New York, coldest year 1967, −1.76 °C same
New York, days above 30 °C 13 in 1945, 48 in 2025 counted from the daily record
Global, 2025 +1.19 °C GISTEMP, 1951–1980 baseline
Global, 1880s −0.21 °C same
Global, 2020–2025 +1.07 °C same
CO2 at Mauna Loa 315.98 → 427.35 ppm, 1959–2025 NOAA GML
CO2 growth, last ten years +2.63 ppm per year derived from the same series
Sea surface temperature, 2025 +1.10 °C HadSST, against 1861–1890
Arctic September minimum 7.05 → 4.81 million km², 1979–2026 NSIDC
Arctic September minimum, change −32% same

The last two rows are the reason the tab exists. 2025 is 1.19 °C above the 1951–1980 average and 2024 is the warmest year on record — but that sentence means nothing without the 1880s at −0.21 °C next to it, and the 1880s mean nothing without a stated baseline.

How to add a section

The Evidence tab was built so that adding an analysis does not require touching the app's state management. Four steps:

  1. Declare the dataset in scripts/fetch-evidence.mjs, with its URL, its licence and commercial: true. The script refuses anything else.
  2. Run the bake: npm run evidence. It writes one JSON per section plus the headline index.
  3. Write the component in src/screens/evidence/, importing its own JSON so the data travels with the chunk.
  4. Register it in Evidence.jsx with lazy(), and add a title, a headline and a one-line note to the sections array.

That is the whole contract. The accordion, the lazy mounting, the deep link (#evidence/oceans) and the offline cache all come for free, because they are generic over the sections array.

If you want to go further, the honest next steps are the ones the app admits it cannot do yet: NOAA STAR's satellite record (public domain, so it can ship) for the satellite objection, Berkeley Earth station data for the urban heat island test, and solar and volcanic forcing series for the last two.

What it refuses to do

Climate apps are easy to make dishonest by accident, so the repository has rules rather than good intentions.

No smoothing that hides individual years — a chart that averages away a cold summer is a chart that lies by omission. No fitting of models to observations, because a fit is a claim about the future disguised as a description of the past. No index invented for the occasion: every series is a published one, cited where it appears. No "this proves": the app says what the data shows and, in the objections section, what it cannot test.

And no comparisons across different baselines without the conversion. Two numbers on two different 30-year windows are not comparable, and the arithmetic to fix it is one subtraction that almost nobody does.

The result is not a bigger weather app. It is a weather app that answers the question the forecast raises and never answers: is this normal?

Repo: github.com/edgarmilvus/meteo-warming · GitHub: @edgarmilvus · Live: edgarmilvus.github.io/meteo-warming