KTMB Tracker
by Fikri
by Fikri
Introduction
For this project, I have built a real-time train tracking application for KTMB (Keretapi Tanah Melayu Berhad) to visualize live train positions on an interactive map. The application leverages GTFS (General Transit Feed Specification) Realtime data and Protocol Buffers.
What I have done & learnt
The application fetches vehicle position data from API, which is encoded as Protocol Buffers.A protobuf decoder then loads the GTFS Realtime schema and decodes binary data. Static data also been used to enrich the data point before plotted on an interactive map.
Project stack/ packages
- React with TypeScript
- Vite
- Tailwind
- Leaflet
- protobufjs
- PapaParse
Improvements
- Add train status indicators (on-time, delayed, cancelled) based on schedule adherence.
- Github actions to rebuild the app automatically when the static data is fetched daily.