Skip to content
/ BiTE Public

A SPA-style news app written in Node.js (pre-ES6), MongoDB and Redis and Cloudinary. Backend only (95% my own code).

Notifications You must be signed in to change notification settings

mkock/BiTE

Repository files navigation

BiTE

Introduction

This documentation is in three parts;

Getting Started for Production

Documentation will be added.

Getting Started for Developers

Installation assumes a Debian-based Linux distribution such as Ubuntu 14.04, with Vagrant and Oracle VirtualBox pre-installed.

  1. Run vagrant up if using Vagrant, or run Vagrantbootstrap.sh as root to update the system, install MongoDB, nodejs and gulp etc.

  2. Run npm install to install all dependencies for the backend

  3. 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
  1. Run mongod --dbpath <YYYYMMDD>-bitedb to start MongoDB.

  2. Run redis-server to start Redis.

  3. Define the relevant environment variables by copying config.sh.default to config.sh and fill in the blanks, then run source config.sh to define them in your current shell.

  4. Start the nodejs app:

cd backend
gulp start

(just ignore the environment variable warnings)

  1. 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

  1. Start by going to the frontend directory cd frontend

  2. To install all the dependencies we run npm install && bower install

  3. 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 the src folder.
  • gulp test to run all tests in the spec folder.

Starting services

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

About

A SPA-style news app written in Node.js (pre-ES6), MongoDB and Redis and Cloudinary. Backend only (95% my own code).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published