Giter VIP home page Giter VIP logo

mp-dashboard's Introduction

The MinnPost Dashboard is an internal tool for tracking and displaying metrics across the organization. It is based on the Dashing platform. The main feature added is the ability to periodically save metrics so that historical records can be kept.

Install and configure

  1. gem install dashing
  2. Set environment variables (see below)
  3. bundle install && bundle exec rake db:migrate

Settings

This project connects to many different services and has a number of configuration settings. These are managed with environment variables.

  1. export DASHING_AUTH_TOKEN=your_token
  2. export DASHING_OAUTH_DOMAIN=minnpost.com
  3. export [email protected] (See Google API keys above)
  4. export DASHING_GAPI_PRIVATE_KEY="<LONG_STRING>" (See Google API keys above)
  5. export MAILCHIMP_API_KEY=your_api_key

Google API for analytics.

To access Google Analytics, we must use the Google API. Some help about keys here.

  1. Go the Google API Console and create a new project.
  2. Enable Google Analytics
  3. Under API Access, click Create an OAuth 2.0 client ID
  4. Give it a product name
  5. Choose Service Account
  6. Download key
  7. Add the email address for the key to Google Analytics access
  8. Set environemtn variable for email: export [email protected]
  9. Parse out OpenSSL cert using irb: Google::APIClient::KeyUtils.load_from_pkcs12('<PATH_TO_KEY>', 'notasecret').inspect. This will output a multi-line key string. Set it as an environment variable and make sure to use double quotes: export DASHING_GAPI_PRIVATE_KEY="<LONG_KEY>"

Run locally

  1. dashing start

Deploy

Deployable on Heroku, see these instructions.

Configure

Set configuration. See the settings above, and use the following format to set them on Heroku:

  1. heroku config:set RACK_ENV=production
  2. heroku config:set SETTING=value

Install a database

  1. heroku addons:add heroku-postgresql
  2. This does not seem right, but the app requires a DATABASE_URL which heroku should make on deploy, but this is not working, so manually do this. See your DB config with heroku config, then: heroku config:add DATABASE_URL=the_string_from_the_other_config_value
  3. heroku run bundle exec rake db:migrate

Install New Relic monitoring

In order to keep the Heroku instance running so that the long form scheduled tasks can run, New Relic is used to ping the website often. This is hackish but allows to use Heroku.

  1. heroku addons:add newrelic:standard
  2. heroku config:add NEW_RELIC_APP_NAME=<YOUR_APP_NAME>
  3. Once data is available in the New Relic dashboard, go to Settings > Availability monitoring and set a ping.

Authentication

Authentication is setup to use Google OAuth. Set up with these instructions.

mp-dashboard's People

Watchers

Alan Palazzolo avatar James Cloos avatar Kaeti 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.