mozilla / openbadges-discovery

INACTIVE - http://mzl.la/ghe-archive - Discovery tool for Open Badges including Pathways and Directory
Mozilla Public License 2.0
24 stars 12 forks source link
inactive unmaintained

discovery

Discovery tool for Open Badges

Quick Start

With mongo running locally...

npm install
echo '{  
  "url": "http://localhost:3000",
  "cookie": {
    "secret": "macadamianuts"
  },
  "database": {
    "app": "mongodb://127.0.0.1:27017/app",
    "test": "mongodb://127.0.0.1:27017/test"
  }
}' > config.json
DEV=1 node app

Then navigate to http://localhost:3000.

This app can also be deployed to Heroku.

Configuration

Parameters

Available app parameters are:

Alternatives

Configuration parameters can be provided via commandline arguments, a config.json file, or environment variables.

For example, node app --cookieSecret=macadamianuts or adding a config.json with the contents:

{
  "cookie": {
    "secret": "macadamianuts"
  }
}

are equivalent to setting COOKIE_SECRET in the environment.

See js-config-store for more information.

Developers

Data Setup

app/fake-data.js is currently defunct. You can run node app/google-data to wipe the app database and load in initial data from a Google spreadsheet as detailed below.

Google spreadsheet data

The Google data reader makes many assumptions about the format of the spreadsheet. In general to load data this way:

This is an older style of Google spreadsheet url, YMMV on the newer updated style.

This mimics retreiving the criteria url a badge would normally provide and parsing the content there to retrieve an HTML snippet for display.

Precommit Hooks

At the moment this project is using precommit-hook to run jshint and tests before commits. Feel free to propose changes to the jshint configuration; it is by no means final.

It also runs bin/beautify --warn which will report files that don't live up to formatting conventions, but currently will not fail the validation step. Run bin/beautify -h for a help statement.

Development Mode

Development mode can be enabled to rebuild CSS, recompile templates and rebuild the clientside JS, unminified, on each request.

This should NOT be turned on for production.