Skip to content
This repository has been archived by the owner on Feb 5, 2021. It is now read-only.

Latest commit

 

History

History
124 lines (77 loc) · 2.95 KB

README.md

File metadata and controls

124 lines (77 loc) · 2.95 KB

Humanitarian ID Web App version 2

Build Status

Running locally

Prerequisites:

Building the app

  • Clone repo git clone git@github.com:UN-OCHA/hid_app2.git
  • In the app directory cd hid_app2
  • Switch to the dev branch git checkout dev
  • Install node modules npm install
  • Install Bower modules bower install
  • Add the local url to your hosts file: on Mac: sudo vi /etc/hosts Add 127.0.0.1 app.hid.vm
  • Run the Grunt tasks grunt (Note to set you local environment to use the staging api use grunt --target="dev")

Running the app

  • If you are using Docker for Mac you will need to add ports to docker-compose.yml
     ports:
    	- 80:80
    
  • docker-compose up
  • visit http://app.hid.vm

Deployment

See https://github.com/UN-OCHA/hid-stack/blob/master/README.md

Code style guide

This project aims to follow the John Papa Angular 1 style guide

Unit tests

Unit tests are written using Jasmine and run with Karma.

Pre-requisites

Install Karma CLI

npm install -g karma-cli

Running the tests

Single run: grunt test

Watch for changes an re-run tests: grunt test-watch

E2E tests

Pre-requisites

Protractor:

npm install -g protractor

webdriver-manager

webdriver-manager update

Java Development Kit (JDK) http://www.oracle.com/technetwork/java/javase/downloads/index.html

Running the tests

npm run protractor

Running a single test suite

protractor --suite="my-suite-name" src/e2e-tests/conf.js

Front end

Styleguide and pattern library

The styleguide and pattern library is available at https://un-ocha.github.io/styleguide/hid/

CSS

This project uses Sass

Run grunt watch to watch for changes and rebuild the css.

Structure

Global styles

Global styles, such as resets and grid styles, should be added to app/common.

Any _*.scss file in app/common (excluding sub-directories) will be automatically added to the CSS build.

Variables and mixins

As variables and mixins need to be imported before other Sass these are added to sub-directories in app/common and manually imported into app/common/_setup.scss

Component styles

Component specific files should be added to that component's directory, e.g. app/components/my-component/my-component.scss.

Any _*.scss file in app/components (including sub-directories) will be automatically added to the CSS build.