This application is the REST api and database that owns prisoner non-association data.
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.
Run unit and integration tests with:
./gradlew test
Run automatic lint fixes:
./gradlew ktlintformat
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 decision records start here