Skip to content

The Stack

eturk edited this page Oct 17, 2011 · 3 revisions

In order to work on the clock, you must understand the Stack that it runs on.

The Application

(Almost) everything is written on top of Ruby, a dynamic, reflective, general-purpose object-oriented programming language.

Padrino is a web framework built upon the excellent Sinatra micro-framework. Padrino handles everything: the back-end, the generation of the HTML front-end, cohorting with the database, everything.

It is also loosely based off of the Model-view-controller (MVC) architecture, meaning that the three parts are separate. Models define what the database looks like, and it also cohorts with it. Views are the HTML (or in this case, Haml--I'll get to that later) that define the HTML output. And finally, controllers make everything work. It handles routes, talking to the models, and displaying the views.

MongoMapper is a way to model and persist MongoDB data. It allows Padrino to talk to the database.

Haml is what we use for templates. It generates HTML in a lovely, readable format.

RSpec is a testing framework. It allows me to make sure that the application is doing what it's supposed to.

The Database

MongoDB is a JSON-based, scalable, high-performance, open source, document-oriented database. It is insanely fast and stores all of our data. MongoMapper deals with MongoDB for us.

The Server

Unicorn is a Ruby web server powered by Nginx, so it serves up assets blazing fast. This is what actually runs the clock. It makes it available to the Comcast network within the AV room.

CIJoe is a continuous-integration server that was created by GitHub. It allows us to deploy new versions quickly. It will also revert back to the older version automatically if the "spawning" of the Passenger server fails.

As of now, CIJoe gets POST requests from another, standalone Sinatra app which is watching a Heroku app. That Heroku app is getting POST requests from Github after each commit and it is making the data available as a JSON API.

Clone this wiki locally