huh4k ~/dev
Case Study

Interchange — Melbourne Transit & GTFS Journey Planner

Cross-platform transit application for Melbourne (PTV) combining real-time Timetable API v3 data with offline GTFS timetable feeds for reliable commute tracking.

Flutter Dart PTV API v3 GTFS Cross-Platform

Overview

Interchange is a transit navigation client engineered for Melbourne riders across Victoria’s Public Transport network (PTV). Commuters in Melbourne frequently experience disruptions, unexpected line maintenance, and signal dropouts in underground rail loops.

Interchange addresses this by pairing live network API queries with an embedded offline GTFS (General Transit Feed Specification) database, enabling instant timetable lookups and journey tracking even when cellular connectivity drops.


Architecture & Engineering Highlights

  • Dual-Data Engine (API + Local GTFS): Automatically queries the live PTV Timetable API v3 for real-time departures, platform modifications, and line disruptions. When offline, seamlessly falls back to pre-indexed local GTFS datasets.
  • Connection Feasibility Advisor: Evaluates transfer windows at critical interchange stations (e.g., Richmond, South Yarra, Flinders Street) by factoring in walking distances, platform changes, and real-time train positioning.
  • Station Detection & Live Tracking: Background progress updates that alert commuters before approaching transfer points or destination stations.
  • Clean Architectural Separation: Divided cleanly into presentation, data, domain, and service layers with reactive state bindings in Dart.
// Fetching departures with offline GTFS fallback
Future<List<Departure>> getStationDepartures(int stopId, {required TransportMode mode}) async {
  try {
    final liveDepartures = await _ptvService.fetchLiveDepartures(stopId, mode);
    if (liveDepartures.isNotEmpty) return liveDepartures;
  } on SocketException catch (_) {
    // Graceful degradation when underground or disconnected
    _logger.w('Network unavailable — falling back to offline GTFS timetable');
  }
  return await _gtfsLocalRepository.getScheduledDepartures(stopId, DateTime.now());
}

Technical Stack

  • Client: Flutter & Dart (iOS, Android, macOS, Linux)
  • APIs: Public Transport Victoria (PTV) Timetable API v3 (HMAC-SHA1 signature authentication)
  • Data Sets: GTFS static timetable parsing, SQLite local indexing
  • Workflows: GitHub Actions CI for cross-platform linting and testing