acenario / mbta-scheduler

A simple web app to show live data of the commuter rails schedule

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MBTA Commuter Rail Schedule

CircleCI

Assignment

The application should show the upcoming departures at North and South stations, the train destinations, the departure times, the track numbers, and the boarding status (e.g. 'Boarding', 'All Aboard', 'Delayed'). The instructions for where to find the real-time data can be found at mbta.com/developers/v3-api. Obviously, your application does not have to look the same. Just to give you an idea, this is what the real departure board at North Station looks like:

Station

Django Meets MBTA

MBTA Commuter Rail Schedule is a web application that displays live information for MBTA's Commuter Rail. The application is live at mbta.arjunb.com.

Tech

  • Django - Secure, fast, and better web development
  • Jinja2 - HTML/CSS + Jinja2 enables nice frontend+backend development
  • jQuery - jQuery + JS used for frontend polling (future updates will use sockets or event streaming)
  • Materialize - great UI boilerplate for material UI based web apps

Features!

  • Live (15s) view of commuter rail departures from both North & South Station
  • Extendable MBTA Class to increase functionality, add more options
  • Secured web application without compromising on CSRF or CORS

Installation

MBTA Commuter Rail Schedule requires Python 2 v2.7+ to run. Also requires pip.

You will also need to replace MBTA_KEY in local_settings.py to your own MBTA_KEY for the project to run. Keys are available at api-v3.mbta.com.

Install the dependencies and start the server.

$ git clone https://github.com/acenario/mbta-scheduler
$ cd mbta-scheduler
$ pip install virtualenv
$ virtualenv env
$ source env/bin/activate
$ pip install -r requirements.txt
$ cd CommuterRail
$ mv CommuterRail/local_settings.py.txt CommuterRail/local_settings.py
$ mv CommuterRail/email_info.py.txt CommuterRail/email_info.py
$ python manage.py test
$ python manage.py runserver

For production environments... Will share steps using Gunicorn at a later point.

View the App

You can view the application at mbta.arjunb.com or visit localhost:8000 after running the steps above.

Todos

  • Convert JS Polling to sockets or event streaming
  • Write more tests
  • Separate North/South into separate pages
  • Support API Versioning in MBTA class

About

A simple web app to show live data of the commuter rails schedule


Languages

Language:Python 72.4%Language:HTML 16.1%Language:JavaScript 11.2%Language:CSS 0.3%