Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Instance of datajam for sunlightlive.com
JavaScript Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
config
db
docs/app/middlewares
lib/tasks
public
script
spec
.gitignore
.rspec
.rvmrc
Capfile
Gemfile
Gemfile.lock
Guardfile
LICENSE.md
Procfile
README.md
Rakefile
config.ru

README.md

Datajam

A real-time, data-driven platform for reporting live events on the Web.

Product Goals

  1. A platform for reporting live events, with a focus on displaying data and information in accessible ways.
  2. Function as a live CMS. Dynamically populate content areas on an event page for the viewers.
  3. Establish events as core functionality. A public-facing page on Datajam corresponds to an event. Events are created, produced, and ultimately archived.
  4. Embed events on third-party sites.
  5. Comprehensively track metrics for events.

Dependencies and Installation

Datajam is a Rails 3.0 app. It depends on Ruby, RVM, and MongoDB.

After those external dependencies are installed, the app can be installed with:

$ rvm use 1.9.2
$ gem install bundler
$ git clone https://github.com/sunlightlabs/datajam.git
$ cd datajam/
$ bundle install --binstubs
$ bin/rails start

Third-Party Libraries

Bundler takes care of installing all the other Ruby libraries used by Datajam, and the JS libraries are included in the project. But it's still important to know about them:

  • JavaScript
  • Testing:
    • RSpec for unit and functional tests
    • RR for test doubles
    • Capybara to simulate the browser
    • Akephalos for an interface with a headless browser
  • Persistence:
    • Mongoid as an object mapper to MongoDB
  • Deployment:
    • Jammit for static asset packaging
  • Documentation:
    • Rocco for literate programming

Development Guidelines

Datajam is intended to be reused and extended by third parties. As such, certain development guidelines are strictly enforced:

  • Unit test coverage for all files in /app/models and /lib with RSpec.
  • Unit test coverage for all non-DOM, non-IO JavaScript with Evergreen.
  • Acceptance test coverage for all user stories with Capybara.
  • A best effort at JavaScript integration testing with Capybara and Akephalos.
  • All new source files produced (.rb and .js) follow literate programming via Rocco.

Product Architecture

Datajam consists of three pieces:

  1. Front-end: Public-facing part of the app. Presents a view of the event as defined by the back-end. The home page displays the current event (or a message announcing the current event). Alternate views of the current event are available to third parties via the embed mechanism. Archive pages display past events.
  2. Back-end: Administrative area that reporters use. Includes the interface for creating and editing events. Powers the front-end by defining templates for the event views.
  3. Content Plugins: Define a data model and provide UI elements for the back-end and front-end. Both the back-end and front-end are architected to provide hooks for the plugins. Content plugins define specific implementations of content areas for the front-end, and administrative functionality in the back-end.

Custom Content Plugins

Datajam ships with three content plugins: Data Card, Live Chat, and Tweet Stream, which are implemented through Rails Engines. Custom plugin development is possible via hooks provided by Datajam.

More documentation coming soon.

Deploying on Heroku

Note: Not currently functional.

  1. Fork the project on GitHub
  2. Create a /config/settings.yml based off of /config/settings.yml.example
  3. Sign up on Heroku
  4. Follow steps 1-4 of Heroku's quickstart instructions
  5. Set up the MongoHQ add-on

License

Copyright (c) 2011 by the Sunlight Foundation.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Something went wrong with that request. Please try again.