API for the Strengths and Needs assessment service.
The service and all of its dependencies are run in Docker containers.
To start it, run:
make up
The service is on http://localhost:8080
To check the status, go to http://localhost:8080/health
The UI can be accessed on http://localhost:7072
The Swagger docs are on http://localhost:8080/swagger-ui/index.html
To update containers
make down update up
To start the API in development mode, run:
make dev-up
To enable live-reload after starting in development mode, run:
make watch
A remote debugger can be attached to the containerised JVM on port 5005
To generate an authentication token (JWT) for the local API, run:
make dev-api-token
Run make
to see the full list of dev commands.
make lint
to run the linter.
make test
to run the test suite.
Deployments of the main branch to Development -> Preproduction -> Production are automated through the Main workflow in GitHub Actions.
To deploy a branch manually to the Dev or Test environment, go to the Actions tab on GitHub and follow these steps:
- Select the "Deploy to environment" workflow
- Click "Run workflow"
- Select the branch you wish to deploy
- Select the environment you wish to deploy to
- Optionally input an image tag (from the Docker registry)
- Click "Run workflow"
- Switch to the Kubernetes context/namespace of the database you are connecting to
make db-port-forward-pod
to create a DB port-forwarding pod in the namespacemake db-port-forward
to forward traffic from your machine to the pod
Then open a new terminal and either:
make db-connect
to connect to the remote DB on the command line
or
make db-connection-string
to output a connection string for your database IDE
To export the remote DB (saved locally as out.sql), run:
make db-export
- hmpps-auth - for authentication using OAuth/JWT
- PostgreSQL - for persisting assessment data