Git Product home page Git Product logo

iq-scm / open-data-certificate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from theodi/open-data-certificate

0.0 0.0 0.0 18.54 MB

The mark of quality and trust for open data

Home Page: https://certificates.theodi.org/

License: MIT License

Shell 0.01% JavaScript 0.13% Ruby 98.94% XSLT 0.09% CSS 0.01% HTML 0.38% Dockerfile 0.01% Haml 0.20% Less 0.19% SCSS 0.01% Sass 0.01% Gherkin 0.04%

open-data-certificate's Introduction

Build Status Dependency Status Coverage Status Code Climate License Badges

Open Data Certificates

This source code is for the ODI's Open Data Certificates app at certificates.theodi.org. The online assessment tool allows publishers to assess how good their open data release is across technical, social, legal and other areas. When published, a certificate (which can be Bronze, Silver, Gold or Platinum) shows data reusers how much they can trust and rely on the dataset

License

This code is open source under the MIT license. See LICENSE.md file for full details.

Summary of features

Open Data Certificate is an online assessment tool for open data releases powered by Rails.

Follow the public feature roadmap for Open Data Certificates

Development

Requirements

ruby version 2.1.8

Environment variables

Some extra environment variables are required for the certificates site; these can be set in a .env file in the root of the project. The docker setup will create this file if it doesn't already exist.

Required

# A hostname to create links in emails
CERTIFICATE_HOSTNAME="localhost:3000"

# Redis server URL
ODC_REDIS_SERVER_URL="redis://redis:6379"

Optional

The following extra are needed in production or for optional features:

# Rackspace credentials for saving certificate dumps
RACKSPACE_USERNAME
RACKSPACE_API_KEY
RACKSPACE_CERTIFICATE_DUMP_CONTAINER

# Juvia details to allow commenting
JUVIA_BASE_URL
CERTIFICATE_JUVIA_SITE_KEY

# Sending error reports to airbrake
AIRBRAKE_CERTIFICATE_KEY

# Enable footnotes for debugging info
ENABLE_FOOTNOTES=true

Specific Development Notes

Development: Running the full application locally

With Docker

The simplest way to get a certificates app up and running is under Docker.

OSX
  1. Install Docker Toolbox
  • Set up a Docker host with docker-machine start default or run the Kitematic GUI.
  • Make sure your terminal can talk to Docker
    • either by opening the 'Docker Quikstart Terminal'
    • or adding eval $(docker-machine env default) to your .bashrc
  1. Install VirtualBox
  2. Set TLS envronment variable
  • export COMPOSE_TLS_VERSION=TLSv1_2
  1. Run bin/dockerize
  • Make note of successfully built docker machine IP address eg Connection to 192.168.99.100 port 3000 [tcp/hbci] succeeded!
  1. Make tea
  2. Everything should be set up and be open in your browser.
  3. Run docker-compose run web bin/setup
  4. App will be available at (depending on your docker machine IP address) http://192.168.99.100:3000/en
Linux
  1. Install docker-engine, docker-compose, and then docker-machine
  2. Set up a Docker host with docker-machine create -d virtualbox default
  3. Run bin/dockerize
  4. Make tea
  5. Everything should be ready and the script will try to open the browser
  • If it doesn't, hit ctrl-c and check all 4 containers are up with docker-compose ps
  • Then point your browser to the address:port for the opendatacertificate_web_1 container (likely 0.0.0.0:3000)
  1. Run docker-compose run web bin/setup
Without Docker
  1. Install Ruby 2.1.8, and bundler.
  2. Install and run Redis and MySQL servers.
  3. Run bin/setup (generates .env file)
  4. edit the default config/database.yml #TODO with what?
  5. Run bundle exec rails s

If you're not using docker, ignore the docker-compose run web prefix on the commands below.

Known issues

eventmachine rubyracer

Application Configuration

Default Admin User

Both of the above methods should set up your local app with a default admin user:

Internationalisation

By default, only the UK survey is built in development, as building more can take a while.

To build a specific country survey (AU used as an example):

docker-compose run web bundle exec rake surveyor:build_changed_survey FILE=surveys/generated/surveyor/odc_questionnaire.AU.rb

To build a few surveys:

docker-compose run web bundle exec rake surveyor:build_changed_surveys LIMIT=5

To build all the other surveys (remember, this can take a while):

docker-compose run web bundle exec rake surveyor:build_changed_surveys

For information on how to translate and localise surveys, see below.

Testing

To run tests:

docker-compose run web bundle exec rake test

You can also run tests continuously whenever a file is changed:

docker-compose run web bundle exec guard

API

Certificates can be created and updated using a JSON API. See the API documentation for details.

Application Functionality

Admin functions

To mark a user as being an admin use the rails console to set the admin field to true. The easiest way to find the ID is to look on the URL of their account page.

User.find(<id>).update_attributes(admin: true)

Admins are able to block a dataset from displaying on the public /datasets page by visiting the dataset and toggling the visibility at the top of the page.

Removed datasets are listed at /datasets/admin (only accessible by admin users).

Autocompletion

The survey attempts to fetch answers from the documentation URL and fill them into the questionnaire. These answers are marked as autocompleted.

Surveys can be autocompleted if the pages machine-readable metadata in the following formats:

  • DCAT
  • Datapackage
  • CKAN

Some examples of URLS that can be autocompleted:

Additional documentation

App approach document

The original prototype has been moved to /prototype.

open-data-certificate's People

Contributors

4foot30 avatar adamgoodapp avatar anna-d-scott avatar benfoxall avatar carlwood avatar cjkenworthy avatar danielgavrilov avatar dependabot-support avatar dependabot[bot] avatar digitalwestie avatar floppy avatar francescadechiara avatar hendranna avatar jamesroypoulter avatar jdeslangles avatar jenit avatar jolankester avatar langphil avatar morty avatar olivierthereaux avatar pavling avatar peterjwest avatar pezholio avatar pkqk avatar quadrophobiac avatar shevski avatar stephen-gates avatar the-skas avatar tonymarklove avatar zoul 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.