Skip to content

Latest commit

 

History

History
71 lines (50 loc) · 2.96 KB

README.md

File metadata and controls

71 lines (50 loc) · 2.96 KB

hmpps-book-a-video-link-api

repo standards badge CircleCI Docker Repository on Quay API docs

API to support the front end service allowing court and probation users to book and manage video link hearings/appointments with people in prison.

Building the project

Tools required:

  • JDK v21+
  • Kotlin (Intellij)
  • docker
  • docker-compose

Useful tools but not essential:

  • KUBECTL not essential for building the project but will be needed for other tasks. Can be installed with brew.
  • k9s a terminal based UI to interact with your Kubernetes clusters. Can be installed with brew.
  • jq a lightweight and flexible command-line JSON processor. Can be installed with brew.

Start up the docker dependencies using the docker-compose file.

docker-compose up --remove-orphans

Install gradle and build the project

./gradlew
./gradlew clean build

Running the service

There are two key environment variables needed to run the service. The system client id and secret used to retrieve the OAuth 2.0 access token needed for service to service API calls can be set as local environment variables. This allows API calls made from this service that do not use the caller's token to successfully authenticate.

Add the following to a local .env file in the root folder of this project (you can extract the credentials from the dev k8s project namespace).

N.B. you must escape any '$' characters with '\$'

SYSTEM_CLIENT_ID=<system.client.id>
SYSTEM_CLIENT_SECRET=<system.client.secret>

There is a script to help, which sets local profiles, port and DB connection properties to the values required.

./run-local.sh

Testing GOV Notify locally

To test Gov Notify emails locally, you just need to add one more variable to your .env file.

export NOTIFY_API_KEY=<gov.notify.api.key>

If you have added it correctly, you will see the log on startup with the following output:

Gov Notify emails are enabled