User interface for the HMPPS Sentence Plan service. The back-end API code can be found in https://github.com/ministryofjustice/hmpps-sentence-plan.
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
Pull the latest Docker image versions:
docker-compose pull
To run the service locally, with dependencies in Docker:
# Start the dependencies only
docker-compose up -d --scale=app=0
# Start the UI service and watch for changes
npm run start:dev
Open http://localhost:3000 in your browser, and login with the following credentials:
- Username:
AUTH_USER
- Password:
password123456
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 casesROLE_SENTENCE_PLAN_RW
for accessing sentence plans and Delius case information
Create an .env
file at the root of the project:
NODE_ENV=development
REDIS_HOST=localhost
HMPPS_AUTH_URL=https://sign-in-dev.hmpps.service.justice.gov.uk/auth
SENTENCE_PLAN_API_URL=https://sentence-plan-api-dev.hmpps.service.justice.gov.uk
DELIUS_INTEGRATION_API_URL=https://sentence-plan-and-delius-dev.hmpps.service.justice.gov.uk
OASYS_INTEGRATION_API_URL=https://sentence-plan-and-oasys-dev.hmpps.service.justice.gov.uk
INTERVENTIONS_API_URL=https://hmpps-interventions-service-dev.apps.live-1.cloud-platform.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:
# Start Redis only
docker-compose up -d redis
# Start the UI service and watch for changes
npm run start:dev
npm run lint
npm run test
To run the Cypress integration tests locally:
# Start dependencies
docker-compose -f docker-compose-test.yml up -d
# 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
For any issues or questions, please contact the Sentence Planning team via the #hmpps-sentence-plan-dev Slack channel. Or feel free to create a new issue in this repository.