No description
  • Go 35.4%
  • Shell 29.6%
  • HTML 27.4%
  • Makefile 7.6%
Find a file
Zamir Amir cd26c12871 List the app-uitgever's operator screen on Fundament now it runs there
It was deployed to mijnbo, so the README links it and the route table
no longer says it waits for the next deploy.
2026-11-25 18:39:46 +01:00
architecture List the app-uitgever's operator screen on Fundament now it runs there 2026-11-25 18:39:46 +01:00
docs Give the app-uitgever an operator screen read straight from the pushgateway 2026-11-25 16:41:52 +01:00
local Give the app-uitgever an operator screen read straight from the pushgateway 2026-11-25 16:41:52 +01:00
tools/test-burger Write the signed receipt body without the removed request type 2026-11-24 19:33:31 +01:00
.gitignore Tag local images with their commit and clone environments too 2026-11-23 23:21:54 +01:00
CHANGELOG.md Refer the burger to Mijn Betaaloverzicht from a bericht (ADR 0009) 2026-11-25 11:11:06 +01:00
GLOSSARY.md Refer the burger to Mijn Betaaloverzicht from a bericht (ADR 0009) 2026-11-25 11:11:06 +01:00
LICENSE License under EUPL-1.2 2026-11-23 20:10:32 +01:00
Makefile Give the app-uitgever an operator screen read straight from the pushgateway 2026-11-25 16:41:52 +01:00
notificatie-voor-burgers.code-workspace Open the installer repository in the shared workspace too 2026-11-24 09:49:49 +01:00
README.md List the app-uitgever's operator screen on Fundament now it runs there 2026-11-25 18:39:46 +01:00

Getting started

Start here for Notificatie voor Burgers: a way for organisations to reach a citizen at an address that belongs to the citizen, without any single party seeing who writes to whom. Content stays at the source; only a signal travels through the chain.

This repository holds what the components share: the glossary, the local development environment and the architecture overview. Each component lives in its own repository.

Repository Role
source-organization-ui bronorganisatie: back-office screen to write and send a message
source-organization-process bronorganisatie: the logic — the postvak, the zending with only a verwijzing, the retrieval and the ontvangstbevestiging; public under /bronorganisatie/v1
source-organization-service bronorganisatie: data access only, no business logic; internal
source-organization-db bronorganisatie: Postgres (CloudNativePG) and the schema migrations
dispatch-process verzenddienst: the logic — checks the afzender, gives each zending an unguessable reference, forwards the bezorgenvelop unread, answers Onbestelbaar, passes retours back to the afzender; internal
dispatch-service verzenddienst: data access only, no business logic; internal
dispatch-db verzenddienst: Postgres (CloudNativePG) and the schema migrations
dispatch-management-process verzenddienst: the overview for its management screen, read from the service
delivery-process bezorgdienst: the logic — takes adresverklaringen, takes zendingen on and delivers the burgerenvelop unread with retries, returns what it cannot deliver in time, never learns the afzender; internal
delivery-service bezorgdienst: data access only, no business logic; internal
delivery-db bezorgdienst: Postgres (CloudNativePG) and the schema migrations
delivery-management-process bezorgdienst: the overview for its management screen, read from the service
mailbox-host-process hoster: the logic — creates brievenbussen, checks toegangstokens, accepts bezorgingen, asks for seintjes; public under /hoster/v1
mailbox-host-service hoster: data access only, no business logic; internal
mailbox-host-db hoster: Postgres (CloudNativePG) and the schema migrations
mailbox-host-management-process hoster: the overview for its management screen, read from the service
address-register-process adresregister: takes the burger's signed and sealed registratie, checks the BSN in the BRP and delivers the adreskaart, signed and sealed per member, to every bronorganisatie in the wettelijke kring (ADR 0008); public under /adresregister/v1
address-register-service adresregister: data access only, no business logic; internal
address-register-db adresregister: Postgres (CloudNativePG) and the schema migrations
address-register-management-process adresregister: management API that reads only the register's own service; the BSN only masked
address-register-management-ui operator screen of the adresregister: registraties, deliveries per bronorganisatie and their retries
mock-brp-api fork of blauwe knop's BRP mock (Haal Centraal personen): the test persons whose BSN the adresregister accepts and whose name the bronorganisatie looks up; internal
dispatch-management-ui operator screen of the verzenddienst
delivery-management-ui operator screen of the bezorgdienst
mailbox-host-management-ui operator screen of the hoster
mailbox-app-push-gateway pushgateway: wakes devices through Web Push or a WebSocket with the app publisher's key; public under /push/v1
mailbox-app-push-gateway-management-ui operator screen of the app-uitgever: connections, pushtokens and seintjes per kanaal, pushtokens only as pseudonyms
mailbox-app apparaat: Flutter app that receives the seintje, fetches its signals, retrieves the bericht and confirms receipt
mailbox-app-push-agent achtergronddienst: keeps the pushgateway's WebSocket open on a desktop (Linux, macOS; Windows unverified) and shows "Er is post" while the app is closed (ADR 0003); installed per user, in the cluster only for the e2e test
mailbox-app-installer one installer per operating system with the mailbox-app and its achtergronddienst together: deb/rpm, a macOS .pkg and (unverified) a Windows setup; not part of the cluster
charts how the components' charts are released to the Forgejo Helm registry and pinned by an environment (ADR 0007); the charts themselves stay in each component

Every party is split the way the blauwe knop components are: -process (business logic and the APIs to the outside), -service (data access only, no business logic), -db (Postgres via CloudNativePG, and migrations) and, for the parties in between, -management-process. The bronorganisatie deliberately has no management layer: its screen is the organisation's own work screen. Their state lives in Postgres, so a deploy keeps every brievenbus, adresregistratie, toegelaten afzender and bericht in the postvak.

Every API is a Dutch OpenAPI 3.1 contract following the NL API Design Rules. Like in blauwe knop, api/openapi.yaml is committed together with a generated api/openapi.json; CI checks they match and runs Redocly and the ADR checker, and each API serves both. Every response carries API-Version, errors are application/problem+json, and trailing slashes do not exist. Each public API has its own prefix on the shared hostname, so each can own its document:

Public API Prefix Document
bronorganisatie /bronorganisatie/v1 /bronorganisatie/v1/openapi.json and .yaml
adresregister /adresregister/v1 /adresregister/v1/openapi.json and .yaml
hoster /hoster/v1 /hoster/v1/openapi.json and .yaml
pushgateway /push/v1 /push/v1/openapi.json and .yaml

The internal APIs (verzenddienst, bezorgdienst, every -service and -management-process, the hoster's bezorgingen and the pushgateway's seintjes) keep /v1 on listeners and Services that no route reaches.

Deployment to Fundament lives in environments; make clone fetches it too.

See architecture/sequence.html for what happens between them (open it in a browser), and docs/adr for the decisions behind it: 0002 on the layers, the Dutch APIs, the prefixes and the pushgateway, 0003 on desktop push through an own background service, 0004 on X-Wing envelopes (it replaces 0001), 0005 on ECDSA signatures until ML-DSA, 0006 on the sealed pushtoken that keeps the kanaal at the pushgateway, 0007 on releasing each component's chart to the Forgejo Helm registry, 0008 on the adresregister without FSC, encrypted between the parties (docs/adresregister.md), 0009 on scanning the rendered charts with KICS on every push and pull request, and 0010 on the app-uitgever's operator screen, read straight from the pushgateway.

Current state

A walking skeleton. A bronorganisatie writes a bericht, which stays in its postvak; only a signal pointing to it travels through verzenddienst, bezorgdienst and hoster. The app gets a seintje through its kanaal (a WebSocket to the app or its background service, FCM on mobile, or Web Push), fetches the signal and retrieves the bericht directly at the bronorganisatie, which records that moment as the aflevering, and confirms receipt when asked. The signal is signed by the bronorganisatie and sealed for the burger, and the zending once more for the bezorgdienst: X-Wing (ML-KEM-768 + X25519) envelopes and ECDSA signatures, so the hoster stores what it cannot read (ADR 0004, ADR 0005, docs/encryptie.md). The burger's adreskaart is its public key plus an adres-sticker only the bezorgdienst can open; the app registers it under the burger's BSN at the adresregister, which hands it, signed and sealed, to every bronorganisatie in the wettelijke kring. There the medewerker picks the burger by name and never sees the BSN or the adreskaart; without DigiD a registratie proves nothing about who owns the BSN, so only the mock BRP's test persons are accepted. A bericht whose adres-sticker the bezorgdienst cannot open or does not know comes back at once and stays in the postvak as onbestelbaar. For a known address the bezorgdienst takes the zending on and delivers it in the background, retrying with exponential back-off (5 s, doubling, at most 5 min) while the hoster is unreachable. After the maximum duration (1 hour by default, well within the 48 hours of art. 2:10 Awb; 20 s locally) it returns the zending by its reference to the verzenddienst, which tells the afzender; the postvak then shows it under "Onbestelbaar" and the organisation falls back to paper. The bezorgdienst never learns the afzender and the verzenddienst never the address.

Deliberately left out for now: ML-DSA (signatures use ECDSA until then), a fixed zending size, FSC voor Burgers and PKIo (retrieval access is an unguessable verwijzing, the afzender a plain header), authorisation of the screens, APNs directly for iOS, Android push without FCM, the app in the browser, and a deliberate delay in the chain against time correlation.

Prerequisites

  • Docker (for example OrbStack), k3d, kubectl, helm, make
  • openssl (make local-secrets generates the service keys), curl and python3 (make e2e)
  • Go 1.27 and golangci-lint, to work on a service
  • fvm, to work on the apps: each pins Flutter 3.50.1 in .fvmrc; the images build without a local Flutter
  • Internet access: make cluster installs the CloudNativePG operator from its Helm repository
  • SSH access to code.digitaledienst.overheid.nl
  • Only for deploying to Fundament from environments: functl and kubeseal

Run it locally

Work in one folder that holds every repository side by side:

mkdir mijn-betaaloverzicht && cd mijn-betaaloverzicht
git clone git@code.digitaledienst.overheid.nl:mijn-betaaloverzicht/getting-started.git
cd getting-started
make clone     # clone the component repositories and environments next to getting-started
make cluster   # k3d cluster "notification-for-citizens" with its own image registry on localhost:5050, Traefik on localhost:8080, CloudNativePG operator
make build     # build images tagged with their git commit and push them to that local registry (nothing leaves your machine)
make deploy    # make local-secrets first, then helm upgrade --install every service with those tags; only changed images roll out
make e2e       # the test burger sends messages through the whole chain and opens them: signatures, retries and a retour, API agreements and persistence per party

Open notificatie-voor-burgers.code-workspace in VS Code to get every repository in one window, ordered along the chain and prefixed with its party.

make local-secrets (run by make deploy) gives every party its key once per cluster: the bezorgdienst an X-Wing key, the hoster, the verzenddienst and the bronorganisatie a signing key. From those Secrets it writes the trust lists as JWK Sets to .build/values/ and .build/vertrouwde-afzenders.json, which make deploy and make e2e use.

make e2e plays the burger with the test burger, tools/test-burger: it creates a brievenbus with a signed request (maak), registers or closes its address at the adresregister under a test BSN (registreer, sluit), and opens and verifies the burgerenveloppen with the trusted afzenders (signalen). Two more commands make the refusals testable: vervals signs an adresverklaring or zending with a key nobody trusts, and vreemde-adreskaart seals the adres-sticker for another key than the bezorgdienst's.

make deploy also installs a second bronorganisatie, tweede-organisatie, in a namespace of its own (notification-for-citizens-2), with its own keys and its own URL, http://tweede.localhost:8080/. It reaches the shared parties by their Service in notification-for-citizens, as an organisation of its own would; the adresregister delivers to it as to every member of the kring, and make e2e checks it. How to connect a real second bronorganisatie is in docs/adresregister.md.

The cluster pulls our images (code.digitaledienst.overheid.nl/mijn-betaaloverzicht/...) from the registry next to it, so the image names in the charts stay the same as on Fundament. An image that was only imported into the node could disappear: the kubelet removes unused images once the disk is 85% full. From the registry it is pulled again. make clean deletes the registry with the cluster; after pulling this change, recreate the cluster once (make clean cluster build deploy).

