Installation & Setup Client

The sample broker is the reference implementation of a broker client: an Angular application that operates the application process against the sample insurer – choose a reference date and a sales product, configure the product tree, capture a risk object, calculate the premium. It calls the services of every insurer at that insurer’s base URL; in development a proxy forwards these calls to the running instances of the sample insurer (see Installation & Setup Server).

On the example server the sample broker runs at /omds-ld/ – try the application process without installing anything.

Source: reference/sample-broker/ in the repository.

Insurer List

A broker works with several insurers. The sample broker therefore keeps a list of insurers, each with a display name and the base URL of its services. The defaults are the three example insurers Disrupto, Anglo-American and Pfefferminzia at /omds-ld/insurers/<name>/api, i.e. the three instances of the sample insurer behind the entry point.

The page "Versicherer" (insurers) in the navigation shows the list. There every insurer can be activated or deactivated, checked for reachability with "Verbindung prüfen" (check connection), and an own entry can be added, such as a sample insurer on another server (absolute URL with http or https) or a real insurer offering the services. Own entries and switches are kept in the browser.

The product selection asks all active insurers for their sales products at once and shows them grouped by insurer. If an insurer cannot be reached, a message appears in its group; the others stay usable. Product tree and calculation then run at the insurer whose product was chosen.

Prerequisites

  • Node.js (24 or newer) and npm.

  • A running sample insurer on port 9090 (Disrupto) – started locally or as a container; for the other insurers an instance on 9091 (Anglo-American) or 9092 (Pfefferminzia). An insurer without a running instance is reported as unreachable in the product selection and does not disturb the others.

  • For the end-to-end tests: Chromium for Playwright (npx playwright install chromium, a one-time download; the browser binaries are not part of the repository).

Installation and Start

cd reference/sample-broker
npm install
npm start

npm start starts the development server at http://localhost:4200/omds-ld/ and forwards /omds-ld/insurers/disrupto/api, …/angloamerican/api and …/pfefferminzia/api to the sample insurers on localhost:9090, 9091 and 9092 (/omds-ld/api stays as an alias for Disrupto).

Build

npx ng build

The Maven build of the repository (mvn clean install) builds the client as well. In the container stack (docker compose up --build -d in the repository root) the client is reachable at http://localhost:9081/omds-ld/; its nginx is the entry point and forwards /omds-ld/insurers/<name>/api/ to the container of the respective sample insurer and /omds-ld/docs/ to the documentation.

Verification

Component tests (Vitest, no server needed):

npm test

End-to-end tests (Playwright): a real browser walks through the application process – product selection, product tree, risk objects, calculation, insurer list – against the running sample insurer. This is the way to check the client against a sample insurer.

npm run e2e                          # headless in Chromium; starts the development server itself
npm run e2e:ui                       # Playwright UI to watch the run
npm run e2e -- --project=recorded    # without a sample insurer, with recorded responses

If no sample insurer answers on port 9090, the run aborts before the first test with a message saying so. The tests run with Disrupto as the only active insurer, so that one instance is enough. Flows that fail today because of known defects of the client are marked as expected failures and are reported as soon as they unexpectedly pass.