Skip to content

Konixy/buswidget

Repository files navigation

buswidget monorepo

Monorepo for an iOS public transport widget project, starting with Rouen (Astuce network).

Stack

  • Monorepo: Turbo + Bun workspaces
  • Backend: Bun + Hono + TypeScript
  • Mobile app: Native iOS Swift (to be added)

Rouen data source research

Primary source comes from transport.data.gouv.fr dataset:

Relevant endpoints used now:

  • Static GTFS zip (stop search metadata):
    • https://api.mrn.cityway.fr/dataflow/offre-tc/download?provider=ASTUCE&dataFormat=gtfs&dataProfil=ASTUCE
  • Cityway blended departures (realtime + schedule):
    • https://api.mrn.cityway.fr/media/api/v1/en/Schedules/LogicalStop/{logicalStopId}/NextDeparture?...

Backend resolves Cityway physical/logical stop identifiers from stop coordinates and maps Cityway payloads into the app JSON contract.

Project layout

  • apps/api: Hono backend for Rouen stop search and departures
  • apps/ios: native SwiftUI app + WidgetKit project (generated with XcodeGen)
  • packages/config: shared config placeholders

Run locally

bun install
bun run dev

The API starts from apps/api/src/index.ts.

For real device testing on the same Wi-Fi network:

bun --cwd apps/api run dev:lan

The API will bind to 0.0.0.0 and print LAN URLs (for example http://192.168.x.x:3000) that you can use from your iPhone.

Current API endpoints

  • GET /health
  • GET /v1/rouen/stops/search?q=theatre&limit=10
  • GET /v1/rouen/stops/:stopId/departures?limit=8&maxMinutes=90&lines=T2,F (lines optional, comma-separated)

Departures are sourced from Cityway NextDeparture, which already blends realtime and scheduled times. Each departure includes isRealtime to indicate if the timestamp is live (true) or scheduled (false).

Tests

  • Fast unit/route tests:
    • bun run test
  • Live integration tests against real Rouen APIs and response shape checks:
    • bun run test:real

Next implementation steps

  • Add iOS widget configuration (select specific favorite stop)
  • Add backend endpoint for batch departures (optimize widget refresh)
  • Add offline cache and stale-data UI on iOS
  • Add CI step for iOS lint/tests once Xcode 26 runners are available

About

Get next departure of your favourite stops right on a widget in your homescreen

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors