Skip to content

pagopa/interop-be-monorepo

Folders and files

NameName
Last commit message
Last commit date
Nov 22, 2024
Dec 3, 2024
Jan 14, 2025
Dec 18, 2024
Jan 15, 2025
Oct 18, 2023
Sep 13, 2023
Jul 9, 2024
Sep 13, 2024
Nov 5, 2024
May 15, 2024
Jun 21, 2023
Nov 30, 2023
Dec 16, 2024
Jan 8, 2025
Jul 12, 2023
Apr 3, 2024
Jul 8, 2024
Jun 17, 2024
Nov 5, 2024
Nov 11, 2024

Repository files navigation

NOTE: this repo is still a work in progress

Interoperability Monorepo

How to start

To get started, you will need:

Then install the dependencies with

pnpm install

How to run a single service in watch mode

pnpm start:<service-name>
# example: pnpm start:catalog

How to run the tests

pnpm test

How to work locally with the read model

First, start a consumer service by running (for example):

pnpm start:catalog-consumer

This will start a local instance of Debezium (alongside with its requirements Zookeeper and Kafka) and a local MongoDB instance which will contain the read model.

Then, start a process service by running (for example):

pnpm start:catalog

This will start a local Postgres instance for storing the events and the service itself.

You can test everything is working by posting an event to the service, for example:

curl -X POST http://localhost:3000/eservices \
  -d '{ "name": "Example name", "description": "Example description", "technology": "REST", "attributes": { "certified": [], "declared": [], "verified": [] } }' \
  -H "Content-Type: application/json" \
  -H 'X-Correlation-Id: test' \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJvcmdhbml6YXRpb25JZCI6IjRENTU2OTZGLTE2QzAtNDk2OC04NTRCLTJCMTY2Mzk3RkMzMCIsInVzZXItcm9sZXMiOiJhZG1pbiIsInJvbGUiOiJhZG1pbiIsInVpZCI6IjBmZGEwMzNjLThlOGUtNDhhOS1hMGZjLWFiYmExZjcxMWZlZiIsIm9yZ2FuaXphdGlvbiI6eyJyb2xlcyI6W3sicm9sZSI6IkFkbWluIn1dfSwiZXh0ZXJuYWxJZCI6eyJvcmlnaW4iOiJJUEEiLCJ2YWx1ZSI6IjEyMzQ1NiJ9fQ.308Ulfu4JXXMhqsWo26MIWWhv8tp3sdl-pU5gN_SIX4" 

You should see the event being processed by the consumer and the read model being updated.

You can verify this by using Mongo Express, which is being started alongside the consumer and is available at http://localhost:8081/db/readmodel.

Similarly, there is a Postgres web client that can be used to inspect the event stores at http://localhost:8082.