Skip to content

ministryofjustice/hmpps-find-and-refer-an-intervention-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Find and Refer an Intervention Service

repo standards badge CircleCI Docker Repository on Quay API docs

This repository contains the service code for the Find and Refer an Intervention service.

Required software

Most software can be installed using homebrew.

  • Docker
  • Java SDK (OpenJDK 21)

Running the application locally

The application comes with a local spring profile that includes default settings for running locally. This is not necessary when deploying to kubernetes as these values are included in the helm configuration templates - e.g. values-dev.yaml. This run configuration is included in the project local run configuration and can be accessed using the run options in the top right of the window in IntelliJ.

There is also a docker-compose.yml that can be used to run a local instance of the template in docker and also an instance of HMPPS Auth.

Run the following command to pull the relevant dependencies for the project.

  docker-compose pull

and then the following command to run the containers.

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

can optionally be run in detached mode in order to retain terminal use

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

Connecting to local database

The service uses a postgres database alongside flyaway migrations to create and populate the database. To connect to the database locally in your preferred database client (IntelliJ Ultimate, Dbeaver, Pgadmin, etc).

Create new connection using local database credentials;

Variable Value
Port 5432
Username root
Password dev

Authorization

The service uses an Oauth 2.0 setup managed through the Hmpps Auth project. To call any endpoints locally a bearer token must be generated. This can be done through calling the auth endpoint in the Hmpps-auth service.

Variable Value
Grant type Client credentials
Access token URL http://hmpps-auth:9090/auth/oauth/token
Client ID -----
Client Secret -----
Scope Read

For Client ID and Secret refer to the relevant credentials for the Find and Refer Project.

Branch naming validator

This project has a branch naming validator in place in the GitHub action pipeline.

To ensure these pipelines pass the branch name must conform one of the following patterns:

  • FRI-[0-9]/branch-name-here
  • no-ticket/branch-name-here
  • renovate/branch-name-here
  • hotfix/branch-name-here

Formatting

This project is formatted using ktlint.

Run the following command to add a pre-commit hook to ensure your code is formatted correctly before pushing.

./gradlew addKtlintFormatGitPreCommitHook

Troubleshooting

For any issues please reach out to the Find and Refer Interventions team in slack #find-refer-interventions-team

About

Business/domain interface for providing Find and Refer an Intervention Service

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages