A location-aware, mobile, blazing-fast London bus arrivals website.
Buses consumes Transport For London's bus arrival API, and uses HTML5 geolocation to show the user all bus stops within 300 meters.
It uses Flask, AngularJS, and nginx.
ProTip™ make sure you've got Vagrant installed (it's awesome).
vagrant up
Then check out http://127.0.0.1:8080/ in your browser.
- Your browser requests the page.
- nginx serves static content—including HTML.
- The page's JavaScript gets your location, and then sends a request to the bus arrivals web service.
- The bus arrivals service sends a request to TFL's API, parses the response, and returns JSON—this is the bottleneck; we can't cache this since it has to be realtime.
- We then use AngularJS magic to display the data on the page nicely.
All static content is cached and gzipped—so your next pageload will be blazing fast.
- Vagrant sets up a virtual machine, and uses the provisioning script to install all dependencies (this took a lot of time and effort to get right, but it was worth it).
- Grunt installs front-end dependencies using Bower, and concats and minifies them for production.
Piece of cake.