Discovery tool for Open Badges
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.
Available app parameters are:
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.
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.
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 url
https://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 noteName
through Creator
Badge name
through Core
X
, Y
, Note title
, and Note 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.
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 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.