Transport app for Chelmsford UK
npm install
npm run dev| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Production build |
npm run preview |
Preview production build |
npm test |
Run tests in watch mode |
npm run test:run |
Run tests once |
npm run test:coverage |
Generate coverage report |
npm run lint |
Check for lint errors |
npm run lint:fix |
Fix lint errors |
npm run format |
Format code with Prettier |
npm run typecheck |
TypeScript type checking |
npm run knip |
Find unused code |
npm run check |
Run all checks |
src/
├── main.ts # Application entry point
├── main.test.ts # Example test
├── api/ # External API clients
├── core/ # Core business logic
├── config/ # Configuration loading with Zod
├── utils/ # Logger and helper utilities
└── types/ # Shared type definitions
- App loads config and gets user location via browser Geolocation API
- Reverse geocodes location to display UK postcode (via postcodes.io)
- Finds nearest bus stops in both directions (up to 4 stops)
- Fetches real-time departures with fallback chain:
- First Bus API - real-time for First Essex buses (primary)
- BODS SIRI-VM + GTFS - vehicle positions + timetables (fallback)
- GTFS scheduled times - static timetables (last resort)
| API | Purpose |
|---|---|
| First Bus | Real-time departure times |
| BODS SIRI-VM | Real-time vehicle positions |
| BODS GTFS | Static timetable data |
| NAPTAN | Bus stop data (pre-bundled) |
| postcodes.io | Geocoding (free, no API key) |
Uses IndexedDB for offline-first experience:
- Bus stops: 7 days
- Departures: 60 seconds
- Timetables: 1 day
This app is configured as a Progressive Web App. To complete PWA setup:
- Add icon files to
public/icons/:icon-192.png(192x192)icon-512.png(512x512)
MIT