A dashboard to support OpenActive API users & publishers
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.github
bin
config
lib
public
spec
views
.gitignore
.travis.yml
Dockerfile
Gemfile
Gemfile.lock
LICENSE
README.md
config.ru
dashboard_app.rb
dashboard_helpers.rb
dockerize.sh
run-tests.sh

README.md

Build Status Coverage Status

OpenActive Logo

OpenActive Dashboard

A dashboard to support Openactive API users/publishers.

Quick Run

If you have docker installed you can build and launch the API Dashboard with the dockerize.sh script. All you need to do is clone the repository and from the project directory run the script:

  1. Install docker
  2. git clone https://github.com/openactive/api-dashboard.git
  3. cd api-dashboard
  4. ./dockerize.sh

Getting started with development

The API Dashboard is built with Sinatra, a Ruby web application framework. The dashboard uses Redis to store API calls.

To manage versions of Ruby we recommend installing rbenv or rvm.

Once you have the requisite ruby version, install gems using bundle install. Once installed you should be able to launch the application with the command bundle exec rackup. The application should be available at: http://localhost:9292.

For the application to work you will also need to have a redis server running. The application will try to connect to the default redis host and port (127.0.0.1:6379). Alternatively, you can specify the host and port with the environment variables OA_REDIS_HOST and OA_REDIS_PORT. NB the application reads these, and other environment variables in config/environment.rb.

Tests

The API Dashboard use the Rspec test suite. To run the tests install the testset gems with bundle install, and then run bundle exec rspec.

Command Line Tools

Metadata

There is a script you can run to update the dashboard metadata. To run:

bundle exec ./bin/update_metadata.rb

Or on Heroku:

heroku run bundle exec ./bin/update_metadata.rb

This script checks if the metadata has been updated recently. If you want to force it to update, provide an -f flag, e.g.:

bundle exec ./bin/update_metadata.rb -f

Summary

There is a script you can run to update the dataset summaries. To run:

bundle exec ./bin/update_summaries.rb

Or on Heroku:

heroku run bundle exec ./bin/update_summaries.rb

This script pages through the data and saves the page where it stopped. Subsequent updates will pick up where it left off.

If you want to build a summary sampling from the first page you can provide the --restart option to restart from the beginning. E.g.

bundle exec ./bin/update_summaries.rb --restart

If you want to clear the summary, but coninue from the last page, you can provide the --last-page-restart option e.g.

bundle exec ./bin/update_summaries.rb --last-page-restart

Attribution

Contains National Statistics data © Crown copyright and database right [2017]