Skip to content
4 min read

SkyWatch: tracking what is actually over the house

On this page

Every flight-tracking app shows you a map full of tiny yellow planes. What I actually wanted to know when something loud rattled the windows was much smaller: what just flew over the house, where did it come from, and is it the same airframe that came through every Tuesday morning?

SkyWatch is my self-hosted dashboard for answering that. It runs in Node.js, polls free public ADS-B feeds (adsb.lol, with failover to adsb.fi), stores sightings in SQLite, mirrors them incrementally into local Postgres if configured, enriches flights with route data, detects recurring patterns, and serves a live map with zero third-party CDN scripts.

Most of a circle is near its edge

A location's watch radius is how far the feed looks, not what is overhead. Geometry is ruthless here: of the first 1,605 aircraft recorded near home, only 30 — roughly 2% — ever came within one nautical mile.

So SkyWatch makes proximity explicit everywhere: overhead (default 1 mile), nearby (3 miles), and in range. That also forced a data-model change. Sightings are stored at most once per minute per aircraft to keep SQLite lean, and at airliner speed a minute is up to seven miles. If you only checked stored rows, a jet could cross straight over your roof between two samples and never count as overhead.

Instead, the live view renders from the newest 15-second poll, and every poll updates a continuous pass record keeping the aircraft's closest approach at full poll resolution. Watchlist push alerts evaluate against every poll too, so an overhead pass between stored rows still triggers.

Being a good citizen to free feeds

Free ADS-B APIs fail in predictable ways, and treating every failure the same makes a dashboard either noisy or blind.

The first surprise was basic: the CDN in front of adsb.lol answers Node's default User-Agent with HTTP 403. Without an explicit deployment identifier, the dashboard quietly receives zero planes. A provider-contract test now pins that header so a regression breaks the build rather than starving the map.

The second lesson was rate limiting. Polling multiple locations sequentially against one primary feed triggered hundreds of HTTP 420/429 responses an hour. SkyWatch now rotates each location's first feed under a spread strategy (adsb.lol and adsb.fi), honors Retry-After headers with per-provider exponential backoff, and surfaces the health of the whole path in the header: Live, Degraded, Feed down, or Offline (meaning the SkyWatch server itself is unreachable, not the browser's navigator.onLine guess).

Route enrichment tracks provenance the same way. Every stored route records whether the route service verified it against the aircraft's actual position (plausible) or returned it unchecked (unverified). Placeholder strings like unknown or routes marked implausible are discarded rather than displayed with false confidence.

Gliding planes, honest trains, and no CDNs

The map runs on MapLibre GL bundled straight into dist/ via Vite alongside Chart.js and the Inter font — no external script or font hosts. Live updates push over Server-Sent Events (/api/stream/:scope), falling back quietly to 5-second polling if a proxy blocks the stream.

Between polls, motion-core.js dead-reckons each plane from its ground speed and track up to 30 frames per second, easing out corrections over about a second when a fresh report disagrees — and stopping extrapolation 45 seconds after the last report so a lost plane freezes instead of flying into the next state. A 3D toggle tilts the map and stands every aircraft on a stem at its true altitude, while prefers-reduced-motion turns the animation off cleanly.

When I added trains, the data boundary had to be stated plainly: freight railroads publish no live positions. SkyWatch fetches main rail lines once a month from OpenStreetMap using a rounded bounding box (never sending exact home coordinates), tracks live passenger trains via Amtraker by polling only the trains serving nearby stations, and supports optional GTFS-realtime transit feeds filtered strictly to rail route types — hiding any feed whose clock stops moving for more than ten minutes instead of painting phantom parked trains.

Replaying real skies in tests

The integration suite never hits live providers or reads my real config.js. Instead, test/fixtures/providers/ holds sanitized provider captures from public airport areas shifted onto fictional origins, including aircraft on the ground, blank callsigns, military flags, and implausible routes. The very first replay caught a real bug: a flight field consisting solely of spaces was being stored and displayed as a callsign.

A headless Chrome browser suite (playwright-core) also drives the real Vite bundle against a mock feed — verifying SSE push, polling fallback, 375 px phone layouts, day playback, and keyboard navigation. Writing those browser tests caught three accessibility bugs I would have missed by eye: location buttons using aria-selected instead of aria-pressed, focusable map labels that did nothing on click, and Escape failing to close the pin editor once Save or Reset had focus.

Pattern detection that survives outages

SkyWatch classifies flights over a rolling 30-day window (learning, unusual, occasional, recurring, scheduled) against the hours a location was actually observed — counting every successful poll even when the sky is empty. Under 48 observed hours, everything stays learning. That way a feed outage never tricks the tracker into calling a daily cargo flight "occasional," and a quiet 3 AM never fires a false stale-data alert because expectations compare against the same local hour over the prior 14 days.

It stays strictly local and self-hosted: SQLite owns the operational truth, an optional one-way mirror keeps Postgres in sync for ad-hoc SQL queries, and nightly backup + recovery drills make sure a bad disk does not wipe out months of sky history.