Skip to content

🏭 a data-model aware GraphQL API that sits above an Elasticsearch cluster

License

Notifications You must be signed in to change notification settings

kids-first/kf-api-arranger

Repository files navigation

Kids First repository logo

kf-api-arranger

This is an instantiation of the @arranger/server application for the Kids First portal, with an integration with Keycloak for authentication.

Arranger server is an application that wraps Elasticsearch and provides a GraphQL search API for consumption by the Kids First Portal UI.

Development

  • Execute: npm run cbs

Note: You can execute this project in a docker container if you prefer: docker run -u node -it --rm --network host -v ${PWD}:/app --workdir /app node:20-alpine3.18 sh

General

  • Make sure that all the needed env vars point to where they should.

  • When adding a new env var, update the .env.example. Otherwise, an error will be thrown.

  • Installing dependencies: npm install.

Test

  • Execute: npm run test

Development Setup with Docker

Before going further, make sure that docker and docker-compose are installed on your system.

# 1. clone the repository
  git clone https://github.com/kids-first/kf-api-arranger

# 2. enter the project's folder
  cd kf-api-arranger

# 3. create an .env file (you may have to adjust the template to your needs)
  touch .env

# 4 in a terminal, run docker-compose from project's docker-compose file. 
  docker-compose --profile <target profile> up # for admin service

# 5 to clean up afterwards once your are done developing.
  docker-compose --profile  <target profile> down

Note: you can activate multiple profiles at once: docker-compose --profile a --profile b ... up

⚠️ With this setup, your host and the app's container share the project directory/volume.