All kubectl and helm commands are pinned to the k3d-notification-for-citizens context, so another active context never receives them. make help lists every target.

Demo

The citizen's app no longer runs in the browser: it opens the burgerenveloppen with dart_connect, whose X-Wing goes over FFI, and a browser has none. Run it as a desktop app (cd ../mailbox-app && fvm flutter run -d macos --dart-define=VERTROUWDE_AFZENDERS="$(cat ../getting-started/.build/vertrouwde-afzenders.json)") or install it with mailbox-app-installer; without the trusted afzenders it shows every signal as untrustworthy. make e2e and the test burger show the whole chain without the app: .build/test-burger maak --hoster http://localhost:8080/hoster/v1 --map /tmp/burger prints an adreskaart, and .build/test-burger signalen --map /tmp/burger --afzenders .build/vertrouwde-afzenders.json opens what arrived.

  1. Register the burger's address: in the app under Instellingen > Adresregister with one of the six test persons of blauwe knop's mock-digid (the table in docs/adresregister.md), such as 814859094 (Piet Verstraten), or with the test burger: .build/test-burger registreer --register http://localhost:8080/adresregister/v1 --map /tmp/burger --bsn 814859094 --registersleutel .build/adresregister-sleutel.json. The register's operator screen at http://localhost:8080/address-register-management/ shows the registratie with the BSN masked (*******94), and the adreskaartlevering to demo-organization as afgeleverd; stop the bronorganisatie for a moment to see it wait and be retried.
  2. Open the bronorganisatie's screen at http://localhost:8080/, choose "Nieuw bericht", search the burger by name ("Piet"), pick "Brief" (that turns on "Vraag om ontvangstbevestiging"), write a message and choose "Verstuur". (make shipment BURGER_ID=<id> sends a fixed mededeling from the terminal instead, with the id from POST /bronorganisatie/v1/burgers/zoeken.)
  3. The app shows "Er is post" and a signal with only sender and time. Tap it: the app retrieves the bericht at the bronorganisatie, and shows "De afzender vraagt om een ontvangstbevestiging". Choose "Ik bevestig ontvangst".
  4. Refresh the list on the bronorganisatie's screen: the bericht shows ✓✓, and its details show "Opgehaald:" and "Bevestigd op … (tijd op apparaat: …)".
  5. Close the address in the app ("Sluit mijn adres"): the burger shows "Adres gesloten: stuur op papier" and can no longer be picked.

To show the doorverwijzing to Mijn Betaaloverzicht (ADR 0009), fill in "Zaakkenmerk" and "Gebeurteniskenmerk" under "Vordering in Mijn Betaaloverzicht" in step 2, or send make claim-shipment BURGER_ID=<id>, which names the CJIB vordering of Mijn Betaaloverzicht's mock data (zaak 81029991234567891, gebeurtenis 81029991234567891-1). Locally demo-organization may refer to Mijn Betaaloverzicht under the CJIB's OIN in that data, so the bericht shows "Open Mijn Betaaloverzicht". Build the app with --dart-define=MIJN_BETAALOVERZICHT_URL=https://app.demo.mijn-betaaloverzicht.nl to open the demo build of Mijn Betaaloverzicht instead of the production one.

Seintjes to the app on a phone go through Firebase Cloud Messaging, which needs the app publisher's Firebase service account. Without it the push gateway serves no fcm, and the app on a phone only gets seintjes over its WebSocket while it is open. To test it on the iOS simulator or the Android emulator, store the service account once (never commit it) and run the app natively:

make fcm-secret FCM_SERVICE_ACCOUNT_FILE=~/path/to/service-account.json
cd ../mailbox-app && fvm flutter run -d ios   # or -d android

Follow the chain with:

kubectl --context k3d-notification-for-citizens -n notification-for-citizens logs -f --prefix \
  -l 'app.kubernetes.io/name in (source-organization-process,dispatch-process,delivery-process,mailbox-host-process,mailbox-app-push-gateway)'

