This documentation is in three parts;
- Readme for the BITE Backend.
Readme for the BITE Frontend.Readme for the BITE Admin.
Documentation will be added.
Installation assumes a Debian-based Linux distribution such as Ubuntu 14.04, with Vagrant and Oracle VirtualBox pre-installed.
-
Run
vagrant upif using Vagrant, or runVagrantbootstrap.shas root to update the system, install MongoDB, nodejs and gulp etc. -
Run
npm installto install all dependencies for the backend -
Go download and upzip the test database
curl -O https://<region>.amazonaws.com/<path-to-db>/<YYYYMMDD>-bitedb.tar.gz
tar -zvxf <YYYYMMDD>-bitedb.tar.gz
rm <YYYYMMDD>-bitedb.tar.gz-
Run
mongod --dbpath <YYYYMMDD>-bitedbto start MongoDB. -
Run
redis-serverto start Redis. -
Define the relevant environment variables by copying
config.sh.defaulttoconfig.shand fill in the blanks, then runsource config.shto define them in your current shell. -
Start the nodejs app:
cd backend
gulp start(just ignore the environment variable warnings)
- Start interacting with the application. Assuming that the application is running on
localhost:5000, you will then find;
- The API running on
http://localhost:5000/v1/.../ - The API documentation running on
http://localhost:5000/documentation - The admin panel running on
http://localhost:5000/admin
You are now done setting up the backend and we can move forward to the frontend
-
Start by going to the frontend directory
cd frontend -
To install all the dependencies we run
npm install && bower install -
Then lastly run
gulp servewhich will serve up a dev version, with some filewatchers working.
_Note that the guide hasn't been adapted to production purposes and may change.
Other useful gulp commands:
gulp watchto start the server with a watch on file changes.gulp lintto run JSHint on all.jsfiles in thesrcfolder.gulp testto run all tests in thespecfolder.
During development, you probably want to start each server-side service manually so you can start/stop them easily and watch their runtime behaviour. The following console commands shows how to start each service in the current Vagrant environment;
/usr/bin/mongod --dbpath /home/vagrant/data/db/- starts mongo/home/vagrant/redis-2.8.17/src/redis-server redis.conf- starts redis/bite/node_modules/gulp/bin/gulp.js /bite/app.js- starts the node app