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.
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
- 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.
-
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.
- Ensure you have created a classic GitHub Personal Access Token with the following permissions:
- repo
- write:packages
- read:packages
- The token must be authorised with (MoJ) SSO.
- 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.
In order to run a database locally, you must have a licensed Docker account - please reach to the team to set this up.
- 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.
- 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.
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
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:
- Ensure Docker is installed, running & you are signed in with a licensed Docker account (see prerequisites above).
- Navigate to the root of the repository
- 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
If there are changes made to DB structure
- Ensure there are two DB instances running one with existing version and another with new DB changes
- 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>>
- Copy the diff-changelog.yml file to application resources folder (resources/db/changelog/changesets/) and rename it to
db.changesets-<<next_version>>.yaml
- 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.
-
IntelliJ IDEA:
- Open the project in IntelliJ.
- Open the Gradle tool window (
View > Tool Windows > Gradle
). - Navigate to
Tasks > application
and double-clickbootRun
.
-
VSCode:
- Open the project in VSCode
- Open a VSCode Terminal
- Ensure the
.env
environment variables are exported inside the terminal - Run the following command:
./gradlew bootRun
-
Command Line:
- Navigate to the project root directory.
- Run the following command:
./gradlew bootRun
Once the application is running steadily, you can access the UI by navigating to:
http://localhost:8080
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.
These tests are used for automation testing of LAA Landing Page using Playwright with Java
src/playwrightTest
src/playwrightTest/resources/playwright.properties
- 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
- UI of LAA Landing Page
- Reusable logic e.g. login will be in BaseFrontEndTest class