Skip to content

Latest commit

 

History

History
53 lines (38 loc) · 2.2 KB

development.md

File metadata and controls

53 lines (38 loc) · 2.2 KB

Running and developing locally

Method 1 - connecting to the services in the DEV environment

  1. Ensure that you have env varNODE_OPTIONS set to -r dotenv/config, else the .env file will not be read

  2. Create a .env file in the root of the project with the following content - Note - you will need to get the secret values from DEV:

   ENVIRONMENT_NAME=dev
   REDIS_ENABLED=false
   HMPPS_AUTH_URL="https://sign-in-dev.hmpps.service.justice.gov.uk/auth"
   TOKEN_VERIFICATION_API_URL="https://token-verification-api-dev.prison.service.justice.gov.uk"
   CALCULATE_RELEASE_DATES_API_URL="https://calculate-release-dates-api-dev.hmpps.service.justice.gov.uk"
   PRISON_API_URL="https://api-dev.prison.service.justice.gov.uk"
   PRISONER_SEARCH_API_URL=https://prisoner-search-dev.prison.service.justice.gov.uk
   API_CLIENT_SECRET= FILL THIS IN WITH SECRET FROM DEV!!
   SYSTEM_CLIENT_SECRET= FILL THIS IN WITH SECRET FROM DEV!!
  1. Start a local calculate-release-dates service with $ npm run start, which will use the .env file to set up its environment to reference the DEV APIs.

  2. Bear in mind that the login details, and all data you will see, will be from the calculate-release-dates-db and APIs in the DEV environment. Only the redis functions will be local operations.

Method 2 - running everything locally

Note: the prisoner-search-service is not currently set up to run locally. If you need it then use Method 1

  1. Starting at the root folder of the project pull the latest images for the service and dependent containers using the following command. $ docker-compose pull

  2. Then use the script: $ run-full.sh -follow the onscreen instructions.

Point a browser to localhost:3000

the username is CALCULATE_RELEASE_DATES_LOCAL The password is : password123456

Running ui app

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

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

npm run start:dev

Run linter

npm run lint

Dependency Checks

Some scheduled checks ensure that key dependencies are kept up to date. They are implemented via a scheduled job in CircleCI. See the check_outdated job in .circleci/config.yml