An Angular 2 based front end for Badgr-server. Uses TypeScript with ES6 style module loading and a webpack-based build process. This is the browser UI for badgr-server.
Badgr was developed by Concentric Sky, starting in 2015 to serve as an open source reference implementation of the Open Badges Specification. It provides functionality to issue portable, verifiable Open Badges as well as to allow users to manage badges they have been awarded by any issuer that uses this open data standard. Since 2015, Badgr has grown to be used by hundreds of educational institutions and other people and organizations worldwide.
nvm use
in a project directory with a .nvmrc
file will use the recommended node version. Make sure to nvm use [VERSION]
the correct version before any npm install
steps.nvm use && nvm install
npm install
Start angular in dev mode: npm start
. Badgr should now be loaded in your browser. If your browser didn't start automatically, navigate to http://localhost:4200
Ensure it is communicating with the correct API (The port badgr-server
is running on)
localStorage.setItem('config', JSON.stringify({api:{baseUrl:"http://localhost:8000"}}))
Run the test suite with npm run test
Run the e2e tests with npm run e2e
To build for production, a environment.prod.ts
file must be present in src/environments/
.
Copy the example file, environment.prod.ts.example
to environment.prod.ts
and modify it as needed.
Similarly for staging/develop builds a environment.staging.ts
/environment.develop.ts
file needs to be present in src/environments
, which (for now) is already added in git.
Build the packaged files for deployment with npm run build
Run the tests with npm run test
All files in dist
constitute the build artifact.
To get the image on the prod server, simply update the release
branch and push it to github.
The rest should happen automatically (thanks to github actions and watchtower keeping the deployed image up to date).
We follow the angular commit message convention in this project to maintain a clean and organized commit history. Use npx cz
instead of git commit
to commit via the interactive prompt.