Dev.to WebDev 🛠 Dev 👁 0 📖 2 min read

Stopwatch: How I Built a Sub-Second Transit Schedule Lookup for 123 Systems from Open GTFS Data

When you're rushing to catch a bus or train, you don't need a heavy 50MB map application that stalls on 3G connections. What you need is an instant, readable, stop-by-stop schedule: when is the next bus arriving, when is

When you're rushing to catch a bus or train, you don't need a heavy 50MB map application that stalls on 3G connections. What you need is an instant, readable, stop-by-stop schedule: when is the next bus arriving, when is the last bus tonight, and what does the full day's service look like?

That challenge led me to create Stopwatch — a lightweight, instant public transit timetable lookup tool covering 123 transit networks across the United Kingdom, United States, Canada, Australia, Ireland, and New Zealand.

The entire codebase is open source on GitHub: shivrajsinhzala/transit-timetables.

Why Transit Schedules Need a Lightweight Alternative

Most transit agencies provide two options:

  1. Raw PDFs or Slow HTML Tables: Often buried three layers deep in municipal portals, poorly formatted for mobile viewports.
  2. Heavy Mapping Apps: Heavy routing calculators that consume battery, require background location tracking, and take 5–10 seconds to render when cellular reception is weak at an underground station or remote bus stop.

Stopwatch was architected specifically to bridge this gap: deliver clean, readable, full-day timetables with sub-second page loads on any device, fully accessible and offline-capable as a progressive web app (PWA).

Technical Highlights & Architecture

1. Ingestion of 123 GTFS Feeds

General Transit Feed Specification (GTFS) data is the global standard for public transit schedules. Stopwatch ingests static GTFS feeds across 123 agencies (from London buses and Sydney trains to Phoenix Valley Metro, Dublin Bus, Toronto TTC, and Auckland Transport).

  • Normalizes disparate agency stops, routes, service calendars, and trip stop times into a compressed schema.
  • Pre-calculates calendar exceptions (calendar_dates.txt) for accurate weekend, weekday, and public holiday departure tables.

2. Static Pre-Rendering & Edge CDN

  • Timetables are statically generated and cached at the edge, guaranteeing sub-100ms first contentful paint (FCP).
  • Zero tracking scripts, zero third-party telemetry, and zero bloat.
  • Built-in Service Worker caching allows commuters to check recently viewed lines even with zero cellular signal.

3. Phone-First Typography

Reading timetable matrices on small screens outdoors in harsh sunlight requires clear contrast, high typography standards, and clean hourly breakdowns rather than cramped desktop-oriented tables.

Explore Stopwatch & Source Code

Whether you commute daily or build open-source transit tools, feel free to explore the app, report issues, or contribute new agency feeds!

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.