A user interface for the Probation Search API. Try it out in the dev environment: https://probation-search-dev.hmpps.service.justice.gov.uk
This project makes use of a re-usable probation search component. To include this in your project, check out the @ministryofjustice/probation-search-frontend package.
You'll need to install:
*If you're already using nvm or fnm, run:
nvm install --latest-npm
at the project root to install the correct Node version automatically.
Install NPM package dependencies:
npm install
To run the service locally, with dependencies in WireMock:
# Mock the dependencies
npm run wiremock
# Start the UI service and watch for changes
npm run start:dev
Open http://localhost:3000 in your browser.
Alternatively, you can integrate your local UI with the dev/test services deployed on MOJ Cloud Platform using a personal HMPPS Auth client. If you don't already have a personal client, request one in the #hmpps-auth-audit-registers Slack channel.
You'll need the following roles:
ROLE_COMMUNITY
for searching probation cases
Create a .env
file at the root of the project:
NODE_ENV=development
ENVIRONMENT_NAME=dev
REDIS_ENABLED=false
HMPPS_AUTH_URL=https://sign-in-dev.hmpps.service.justice.gov.uk/auth
MANAGE_USERS_API_URL=https://manage-users-api-dev.hmpps.service.justice.gov.uk
PRISON_API_URL=https://prison-api-dev.prison.service.justice.gov.uk
# Add your personal client credentials below:
API_CLIENT_ID=clientid
API_CLIENT_SECRET=clientsecret
SYSTEM_CLIENT_ID=clientid
SYSTEM_CLIENT_SECRET=clientsecret
Then, start the UI service:
npm run start:dev
This service also provides the Delius search screen (see /delius/nationalSearch), which is loaded in an iframe in the Delius application. For it to work in a cross-site iframe context, the Express session cookie must be served over HTTPS.
To enable HTTPS during local development, first create a self-signed certificate:
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout key.pem -out cert.pem
Then, in the .env
file, add the following:
INGRESS_URL=https://localhost:3000
HTTPS_KEY=key.pem
HTTPS_CERT=cert.pem
You will also need to add https://localhost:3000/sign-in/callback
as a registered redirect URI for your auth client.
npm run lint
npm run test
To run the Cypress integration tests locally:
# Start the UI in test mode
npm run start-feature:dev
# Run the tests in headless mode:
npm run int-test
# Or, run the tests with the Cypress UI:
npm run int-test-ui
The template project has implemented some scheduled checks to ensure that key dependencies are kept up to date.
If these are not desired in the cloned project, remove references to check_outdated
job from .circleci/config.yml