Project Overview
A transit application utilizing Pittsburgh Regional Transit's BusTime API to provide real-time bus tracking and arrival predictions. Data is updated every 10 seconds, and predictions are live. Service bulletins are scraped every day.
Technologies Used
- React
- Next.js
- Tailwind CSS
- TypeScript
- OpenLayers
Key Features
- Real-time Transit Tracking: Utilizes the BusTime API to provide real-time tracking of buses in the Pittsburgh area.
- Live Arrival Predictions: Provides live arrival predictions for buses in the Pittsburgh area.
- Service Bulletins: Scrapes service bulletins from the Pittsburgh Regional Transit website every day.
Challenges and Solutions
The main challenge for this project was transforming the output of PRT's BusTime API into efficient, usable data. The API provides data in a non-standard schema, without much error handling. Typescript was a huge help in defining schemas, since the API does not provide any. Additionally, converting each vehicle entity to GeoJSON ensured that the API can be added to nearly any GIS platform - including desktop GIS software for high-level analysis.
Outcomes and Lessons Learned
The end result of this experiment is a fully functional frontend based on OpenLayers and NextJS, and a backend using Fastify with GeoJSON libraries. Throughout the project, I was introduced to many technologies - including OpenLayers, Fastify, and GeoJSON - that I had never used before. I also learned a lot about the Pittsburgh Regional Transit API, and how to work with it.