We welcome new developers to this project. To see the guidlines on how you can get started and the conventions that are used, follow this guide
Clone the repository
git clone https://github.com/bcgsc/pori_graphkb_api.git
cd pori_graphkb_api
git checkout developInstall the dependencies
npm installTo actually use the API, the orientDB instance must already be running. To configure where the tests will point to the user can either modify config/config.js or set the environment variables which override this config (default values are shown below, this will change depending on how you db server is configured).
GKB_DBS_PASS=root
GKB_DBS_USER=root
GKB_DB_HOST='orientdb02.bcgsc.ca'
GKB_DB_PORT=2480
GKB_KEY_FILE='id_rsa' # used in generating the tokensAfter these options are configured, the full set of tests can be run
npm run testThe non-database tests can be run without the above configuration
npm run test:unitJust the tests which require a database connection can be run with
npm run test:integrationDefault configurations for all non-sensitive content can be set using the various start commands
The local test envinronment should be used for testing without authentication
npm run start:localThe dev test environment should be used for developing against the test keycloak server (can only be used within the same network as the auth server being used). This defaults connecting to the development database (backup of production)
npm run start:devThis example deploys a tag named v1.1.0
SSH to the host server and clone the repository
ssh <SERVER NAME>
cd /var/www/app/graphkb-api
git clone https://github.com/bcgsc/pori_graphkb_api.git v1.1.0
cd v1.1.0
git checkout v1.1.0Install the dependencies
npm installCreate the keyfile
yes | ssh-keygen -t rsa -b 4096 -f id_rsa -N ''Create the logging directories
mkdir logsCreate an env.sh file to hold the configurable environment variables as well as the PM2 ones
export PM2_HOME=/var/www/app/graphkb_api/pm2_logsSet the Database password (It is better not to store this)
export GKB_DBS_PASS=<some password>Now source the file and start your pm2 process
pm2 start config/pm2.config.js --env developmentYou should now be able to view the running process with
pm2 ls