Giter Club home page Giter Club logo

driveshaft's Introduction

Driveshaft

Driveshaft is a Sinatra application built to turn Google Spreadsheets and Google Documents into JSON with the click of a button.

Quickstart

For the full user guide, please refer to the documentation. Or, if you're somewhat familiar with Ruby applications and Google Authentication / S3, use this quickstart guide to get up and running.

Heroku Quickstart

Deploy instantly with Heroku.

Deploy

Dependencies

Be sure to have the following system dependencies installed:

# Git, Ruby, Node
$ brew install git node ruby

# Bower
$ npm install -g bower

# Bundler
$ gem install bundler

Clone the repository and resolve app dependencies

$ git clone [email protected]:newsdev/driveshaft.git
$ cd driveshaft
$ bower install
$ bundle install

Environmental Variables

Driveshaft uses environmental variables for configuration. Set the following variables either at runtime on the commandline, or in your /~.bash_profile.

Set at least one, or several, of the following to authenticate against the Google API. You will need to set up a Google Developers Project with the Drive API enabled. Then create a set of credentials. Public API Keys, and any of the three OAuth2 mechanisms, are supported.

To use an API Key, set GOOGLE_APICLIENT_KEY to the key. For any type of OAuth certificate, set the variable to a path to the certificate file, or the contents of the certificate itself.

# Public API Key
GOOGLE_APICLIENT_KEY="***"

# Native Application Client
GOOGLE_APICLIENT_CLIENTSECRETS_INSTALLED="***"

# Web Application Client
GOOGLE_APICLIENT_CLIENTSECRETS_WEB="***"

# Service Account
GOOGLE_APICLIENT_CLIENTSECRETS_SERVICEACCOUNT="***"

Required for S3 access. Use credentials that have access to any S3 buckets you wish to use.

AWS_ACCESS_KEY_ID="****"
AWS_SECRET_ACCESS_KEY="****"
AWS_REGION="us-east-1"

Driveshaft settings:

DRIVESHAFT_SETTINGS_AUTH_REQUIRED="false" # true to require client-side login
DRIVESHAFT_SETTINGS_AUTH_DOMAIN="nytimes.com" # restrict login to a single domain
DRIVESHAFT_SETTINGS_MAX_VERSIONS="5" # set to a maximum number of previous file versions to keep on S3

Optional drive key and s3 destination for a Google Spreadsheet to use to power the index page. It should follow the format of this spreadhseet (you can copy the spreadsheet into a new one to start).

DRIVESHAFT_SETTINGS_INDEX_DESTINATION="s3://BUCKET/PATH.json"
DRIVESHAFT_SETTINGS_INDEX_KEY="DRIVE_KEY"

Run the app locally

$ puma

http://localhost:9292/

Documentation

Documentation is available on the gh-pages branch. To view or contribute to the docs, checkout that branch, and run the following to start the documentation server:

gem install jekyll
jekyll server

Contribute

Questions / comments / feature requests / concerns? Please use the Issues page.

Contributors

Released at the OpenNews Code Convening at the 2015 Write The Docs conference, with the support of the Knight Foundation and The Mozilla Foundation.

License

The documentation and code are licensed under the Apache License, Version 2.0.

Copyright 2015 The New York Times Company.

driveshaft's People

Contributors

abstrctn avatar kevinschaul avatar samjacoby avatar

Watchers

 avatar  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.