PythonFastAPISQLiteSwiftUIWidgetKitGTFS-Realtime

MARTA Live Transit Tracker

A full-stack, real-time transit tracker for Atlanta's MARTA network—turning noisy public feeds into a fast, native iOS experience.

The Problem

Public transit data is published through the GTFS and GTFS-Realtime standards, but the raw feeds are messy: vehicle positions drift, delay information is inconsistent, and real-world feeds routinely diverge from what the official documentation promises. I wanted a rider-facing app that felt instant and trustworthy, which meant building an ingestion layer that could absorb those imperfections rather than surface them.

Architecture & Implementation

I built a 24/7 FastAPI backend backed by SQLite that continuously polls MARTA's GTFS-Realtime bus and rail feeds, normalizing and persisting the data before serving it to a native SwiftUI client.

  • Continuous Ingestion: A FastAPI/SQLite backend polling MARTA's GTFS-Realtime and rail feeds around the clock, accumulating over 575,000 arrival observations across 78 routes and 6,200+ stops.
  • Native Client: A SwiftUI app tracking roughly 200 live vehicles with a 15-second refresh, plus a WidgetKit extension for at-a-glance arrivals.
  • Trip Planning: Integrated OpenTripPlanner to deliver delay-aware, multi-leg trip planning on top of the live feed data.

Challenges Overcome

The hardest problems lived in the gap between the spec and reality. Bus delay data was frequently missing from the feed, so I reconstructed it via trip-to-schedule joins against 2.4M GTFS rows, inferring delays where the realtime feed stayed silent. I also ran into protobuf payloads that the standard parsers mishandled, so I hand-wrote a protobuf decoder and validated it byte-for-byte against the reference parser to guarantee correctness. The entire pipeline is backed by 59 automated tests to keep the ingestion layer honest as the feeds evolve.

GitHub Code