Train Times App Using Create React App
30/09/2020
🚉Table of Contents
Intro
This post was inspired by having to use the Network Rail app everyday to check train times whilst commuting to Manchester. It's not a bad app but the UI isn't the best so obviosuly being a developer this means it's a great reason to create an app that I can use to quickly search for the latest trains from home to work.
What It Uses
- Create React App
- Styled Components
- Transport API
- React Cookie
At it's heart is the Transport API. This is a free resource (if you don't have to send many requests per second, so there's obviously a limit) that has a lot of information such as train timetables, bus timetables and more to play with. The API I am using is simple enough to give it point A and point B and it will return an array of trains that are due to arrive between those stations. The information can be seen within the console on the app (link below) once you enter two stations to go from and to. The below image shows a snapsot of the information retrieved from the API.
Future
Eventually I would like to rebuild the app with better organisation of code and more accessible components. As a first pass to get something working I don't think it's to bad but there is definitely much to improve.