MSFREACH / msf-reach

Web platform for MSF-REACH
https://msf-reach.org/
4 stars 5 forks source link

msf-reach

Data server and web content for CogniCity MSF, built with NodeJS to provide JSON APIs to Postgres objects and accompanying web pages.

Build Status

Coverage Status

Dependencies

Local environment

For running locally, make sure you have a .env file with any overrides for src/config.js, and also update public/resources/js/events.js#L9 to your localhost (and port number as per config). Use of cognito for authentication is disabled by default to make local testing easier (but enabled for our hosted environment).

Environment variables

Login

If using Cognito: Set AWS_COGNITO_ALGORITHM to 'RS256', and AWS_COGNITO_PEM to the public key incl. line breaks—on AWS ElasticBeanstalk where line breaks are not supported in environment variables you need to replace new lines with commas when entering the environment variable, which will be converted back to line breaks in the code.

If using Active Directory: Set the AZUREAD* variables with values supplied by AD operator.

Either way, set AUTH=true to force users to login (otherwise if false it will bypass login for local test and development)

Other environment variables:

Build and Run

Code is written in ES2015 and compiled with babel to a dist folder. To build and run locally:

npm run start

To build for deployment:

npm run build

Database

The database schema can be found in msf-reach-schema.

Testing

Integration tests run using unit.js and mocha. ESLint is used for formatting. For more information see doc/TESTING.md

To run tests, do:

$ npm test

Testing is run on travis-ci.org.

Data Formats

Documentation

Further documentation can be found in doc/ including: