Skip to content
Inside a Developer's Head by Jesús Quintana, home

side project

Leer en español

Shoal

In progressStarted 2026

A transit app for iPhone with realtime departure boards, trip planning and widgets, working offline from a timetable it downloads on first launch. Version 1.0 is a Sydney pilot.

What it is

Shoal is a transit app for iPhone: departure boards with realtime, trip planning, saved stops and lines, reminders and widgets. It works offline from a timetable pack that it downloads on first launch, while a short onboarding shows how the app works.

Version 1.0 is a Sydney-only pilot. The code already supports 17 cities, from Barcelona to New York, but the others are not part of the pilot.

How it's built

Shoal is one iOS app built from 23 small Swift packages, a Cloudflare Worker for realtime data and a command-line tool that builds timetables. The app is offline-first: it reads a timetable stored on the phone and adds live data on top. Trips use the city’s own planner, and when it is unreachable, trips are planned on the phone with RAPTOR over that same timetable. Widgets run in their own extension on the same packages. It is Swift 6 with strict concurrency, and the rules between packages are checked by scripts, not by habit.

highlights

  • A timetable pack built from GTFS

    Transit agencies publish timetables as GTFS feeds, which are big zips of text files. A command-line tool in the repo reads one or more feeds for a city and turns them into one SQLite file, with a per-city profile for its quirks. The app downloads that file on first launch and reads it offline, which keeps the app itself small.

  • One provider per city, and a pilot gate

    Everything that differs per city lives in its own package behind one provider protocol: data sources, fares, stop links, styling and time zone. A lint rule stops the shared code from importing any city. For the pilot, the other 16 cities stay in the code and the tests, switched off with one flag each in the app’s city list.

  • A realtime Worker that caches and batches

    Realtime goes through a small Cloudflare Worker, not straight from the phone to each agency. It holds the credentials, caches responses so the load on the agencies doesn’t grow with users, paces rate-limited sources and applies per-client limits. The app also sends requests that arrive together, like the ones at launch, as one batch, and each part is answered as if it had been sent alone, so caches and parsers don’t change.

  • A package split that a script enforces

    The dependency graph has no cycles, and the domain package depends on nothing. Only the timetable package may read the pack with SQL, and only the city packages, the app and one test target may import a city. Lint rules enforce both, and the same script caps file and type sizes and bans new force unwraps in production code, so 23 packages stay easy to work in.

  • A design system generated from JSON

    Colours, spacing, type and motion are JSON files, and the Swift tokens are generated from them. The generator rejects a palette that fails a contrast check. Mode and line colours are data per city, so Sydney’s train orange never changes with the theme. A separate showcase app renders every component on several themes for snapshot tests.

  • A test gate with floors and contract tests

    One script runs the static checks, the tests of every package, the Worker’s tests and the app suites on a pinned simulator. It fails if a suite runs fewer tests than its floor, so a deleted test can’t hide. No test touches the network: they use stubbed hosts and fixture packs. Recorded requests and responses from released builds are replayed against the Worker, so a Worker change that would break an installed app fails the tests.

  • Swift 6
  • SwiftUI
  • SwiftPM
  • GRDB / SQLite
  • GTFS / GTFS-Realtime
  • Cloudflare Workers
  • TypeScript
  • XcodeGen