Skip to content

ministryofjustice/hmpps-non-associations-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HMPPS Non-associations API

CircleCI Docker Repository on Quay Runbook API docs Event docs

This application is the REST api and database that owns prisoner non-association data.

Running locally against dev/T3 services

This is straight-forward as authentication is delegated down to the calling services in dev environment.

Use all environment variables starting with API_BASE_URL_ from helm chart values. Choose a suitable hmpps-auth oauth client, for instance from kubernetes hmpps-incentives-api secret and add NON_ASSOCIATIONS_API_CLIENT_ID and NON_ASSOCIATIONS_API_CLIENT_SECRET.

Start the database and other required services via docker-compose with:

docker compose -f docker-compose-local.yml up

Then run the API; for example using IntelliJ.

Testing and linting

Run unit and integration tests with:

./gradlew test

Run automatic lint fixes:

./gradlew ktlintformat

Connecting to AWS resources from a local port

There are custom gradle tasks that make it easier to connect to AWS resources (RDS and ElastiCache Redis) in Cloud Platform from a local port:

./gradlew portForwardRDS
# and
./gradlew portForwardRedis

These could be useful to, for instance, clear out a development database or edit data live.

They require kubectl to already be set up to access the kubernetes cluster; essentially these tasks are just convenience wrappers.

Both accept the --environment argument to select between dev, preprod and prod namespaces or prompt for user input when run.

Both also accept the --port argument to choose a different local port, other than the resource’s default.

Architecture

Architecture decision records start here