Skip to content

ministryofjustice/hmpps-community-accommodation-tier-2-ui

Repository files navigation

Community Accommodation Service Tier-2 UI

repo standards badge CircleCI

The frontend for Tier 2 of the Community Accommodation Service (CAS-2).

Prerequisites

  • Docker
  • NodeJs

Setup

When running the application for the first time, run the following command:

script/setup

This will create .env files and install dependencies.

Running the application

To run the application there are two options.

1. Using AP Tools

In order to spin up a full stack of a working API and other dependant services we recommend using the AP Tools.

NB. The approach AP Tools takes solves a critical limitation for working in development. Due to how the frontend and API authenticate requests they both require access to the same instance of hmpps-auth. This project is the focus of our development tooling across all CAS services and is most likely to receive future updates.

After following the set up the common commands are:

ap-tools server start --local-ui --local-api

(remove the local-ui or local-api flags as needed)

The service should then be available at http://localhost:3000

To stop run

ap-tools server stop

Log in credentials are documented within AP tools.

2. Manually

TBD

Run linter

npm run lint

Run unit tests

npm run test

Running integration tests

Tun tests in headless mode with:

npm run test:integration

Or run tests with the cypress UI:

npm run test:integration:ui

Running e2e tests

Install Playwright

npm install
npx playwright install

When using the Playwright UI for the first time you will need to filter by projects by enabling them in the top right.

Test against local environments with and without UI:

npm run test:e2e:local:ui
# or
npm run test:e2e:local

Test against the real dev environments with and without UI:

npm run test:e2e:ui
# or
npm run test:e2e

Enable maintenance mode

Set the environment variable IN_MAINTENANCE_MODE to true in the helm values of the intended environment and all traffic will be redirected to a static page.

Users with the CAS2_ADMIN role are an exception to this for testing purposes.

Manage infrastructure & view logs

This application is hosted on the MoJ Cloud Platform. For further details head over to our infrastructure documentation.

About

The user interface for Community Accommodation Service Tier 2

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published