How axbouf/transport_agent works
Transport is a multi-network public-transport data platform. Its principal runtime workflow schedules realtime feed fetches, converts GTFS-Realtime payloads and writes vehicle positions, trip updates and alerts to PostgreSQL; the web API and experimental agent query transport data, while the React frontend presents the map experience. Static GTFS ingestion and data-warehouse analysis are additional documented capabilities. Source excerpts establish the bus fetch/write path, scheduler dispatch, web query behavior and agent/tool relationship; other documented or indexed subsystems are shown without guessed internal links.
Main entry points: app.py Transport API · tools.py Query tools · get_vehicle_pos.py Bus feed fetchers · pg_writer.py Postgres writers
Components 27
Static GTFS
- Static feed fetch
data/get_gtfs_buses.py - Static network feeds
data/get_gtfs_metro.py - Train feed fetch
data/get_gtfs_sydneytrains.py - Static data loader
data/load_data.py
Realtime ingestion
- Realtime schedulers
realtime/buses/app.py - Bus feed fetchers
realtime/buses/get_vehicle_pos.py - Bus feed jobs
realtime/buses/get_trip_update.py - Feed parsers
realtime/parser.py - Realtime schema
realtime/schema.py - Postgres writers
realtime/pg_writer.py - Postgres schema
realtime/pg_schema.py
Query and serving
- Transport API
web/app.py - Dashboard client
web/static/app.js
Frontend
- Frontend router
frontend/src/router.tsx - Root route
frontend/src/routes/__root.tsx - Live map
frontend/src/components/LiveMap.tsx - SSR error handling
frontend/src/server.ts
Agent tooling
- Transport agent
transport_agent/agent.py - Query tools
transport_agent/tools.py - Database config
transport_agent/config.py
Warehouse analysis
- Warehouse loaders
user/datawarehouse/scripts/load_core_transport.py - Analysis loaders
user/datawarehouse/scripts/load_analysis.py
Other components
- Transport user
- GTFS feeds
- Transport NSW API
- PostgreSQL
- Chat/API caller
Connections 26
- GTFS feeds → Static feed fetch: supplies feeds
README.md - Static feed fetch → Static data loader: loads data
README.md - GTFS feeds → Static network feeds: supplies feeds
README.md - GTFS feeds → Train feed fetch: supplies feeds
README.md - Transport NSW API → Bus feed fetchers: serves feed
realtime/buses/get_vehicle_pos.py - Realtime schedulers → Bus feed fetchers: schedules fetch
realtime/buses/app.py - Realtime schedulers → Bus feed jobs: schedules fetch
realtime/buses/app.py - Bus feed fetchers → Postgres writers: writes positions
realtime/buses/get_vehicle_pos.py - Bus feed jobs → Postgres writers: writes updates
realtime/buses/get_trip_update.py - Feed parsers → Realtime schema: uses schema
realtime/parser.py - Postgres writers → PostgreSQL: writes realtime
realtime/pg_writer.py - Postgres schema → PostgreSQL: defines tables
README.md - Transport user → Dashboard client: views dashboard
README.md - Dashboard client → Transport API: requests data
README.md - Transport API → PostgreSQL: queries data
web/app.py - Chat/API caller → Transport API: asks questions
web/app.py - Transport API → Transport agent: runs chat query
web/app.py - Transport agent → Query tools: dispatches tools
transport_agent/agent.py - Query tools → Database config: gets DB config
transport_agent/tools.py - Query tools → PostgreSQL: queries transport
transport_agent/tools.py - Transport user → Frontend router: opens app
README.md - Frontend router → Root route: routes to
frontend/src/routeTree.gen.ts - Root route → Live map: renders map
- SSR error handling → Root route: serves SSR
- PostgreSQL → Warehouse loaders: supplies data
README.md - Warehouse loaders → Analysis loaders: builds analysis
README.md