This is the backend for the mbt.guide projects. The code is based off of the backend portion of the appy app which heavliy utilizes the rest-hapi plugin for the hapi framework, which means MongoDB is used as a datastore. Please reference the docs for these tools for details.
You need Node.js (>=8.10.0) installed and you'll need access to a MongoDB database.
$ git clone https://github.com/cusac/mbt.guide-backend.git
$ cd mbt.guide-backend
$ npm install
- Copy .env-sample to .env and edit as needed. Don't commit .env to your repository.
WARNING: This will clear all data in the following MongoDB collections (in the db defined in restHapiConfig.mongo.URI
, default mongodb://localhost/appy
) if they exist: user
, role
, group
, permission
, session
, and authAttempt
.
If you would like to seed your database with some data, run:
$ npm run seed
NOTE: The password for all seed users is root
.
To quickly run the app locally, simply run:
$ npm start
Once the app is running point your browser to http://localhost:8080/ to view the Swagger docs.
Currently the majority of the backend tests are e2e tests that rely heavily on scripts and docker
compose. These can be found in test/e2e
.
To run these tests run (from the root directory):
bash run_e2e.tests.sh
MIT