Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Backend "proxy" API code for the CLIN project

License

Notifications You must be signed in to change notification settings

Ferlab-Ste-Justine/clin-proxy-api

Repository files navigation

Deprecation

These services are deprecated and will no longer be maintained.

CLIN Proxy API

Creating Services

Boilerplate

app/src/services/api/boilerplate

Default Endpoints

  • GET on /{endpoint}/health returns a health check for the service endpoint
  • GET on /{endpoint}/docs returns the documentation for the service endpoint ( https://editor.swagger.io )

Available Scripts

From the app directory:

  • pnpm start launches of the Services in local development mode.
  • pnpm test launches all test runners using .env file.
  • pnpm run functional-tests start functional tests using newman through Postman collections
  • pnpm run unit-tests start unit tests using mocha
  • pnpm run build builds all of the Services for production mode.
  • pnpm run service-patient starts the Patient API Service in production (built) mode.
  • pnpm run service-variant starts the Variant API Service in production (built) mode.
  • pnpm run service-gene starts the Gene API Service in production (built) mode.
  • pnpm run service-meta starts the Meta API Service in production (built) mode.
  • pnpm run dev-service-xyz launches specified service in docker development mode.

Development Set-up

Directly on Computer

Install Node.js LTS 10.14.1 using nvm and run

./launch-local.sh

Note: if you need to add a ca-certificate add its path in this env var NODE_EXTRA_CA_CERTS in the shell running the project.

Dockerized Version

  • Make sure that a network named proxy exists on your machine
  • Make sure the following services are running on the proxy network with the corresponding names and ports (alternatively, you can edit the docker.local.env file to change the values):
    • keycloak which should be named keycloak on port 8080 (http)
    • elasticsearch which should be named elastic on port 9200
  • Run the following to launch:
./launch-docker-local.sh
  • Run the following to tear down:
./teardown-docker-local.sh

ElasticSearch Set-up

To create the 'statement' and 'profile' indices, run the following command line where ElasticSearch is available (ssh -L or ssh thru environment)

curl -XPUT "http://localhost:9200/statement" -H 'Content-Type: application/json' -d @clin-statement-centric.json
curl -XPUT "http://localhost:9200/profile" -H 'Content-Type: application/json' -d @clin-profile-centric.json

CI/CD Workflow

Pushing images

See the documentation for our convention on gitflow and docker images: https://www.notion.so/ferlab/Developer-Handbook-ca9d689d8aca4412a78eafa2dfa0f8a8

This repo follows it.

Deployments

Updates to the QA environment are automatically done once a new image is pushed. No action is required.

Procedures to deploy to prod will be fleshed out once we have such an environment.