Search…
Judicial System

About

TODO

URLs

Backend

Initial setup

First, make sure you have docker, then run:
1
yarn dev-services judicial-system-backend
Copied!
Then run the migrations and seed the database:
1
yarn nx run judicial-system-backend:migrate
Copied!
1
yarn nx run judicial-system-backend:seed
Copied!

Running locally

You can serve this service locally by running:
1
yarn start judicial-system-backend
Copied!
To enable SMS notifications to an on-call judge provide a password for the SMS service and court mobile numbers:
1
NOVA_PASSWORD=<SMS password> COURTS_MOBILE_NUMBERS='{ <court-id>: mobileNumbers: <judge mobile number> }' yarn start judicial-system-backend
Copied!
Similarly, you can enable electronic signatures of judge rulings by providing a Dokobit access token: DOKOBIT_ACCESS_TOKEN=<Dokobit access token>
To enable email sending via AWS SES turn off email test account and provide an email region:
1
EMAIL_USE_TEST_ACCOUNT=false EMAIL_REGION=eu-west-1 yarn start judicial-system-backend
Copied!
You need to be authenticated against AWS for this to work. Alternatively, you can view ethereal nodemailer messages by following the urls shown in the logs.
To enable prison and prison administration email notifications provide email addresses: PRISON_EMAIL=<prison email> PRISON_ADMIN_EMAIL=<prison administration email>
To enable writing to AWS S3 you need to be authenticated against AWS.
Finally, you can enable communication with the court system via xRoad by providing appropriate values for the environment variables specified in the xRoad and courtClientOptions sections in environment.ts.

Unit tests

1
yarn test judicial-system-backend
Copied!

API

Running locally

You can serve this service locally by running:
1
yarn start judicial-system-api
Copied!
You can enable communication with the court system via xRoad by providing appropriate values for the environment variables specified in the xRoad and courtClientOptions sections in environment.ts.
To get latest texts from Contentful you need to provide an appropriate value for the environment variable CONTENTFUL_ACCESS_TOKEN.

Graphql playground

Visit
1
localhost:3333/api/graphql
Copied!

OpenApi and Swagger

Visit
1
localhost:3344/api/swagger
Copied!

Database changes

Migrations need to be created by hand.

Generate a empty migration file you can simply run:

1
npx sequelize-cli migration:generate --name update-case
Copied!
this will generate a migration file with empty exports for up (Altering commands) and down (Reverting commands).

Web

A platform for the exchange of data, information, formal decisions and notifications between parties in the Icelandic judicial system.

Start the application locally

Start the backend locally. Instructions on how to do that can be found in the backend project.
Start the application
1
yarn start judicial-system-web
Copied!
Then the project should be running on https://localhost:4200/.
To skip authentication at innskraning.island.is navigate to /api/auth/login?nationalId=<national_id> in the web project where <national_id> is the national id of a known user. Known users:
  • Áki Ákærandi
    • NationalId: 0000000009
    • Role: Prosecutor
  • Dalli Dómritari
    • NationalId: 0000001119
    • Role: Registrar
  • Dóra Dómari
    • NationalId: 0000002229
    • Role: Judge

Testing strategy

This project uses two types of automated tests, unit tests and e2e tests. We use Jest to write unit tests against code like utility functions. If we need to test custom components in isolation, we use React testing library. Finally, to test entire screens in our project we use Cypress.

Running the tests

Unit tests
1
yarn test judicial-system-web
Copied!
Lib tests
1
yarn test judicial-system-formatters
Copied!
e2e tests
1
yarn nx e2e judicial-system-web-e2e --watch
Copied!

Message Extraction from Contentful

Running yarn nx extract-strings judicial-system-{namespace} in the root folder /island.is will extract messages from the project and create or update a Namespace entry in Contentful.

Example for namespaces in web:

1
yarn nx extract-strings judicial-system-web
Copied!
will update namespaces:
  • judicial.system.core
  • judicial.system.restriction_cases
  • judicial.system.investigation_cases

For backend:

1
yarn nx extract-strings judicial-system-backend
Copied!
will update namespaces:
  • judicial.system.backend

To test authentication locally

  • npm install -g local-ssl-proxy
  • change defaultcookie in apps/judicial-system/api/src/app/modules/auth/auth.controller.ts:
    const defaultCookieOptions: CookieOptions = { secure: true, }
  • add .env to web project and change PORT to 4202
  • start project
  • local-ssl-proxy --source 4200 --target 4202

Lawyer directory

We are using data from lmfi to search for lawyers to use as defenders for defendants in the system. We are currently scraping that data and the scraper can be found in a private repo under Kolibri's GitHub org.. This is a temporary solution until we get access to an API from lmfi.

Code owners and maintainers

Last modified 18h ago