State lives in each party's Postgres, so brievenbussen and berichten survive make deploy and restarts. make clean deletes the cluster and with it every database.

Operator UIs

Each party in the chain has its own operator screen, next to its own service:

Each screen shows only what that party may know according to the design, and states what it does not know. Envelopes appear only as their size, because they are encrypted for the burger. The screens are separate apps on purpose: one console over all parties would build the complete picture that the separation of roles exists to prevent.

They are public for now, because there is no authorisation yet. Each party's management API is a component of its own (dispatch-management-process, delivery-management-process, mailbox-host-management-process, address-register-management-process) with only an internal Service; the only public way in is the proxy below /<path>/api/ in the screen's own pod. The app-uitgever has no management-process: the pushgateway has no database, so it serves its in-memory counts on a management listener of its own (mailbox-app-push-gateway-management, ADR 0010).

On Fundament

The same chain runs on Fundament (cluster-a, namespace tnt-mbo-voorbeeld--mijnbo), deployed with make deploy from environments, which also runs the end-to-end test against it (make smoke):

The installers of mailbox-app-installer are built against these URLs. A second bronorganisatie is not deployed there yet.

The actors of the Fundament plugin (nvb)

Next to it, the Fundament plugin runs every actor in a namespace of its own, each on its own hostname:

Actor Namespace URL
Bronorganisatie gemeente-a tnt-mbo-voorbeeld--nvb-bronorganisatie-a https://nvb-bronorganisatie-a.cluster-a.fieldlab2026.nl/
Bronorganisatie gemeente-b tnt-mbo-voorbeeld--nvb-bronorganisatie-b https://nvb-bronorganisatie-b.cluster-a.fieldlab2026.nl/
Verzenddienst tnt-mbo-voorbeeld--nvb-verzenddienst https://nvb-verzenddienst.cluster-a.fieldlab2026.nl/dispatch-management/
Bezorgdienst tnt-mbo-voorbeeld--nvb-bezorgdienst https://nvb-bezorgdienst.cluster-a.fieldlab2026.nl/delivery-management/
Hoster tnt-mbo-voorbeeld--nvb-hoster https://nvb-hoster.cluster-a.fieldlab2026.nl/mailbox-host-management/
Adresregister tnt-mbo-voorbeeld--nvb-adresregister https://nvb-adresregister.cluster-a.fieldlab2026.nl/address-register-management/
App-uitgever tnt-mbo-voorbeeld--nvb-app-uitgever https://nvb-app-uitgever.cluster-a.fieldlab2026.nl/push/v1

The app for this environment is built with ENVIRONMENT=nvb in mailbox-app-installer (make macos ENVIRONMENT=nvb), or started from VS Code with the launch configuration "mailbox-app (nvb)". Both take the hoster, the adresregister and the pushgateway above, each on its own hostname (MAILBOX_HOST_URL, ADRESREGISTER_URL, PUSHGATEWAY_URL), and the trust list and register key of vertrouwde-afzenders/nvb.json and adresregister-sleutel/nvb.json in mailbox-app-installer: a copy of the app-configuratie on the app-uitgever's page in the Fundament console. On mijnbo every public API shares one hostname, so only MAILBOX_HOST_URL is set there.

Charts and releases

Locally everything deploys straight from the helm/ folder of each component next to this one, so a change can be tried in k3d without a release. An environment instead pins a release per component: make release VERSION=X.Y.Z in the component tags vX.Y.Z, its tag pipeline publishes the image and the chart at that version to the Forgejo Helm registry, and environments/<environment>/versions names component=X.Y.Z (ADR 0007, the charts repository). Every component deployed to Fundament is pinned at a release; bin/deploy.sh refuses a pin that is not one.

Conventions

  • The OpenAPI contracts, the API interface (paths, JSON fields, domain values) and the Go request and response structs are Dutch, in the terms of the glossary; only words a standard prescribes stay English (items, id, the RFC 9457 fields). The rest of the code, component names and commit messages are English. The glossary and the apps' UI text are Dutch.
  • Bezorging is Delivery, aflevering is Retrieval. They are legally different moments; never mix them up.

License

EUPL-1.2, see LICENSE.