Skip to content

Developer Guide

Or Abramovich edited this page Jun 25, 2018 · 14 revisions

created by @OrAbramovich.
edited by @alonttal.

Welcome aboard!

Prerequisites

  1. Node.js (version 8.9.1)
  2. Mongodb (version 3.4).
  3. Git client.
  4. Github account.

First Steps

The first step is pulling the source files of the project from our git repository: https://github.com/TechnionYearlyProject/Roommates

After pulling files, you need to download dependencies (such as Express) by running: npm install inside the following directories (some dependencies are for the back-end and some for the front-end):

  1. Project main directory.
  2. Views directory.

Working on the Back-end

  1. You can run the backend by the following command: npm start
  2. You also have to run the DB by running: /path/to/mongod --dbpath path/to/local/db
    mongod is located where you've installed mongodb and --dbpath is any location on your HD where you decide to save the db records.
  3. You can run the unit tests by the following command: npm test

Writing Unit Tests

Unit tests are part of our definition of done. All the tests file are located at the "tests" directory and organized in the same file structure as the modules they are testing. E.g a test file for the module "services/geolocation.js" will be saved here: "tests/services/geolocation.test.js". The notation of the name is: [name_of_the_module].test.js. The name must include the suffix ".test.js" since our tests engine recognizes the test files by this way.

Each push is going to pass through:

  1. TravisCI
  2. Codecov

Working on the Front-end

All front-end files are located in the Views directory.

  1. Images and other static assets have to be added to the "static" directory.
  2. Components have to be added to the src/components directory.
  3. Pages have to be added to the src/pages directory.
  • Run the front-end from the views directory, located in the project's root directory, by running: npm run dev
    After that you will be able to access the UI through: http://localhost:8080

Documentation

All the project documentations can be found on GitHub Wiki in a the right panel, conveniently organized by subjects.

Deployment

The web is hosted in Heroku service.

Site url: https://powerful-tundra-42649.herokuapp.com/

Heroku deployment instructions:
Download heroku cli from: https://devcenter.heroku.com/articles/heroku-cli

Login to heroku from project directory using:
heroku login (contact us to get the password)
username: roommatesyearlyproject@gmail.com
password: ***********

Add remote to local reposiroty:
heroku git:remote -a powerful-tundra-42649

Commit changes:
git add .
git commit -m "..."

Push to heroku:
git push heroku master

for any further questions, please contact us.

Clone this wiki locally