How freebus-co-il/freebus works
FreeBus is an Israeli public-transit trip planner. Riders search for stops or places, request an A→B itinerary, and view walking, transfer, departure, and available live-delay information in the Expo app. GTFS ingestion builds the database consumed by the API; the API’s RAPTOR index and route handlers serve planning requests, with optional Valhalla walking and Photon/Google geocoding. The README establishes the service boundaries; source-index references and excerpts support selected internal links, but many route and app details were not sampled.
Main entry points: plan.ts Journey planning route · server.ts HTTP server and routes · index.ts API service · importFeed.ts Feed importer
Components 22
GTFS ingestion
- Import scheduler
gtfs/src/scheduler.ts - GTFS feed client
gtfs/src/feed/client.ts - Feed importer
gtfs/src/pipeline/importFeed.ts - Versioned GTFS database
gtfs/src/db/swap.ts
Planning API
- API service
api/src/index.ts - HTTP server and routes
api/src/server.ts - Journey planning route
api/src/routes/plan.ts - Timetable index
api/src/transit/index.ts - Index manager
api/src/transit/manager.ts - GTFS database access
api/src/db/bundle.ts - Walking router
api/src/walking/valhalla.ts - Geocoding integration
api/src/geocode/buildGeocoder.ts
Realtime data
- Realtime runtime
api/src/realtime/wiring.ts - Feed poller
api/src/realtime/poller.ts - Realtime store
api/src/realtime/store.ts
Mobile app
- Expo client
app/src/app/(tabs)/index.tsx - API client
app/src/api/client.ts - Live journey state
app/src/features/journey/journey-context.tsx
External services
- Valhalla
- Photon or Google
- Ministry realtime feed
Other components
- Rider
Connections 23
- Rider → Expo client: searches and plans
README.md - Expo client → API client: requests data
- API client → HTTP server and routes: calls over HTTP
README.md - HTTP server and routes → Journey planning route: routes requests
api/src/server.ts - Journey planning route → Timetable index: plans with RAPTOR
api/src/routes/plan.ts - Journey planning route → Walking router: resolves walk geometry
api/src/routes/plan.ts - Index manager → GTFS database access: builds database bundle
api/src/transit/manager.ts - Index manager → Timetable index: builds timetable index
api/src/transit/manager.ts - API service → Index manager: creates manager
api/src/index.ts - API service → HTTP server and routes: starts service
api/src/index.ts - API service → Realtime runtime: creates runtime
api/src/index.ts - Realtime runtime → Feed poller: creates poller
- Feed poller → Realtime store: updates predictions
api/src/realtime/poller.ts - Journey planning route → Realtime store: annotates itineraries
api/src/routes/plan.ts - Import scheduler → Feed importer: runs imports
gtfs/src/scheduler.ts - Feed importer → GTFS feed client: fetches feed
gtfs/src/pipeline/importFeed.ts - Feed importer → Versioned GTFS database: builds and swaps
gtfs/src/pipeline/importFeed.ts - Versioned GTFS database → GTFS database access: database read source
README.md - Walking router → Valhalla: requests routes
README.md - HTTP server and routes → Geocoding integration: configures geocoder
api/src/server.ts - Geocoding integration → Photon or Google: geocodes places
README.md - Feed poller → Ministry realtime feed: polls when configured
README.md - Live journey state → Expo client: supports live journeys