đ Architecture
Components
Section titled âComponentsâ| Component | Package / location | Role |
|---|---|---|
| Frontend | packages/frontend | React SPA (Vite), served by nginx |
| BFF | packages/bff | Node/TypeScript/Fastify. Login and sessions, /api/graphql, feature flags (/api/features) and the alert banner |
| PostgreSQL | TypeORM in packages/bff | The BFFâs own data: profiles and saved searches |
| Redis | Sessions, Maskinporten tokens and cached lookups (organizations, service resources) | |
| Azure App Configuration | Feature flags and the alert banner | |
| Infrastructure | .azure/ | Bicep: Container Apps, Application Gateway, Key Vault, Postgres, Redis and more |
Three ways out of the browser
Section titled âThree ways out of the browserâWhen something fails, start by finding out which of these paths the request took.
- 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).
- Directly to Dialogporten: live updates for an open dialog use Server-Sent Events against Dialogportenâs
graphql/stream, authorized with the dialogâsdialogToken(useDialogByIdSubscription.ts). - Directly to the service owner: main content, transmission content and non-
GETGUI actions are fetched from the service ownerâs URLs with thedialogToken(see Dialog anatomy and Embeddable content).
Login and sessions are described in ID Porten.