Skip to content

ministryofjustice/laa-landing-page

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LAA Portal Landing Page

repo standards badge

Introduction

The LAA Portal Landing Page is a user facing application for the LAA. It controls authentication and authorisation to most LAA web applications. Users of the Portal include both internal LAA staff and external solicitors (providers of legal aid). This is a prototype application developed and maintained by the LAA portal stabilisation dev team.

Running the app locally

Prerequisites

Install Java

Ensure you have installed the correct version of Java on your local machine. At the time of writing this is Java 21. Some MoJ devices will come prepackaged with the latest version of Java

Check your local version of Java: java -version

To check all versions of Java you have installed locally run: /usr/libexec/java_home -V

Once you have downloaded Java, you can open your bash profile:

sudo nano ~/.bash_profile

enter your device password add export the version of Java you wish to use:

export JAVA_HOME=$(/usr/libexec/java_home -v 21.0.7)

Once exported be sure to source your latest bash profile: source ~/.bash_profile

Obtaining an Entra user

  • You need a valid MoJ DEVL External email address for Entra ID authentication. This email will be used for validation.
    • If you do not have one, reach out to an Entra admin in the #laa-portal-stabilisation-tech Slack channel.

Obtaining Client Credentials

  • The client secret and client ID are available in the Entra UI:

    • Path: App registrations > laa-portal-oidc-playground > Certificates & secrets.
  • If you do not have the necessary permissions to view the client ID and secret, request them from an Entra admin.

Creating a GitHub Token

  1. Ensure you have created a classic GitHub Personal Access Token with the following permissions:
    1. repo
    2. write:packages
    3. read:packages
  2. The token must be authorised with (MoJ) SSO.
  3. Add the following parameters to ~/.gradle/gradle.properties
project.ext.gitPackageUser = <your GitHub username>
project.ext.gitPackageKey = <your GitHub access token>

For more detailed instructions, refer to the laa-ccms-spring-boot-common repository here.

More information on GDS can be found here.

Obtaining a Dockerhub account

In order to run a database locally, you must have a licensed Docker account - please reach to the team to set this up.

Obtaining a GOV.UK Notify API Key

  • You need a valid GOV.UK Notify API Key for GOV.UK Notify authentication.
    • If you do not have one, reach out to an Entra admin in the #laa-portal-stabilisation-tech Slack channel.

Obtaining a Sentry.IO API Key

  • Ensure you have signed up for Sentry using the SSO link.
  • If you are not part of the Portal Stabilisation Sentry team - ask internally to be added.
  • A token can be generated here.

Filling out .env

Using the .env-template file as a template, copy to a new .env file cp .env-template .env

Be sure to fill out all values as they are required for pulling dependencies for the application to run

Running the Application

Ensure that all environment variables from .env set

export $(grep -v '^#' .env | xargs)

Once the environment variables are set, you can run must first start the database:

Starting the Database

  1. Ensure Docker is installed, running & you are signed in with a licensed Docker account (see prerequisites above).
  2. Navigate to the root of the repository
  3. Using the Terminal, run docker-compose up -d - this will start the database container using Docker.

The script db-tool.sh includes various functions to assist in local development

Generating DB Changelog

If there are changes made to DB structure

  1. Ensure there are two DB instances running one with existing version and another with new DB changes
  2. Issue the command below to generate the changelog (it requires installing liquibase locally using brew)
liquibase diff-changelog --changelog-file=diff-changelog.yml --url="jdbc:postgresql://localhost:5432/portal-database" --username=<<uname>> --password=<<pwd>> 
--reference-url="jdbc:postgresql://localhost:54321/portal-database" --reference-username=<<uname>> --reference-password=<<pwd>>
  1. Copy the diff-changelog.yml file to application resources folder (resources/db/changelog/changesets/) and rename it to db.changesets-<<next_version>>.yaml
  2. Ensure custom constraints are retained along with any new constraints

Please note liquibase does not generate partial indexes or some custom constraints. Please ensure the constraints are add to the changelog file at the bottom of the file.

Starting the Application

  • IntelliJ IDEA:

    1. Open the project in IntelliJ.
    2. Open the Gradle tool window (View > Tool Windows > Gradle).
    3. Navigate to Tasks > application and double-click bootRun.
  • VSCode:

    1. Open the project in VSCode
    2. Open a VSCode Terminal
    3. Ensure the .env environment variables are exported inside the terminal
    4. Run the following command:
      ./gradlew bootRun
  • Command Line:

    1. Navigate to the project root directory.
    2. Run the following command:
      ./gradlew bootRun

Once the application is running steadily, you can access the UI by navigating to:

http://localhost:8080

Snyk & Trivy Integration

If a pipeline is picking up a vulnerability that you wish to add to the ignore list, then make sure to add it to either .trivyignore or .snyk rather than resolving in the UI.

Automation Playwright Test Suite

These tests are used for automation testing of LAA Landing Page using Playwright with Java

Location:

 src/playwrightTest

Configuration:

src/playwrightTest/resources/playwright.properties

Running Tests

  • Update url, username and password in configuration file
  • Run individual tests, classes or test suits.
  • Tests can run in headless or headed mode
    • This can be configured using headless property in configuration file

Tests Coverage

  • UI of LAA Landing Page
  • Reusable logic e.g. login will be in BaseFrontEndTest class

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 16

Languages