Skip to content

🏗 Architecture

Architecture drawing

ComponentPackage / locationRole
Frontendpackages/frontendReact SPA (Vite), served by nginx
BFFpackages/bffNode/TypeScript/Fastify. Login and sessions, /api/graphql, feature flags (/api/features) and the alert banner
PostgreSQLTypeORM in packages/bffThe BFF’s own data: profiles and saved searches
RedisSessions, Maskinporten tokens and cached lookups (organizations, service resources)
Azure App ConfigurationFeature flags and the alert banner
Infrastructure.azure/Bicep: Container Apps, Application Gateway, Key Vault, Postgres, Redis and more

When something fails, start by finding out which of these paths the request took.

  1. Through the BFF: /api/graphql. The BFF stitches Dialogporten’s schema (from the npm package @digdir/dialogporten-schema) with its own Nexus schema (see GraphQL and typegen).
    • Dialogporten fields are forwarded to Dialogporten’s GraphQL API with the user’s access token.
    • BFF fields are resolved in the BFF against Postgres and Altinn platform APIs (Profile, Register, Correspondence, Notifications, Resource Registry). Some of these use a Maskinporten token instead of the user’s token (see Maskinporten).
    • Person URNs are encrypted on the way out (see Person URN encryption).
  2. Directly to Dialogporten: live updates for an open dialog use Server-Sent Events against Dialogporten’s graphql/stream, authorized with the dialog’s dialogToken (useDialogByIdSubscription.ts).
  3. Directly to the service owner: main content, transmission content and non-GET GUI actions are fetched from the service owner’s URLs with the dialogToken (see Dialog anatomy and Embeddable content).

Login and sessions are described in ID Porten.