Simon-Pierre Boucher
All apps & projects
Web Platform
TypeScript

earth-now.co

Every counter is a documented statistical model — never an opaque extrapolation.

A real-time planetary dashboard live at www.earth-now.co, ticking 76 world metrics on screen with traceable sources, model versions, and honest uncertainty on every number.

76

Live metrics across 12 domains

142

Tests passing

60 fps

Local counter animation

3.2 KB

Gzipped embeddable widget

7

Model families in production

90%

Confidence intervals on counters

Overview

earth-now.co is a real-time planetary dashboard — a robust successor to Worldometer. It displays 76 live world metrics across 12 domains: population, economy, society, health, tech, energy, climate, emissions, forest, ocean, real-time events, and space. Signature counters include human heartbeats (~9.7 billion per second), world GDP (~$3.7M per second), coffee cups (~26k per second), and a 1.5°C carbon budget counting down. Every number on screen is traceable — source, license, observation date, model family, and 90% confidence interval are one click away on every counter.

The core principle: a counter is a model, not a stream. The server ships a CounterModel — anchor value, rate function, uncertainty, source — and every client animates the same pure function locally at 60 fps; SSE pushes only newly fitted models, never per-tick values. Seven model families run in production, from Fourier seasonal harmonics and monotone PCHIP observation/forecast fusion to Keeling-curve fits and Holt-Winters nowcasting. Fit-time guardrails enforce cumulative monotonicity, rate bounds, and an anti-teleportation diff that blocks any deploy that would make a counter visibly jump.

The codebase is a pnpm + Turborepo monorepo in strict TypeScript across 10 packages: a Next.js 14 App Router frontend, a Fastify API serving REST, SSE, and SVG badges, ingestion workers for USGS and NOAA, pure isomorphic model and counter packages, and a zero-dependency embeddable widget weighing 3.2 KB gzipped. 142 tests cover golden recovery, property-based invariants, and cross-runtime consistency. Production runs on MacLustr cluster node M3U96b behind an ngrok tunnel at www.earth-now.co, with a deploy script that refuses to finish until mandatory health checks pass.

Key Features

Counters as models

The server ships a CounterModel and every client animates the same pure rate function locally at 60 fps — no per-second values ever cross the network.

Statistical honesty

Monotone PCHIP splines that can never overshoot or tick backwards, Fourier seasonality, 90% confidence intervals, and sigFigs caps on displayed precision.

SSE model updates

Server-sent events push only newly fitted models after ingestion or correction; clients smooth refits over 60 seconds thanks to an anti-teleportation guardrail.

76 traceable metrics

Source, license, observation date, model family, and version are one click away on every counter, with a /methodology page generated straight from the registry.

True real-time events

USGS earthquakes and humans in space are genuinely event-driven pollers with no interpolation, alongside deterministic astronomy for Earth's orbital distance.

Embeddable everywhere

A zero-dependency IIFE widget at 3.2 KB gzip and server-rendered SVG badges evaluate the exact same function as the dashboard — bit-identical values, verified cross-runtime.

How It Works

  1. Ingestion

    Workers pull observations from authoritative sources such as USGS FDSN and NOAA GML into an append-only store; raw payloads are archived with checksums so every model can be re-fitted from history.

  2. Model fitting

    CounterModels are re-fitted per metric using Fourier seasonal harmonics, monotone PCHIP observation/forecast fusion, Keeling-curve least-squares fits, and Holt-Winters/Kalman nowcasting.

  3. Guardrail validation

    Every fit must pass cumulative monotonicity, declared rate bounds, anchor identity, and an anti-teleportation diff that blocks deployment if a refit would visibly jump on screen.

  4. SSE distribution

    The Fastify API pushes only new validated models over server-sent events; clients evaluate the pure value(model, t) function locally at 60 fps, so all runtimes stay bit-identical.

  5. Presentation

    The Next.js dashboard leads with a computed live tier, per-metric pages carry generated methodology sections, and the 3.2 KB widget plus SVG badges reuse the same shared counter runtime.

Tech Stack

Frontend

Next.js 14 (App Router)
Strict TypeScript (10 packages)
SSE live updates
fr/en i18n from day one

Backend & Data

Fastify (REST + SSE + SVG badges)
BullMQ ingestion workers (USGS, NOAA)
TimescaleDB + Redis (Docker Compose)
pnpm + Turborepo monorepo

Deployment

MacLustr node M3U96b
ngrok tunnel
www.earth-now.co
pnpm deploy:m3u96b with mandatory health checks

Highlights

  • 76 metrics across 12 domains, from world population and GDP (~$3.7M/s) to human heartbeats (~9.7 billion per second).
  • Counters never stream: SSE only pushes newly fitted models, and every client animates the same pure function at 60 fps.
  • Monotone PCHIP splines are property-tested with fast-check so a counter can mathematically never overshoot or tick backwards.
  • 142 tests include golden recovery (a synthetic Keeling curve recovered to under 0.05 ppm) and jsdom-vs-Node bit-identical consistency checks.
  • The embeddable widget is a zero-dependency IIFE at 3.2 KB gzipped, well under its 15 KB budget.
  • Deploys to MacLustr node M3U96b are only done once /api/health returns 200 and an SSE stream holds for at least 10 seconds.

Explore earth-now.co

Live world metrics, modeled — never streamed — the full source is on GitHub.