Skip to content

ministryofjustice/hmpps-tier-ui

Repository files navigation

Tier UI

Repository Standards

A user interface for the HMPPS Tier API. Try it out in the dev environment: https://tier-dev.hmpps.service.justice.gov.uk

Get started

Pre-requisites

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.

Dependencies

Install NPM package dependencies:

npm install

Run the service

To run the service locally, with an in-memory session store and local user account, run:

npm run start:dev

Open http://localhost:3000 in your browser.

Integrate with dev services

Alternatively, you can integrate your local UI with the dev/test services deployed on MOJ Cloud Platform. This removes the need for using Docker.

Create a .env file at the root of the project:

NODE_ENV=development
ENVIRONMENT=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
DELIUS_INTEGRATION_URL=https://tier-to-delius-dev.hmpps.service.justice.gov.uk
ARNS_API_URL=https://assess-risks-and-needs-dev.hmpps.service.justice.gov.uk
TIER_API_URL=https://hmpps-tier-dev.hmpps.service.justice.gov.uk

Run the following to grab client credentials from the dev namespace:

kubectl -n hmpps-tier-dev get secret hmpps-tier-ui -o json \
| jq -r '.data | map_values(@base64d) | to_entries[] | "\(.key)=\(.value)"' \
| grep CLIENT >> .env

Then, start the UI service:

npm run start:dev

Formatting

Check formatting

npm run lint

Fix formatting

npm run lint:fix

Testing

Run unit tests

npm run test

Running integration tests

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

Dependency Checks

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

About

HMPPS Tier Calculation UI

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published