COOKIE_SECRET: required Should be a large, unguessable string.
URL: required The url (protocol, host, port) where your app lives. This is used as the Persona audience, and must match what you see in your browser’s url bar exactly.
DATABASE_APP: required Mongo url for your app database.
DATABASE_TEST: optional Mongo url for your test database, required if you want to run tests.
PORT: optional Port the server will run on. Defaults to 3000.
DEV: optional Run in development mode. Defaults to false.
NEWRELIC_KEY: optional Your newrelic license key, if you have one. Setting this turns on New Relic logging.
NEWRELIC_NAME: optional Your app name in New Relic.
NEWRELIC_LOG_LEVEL: optional The log level to use.
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.
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:
set the following configuration:
GOOGLE_EMAIL: the email address of an account with read access on the spreadsheet
GOOGLE_PASSWARD: the password for the same account
GOOGLE_KEY: the spreadsheet key, found in the url
e.g. https://docs.google.com/spreadsheet/ccc?key={THIS IS THE KEY}&usp=drive_web#gid=0†
build your spreadsheet as follows
define your badges using as many sheets as you would like with the following column names
Badge name: name
Description: description
Tags: comma-separated list of tags
Creator: creator
Image file: url of badge image
Criteria: criteria as HTML‡
Keeping: rows with a blank cell here will be skipped
define your pathways, one sheet per pathway with the following column names
Name: name
Description: description
Image file: url of pathway image
Tags: comma-separated list of tags
Creator: creator
Badge name: name of badge to include in pathway
X: x position on grid, starting at 0
Y: y position on grid, starting at 0
Core: any value here indicates this badge is core to this pathway
Note title: title of note
Note body: body of note
on the first line, fill out Name through Creator
for each badge in the pathway, fill out Badge name through Core
for each note in the pathway, fill out X, Y, Note title, and Note body
make sure all pathway sheets have the word “pathway” in the sheet name
† 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.
discovery
Discovery tool for Open Badges
Quick Start
With mongo running locally…
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.jsonfile, or environment variables.For example,
node app --cookieSecret=macadamianutsor adding aconfig.jsonwith the contents:are equivalent to setting
COOKIE_SECRETin the environment.See js-config-store for more information.
Developers
Data Setup
app/fake-data.jsis currently defunct. You can runnode app/google-datato 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:
GOOGLE_EMAIL: the email address of an account with read access on the spreadsheetGOOGLE_PASSWARD: the password for the same accountGOOGLE_KEY: the spreadsheet key, found in the urlhttps://docs.google.com/spreadsheet/ccc?key={THIS IS THE KEY}&usp=drive_web#gid=0†Badge name: nameDescription: descriptionTags: comma-separated list of tagsCreator: creatorImage file: url of badge imageCriteria: criteria as HTML‡Keeping: rows with a blank cell here will be skippedName: nameDescription: descriptionImage file: url of pathway imageTags: comma-separated list of tagsCreator: creatorBadge name: name of badge to include in pathwayX: x position on grid, starting at 0Y: y position on grid, starting at 0Core: any value here indicates this badge is core to this pathwayNote title: title of noteNote body: body of noteNamethroughCreatorBadge namethroughCoreX,Y,Note title, andNote body† 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
jshintand tests before commits. Feel free to propose changes to the jshint configuration; it is by no means final.It also runs
bin/beautify --warnwhich will report files that don’t live up to formatting conventions, but currently will not fail the validation step. Runbin/beautify -hfor 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.