Git Product home page Git Product logo

onesubaway's Introduction

Simple Flask + Backbone.JS app to display the subway times for the nearest stations for NYC MTA

Prereqs:
- Flask (pip install Flask)
- Backbone, Underscore, JQuery (referenced from CDN)
- MySQL
- Pandas (pip install pandas)
- protobuf (pip install protobuf)
- Python GTFS-realtime Language Bindings (pip install gtfs-realtime-bindings)
- SQLAlchemy (pip install sqlalchemy)


Steps:
- Start MySQL server
- Init the MySQL Database: $ mysql -uroot < sqlfiles/create_tables.sql
- Add the helper function and procedure: $ mysql -uroot < sqlfiles/helper_functions.sql
- Import data from text files into the MySQL server: $ python import_csv.py
- Start the webserver: $ python site.py




Hosted:
http://ec2-52-11-54-76.us-west-2.compute.amazonaws.com:5000/


Notes:
- I focused on the backend, but I did use Backbone.JS as the front-end framework to display the data
- Flask is used on the backend to serve the API endpoints to get data from the MySQL database, Backbone hits these endpoints to gather its data. This means the back and front end are completely independent of each other and can be changed if needed. A service oriented architecture was the best choice in my opinion.
- The app is extreeeemly slow. The MySQL queries take an enormous amount of time, so data collection and faster queries would be the focus if I spent more time on this. There are plenty of inefficiencies that I would devote my time to.

onesubaway's People

Contributors

natecham avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.