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 up
if using Vagrant, or runVagrantbootstrap.sh
as root to update the system, install MongoDB, nodejs and gulp etc. -
Run
npm install
to 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>-bitedb
to start MongoDB. -
Run
redis-server
to start Redis. -
Define the relevant environment variables by copying
config.sh.default
toconfig.sh
and fill in the blanks, then runsource config.sh
to 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 serve
which 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 watch
to start the server with a watch on file changes.gulp lint
to run JSHint on all.js
files in thesrc
folder.gulp test
to run all tests in thespec
folder.
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