Giter Club home page Giter Club logo

ministryofjustice.use-of-force's Introduction

Use of Force

CircleCI Known Vulnerabilities

A service to allow recording of Use of Force incidents.

Getting started

The easiest way to run the app is to use docker compose to build the local app as a docker image and download and run the three required containers.

docker-compose pull

docker-compose up

Dependencies

The app requires:

  • HMPPs Auth Service for authentication
  • prison-api to retrieve offender and prison information
  • It's own postgres DB to store report information
  • A REDIS instance for storing sessions

Runing the app for development**

To start the main services excluding the use of force app: docker-compose up --scale=use-of-force=0

Install dependencies using npm install, ensuring you are using >= Node v14.15

And then, to build the assets and start the app with nodemon: npm run start:dev

Accessing the application

Any of the seed users should be able to raise incidents and view their incidents and statements, e.g: username: ITAG_USER, password: password username: CA_USER, password: password123456

There is a reviewer user who will additionally be able to see all incidents on their current caseload: username: UOF_REVIEWER_USER, password: password123456

You can log in as a use of force coordinator in the sample data with the user who will additionally be able to add or delete staff and remove reports: username: UOF_COORDINATOR_USER password:password123456

Once the use of force app has started, there are multiple ways to access the app.

If new nomis is running you can access the home page at http://localhost:3001. Only the leeds caseload has been configured to support use-of-force.

There are two ways of entering use-of-force from new-nomis: 1.) Go to the new nomis homepage and click 'Use of force incidents' to view the user's reports/statements 2.) Go to the new nomis homepage, search for an offender and click 'Report use of force' from the quick details page.

Env variables

In config.js you can see all the required variables. These are set with defaults that will allow the application to run, but you will need to add a .env file at some point.

Run linter

npm run lint

Run tests

npm run test

Running integration tests

For local running, start a test db, redis, and wiremock instance by:

docker-compose -f docker-compose.test.yml up

Then run the server in test mode by:

npm run start-feature (or npm run start-feature:dev to run with nodemon)

And then either, run tests in headless mode with:

npm run int-test

Or run tests with the cypress UI:

npm run int-test-ui

ministryofjustice.use-of-force's People

Contributors

andrewrlee avatar bell-pa avatar brightonsbox avatar gurnankcheema avatar jamiedraperuk avatar jsrobertson avatar louisenorris avatar mattops avatar mikehalmamoj avatar mjwillis avatar petergphillips avatar simonmitchellmoj avatar snyk-bot avatar steverendell avatar timharrison-moj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.