# sunet/eduid-backend architecture

> Architecture diagram of the GitHub repository sunet/eduid-backend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sunet/eduid-backend
- Repository: https://github.com/sunet/eduid-backend

## Overview

The repository is an eduID identity platform: web applications and APIs handle sign-in, account and group management, and identity proofing; shared user databases and workers support those flows. The tree and source index establish these major subsystems, but the README is empty and most implementation files were not sampled. Edges are limited to relationships visible in excerpts or source-index references; unsampled details are not inferred.

Main entry points: [`src/eduid/webapp`](https://github.com/sunet/eduid-backend/tree/main/src/eduid/webapp) (Identity and proofing apps), [`src/eduid/webapp/common/api/app.py`](https://github.com/sunet/eduid-backend/blob/main/src/eduid/webapp/common/api/app.py) (Web app base), [`src/eduid/common/config/parsers/__init__.py`](https://github.com/sunet/eduid-backend/blob/main/src/eduid/common/config/parsers/__init__.py) (Configuration loader), [`src/eduid/scimapi/app.py`](https://github.com/sunet/eduid-backend/blob/main/src/eduid/scimapi/app.py) (SCIM API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_apps["Identity applications"]
  node_identity_apps["Identity and proofing apps"]
  node_idp["Identity provider"]
  node_proofing["Proofing services"]
  node_support["Support app<br/>[app.py]"]
  node_group_management["Group management<br/>[app.py]"]
end

subgraph group_apis["Service APIs"]
  node_scim_api["SCIM API<br/>[app.py]"]
  node_scim_routes["SCIM routes"]
  node_macc_api["MACC API<br/>[app.py]"]
end

subgraph group_shared["Shared platform"]
  node_web_base["Web app base<br/>[app.py]"]
  node_auth_middleware["Authentication middleware<br/>[middleware.py]"]
  node_config["Configuration loader<br/>[__init__.py]"]
  node_auth_utils["Authentication utilities<br/>[utils.py]"]
end

subgraph group_data["Identity data"]
  node_userdb[("User database<br/>[userdb.py]")]
  node_proofing_db[("Proofing state<br/>[db.py]")]
  node_proofing_logs[("Proofing logs<br/>[db.py]")]
end

subgraph group_async["Async services"]
  node_am_relay["Account sync relay<br/>[am_relay.py]"]
  node_msg_relay["Messaging relay<br/>[msg_relay.py]"]
  node_am_worker["Account manager worker"]
  node_msg_worker["Messaging worker"]
end

node_person(("User"))
node_external_idp["External identity services"]

node_person -.->|"uses"| node_identity_apps
node_identity_apps -.->|"extends"| node_web_base
node_identity_apps -->|"loads config"| node_config
node_web_base -->|"uses config"| node_config
node_web_base -->|"initializes"| node_userdb
node_web_base -->|"supports auth"| node_auth_middleware
node_auth_middleware -.->|"uses"| node_auth_utils
node_idp -->|"uses"| node_web_base
node_idp -->|"uses"| node_auth_utils
node_proofing -->|"stores state"| node_proofing_db
node_identity_apps -->|"uses state"| node_proofing_db
node_identity_apps -->|"uses logs"| node_proofing_logs
node_identity_apps -->|"requests sync"| node_am_relay
node_am_relay -->|"dispatches tasks"| node_am_worker
node_identity_apps -->|"requests data"| node_msg_relay
node_msg_relay -->|"dispatches tasks"| node_msg_worker
node_scim_api -->|"loads config"| node_config
node_scim_api -->|"registers routes"| node_scim_routes
node_scim_api -.->|"serves requests"| node_person
node_macc_api -->|"loads config"| node_config
node_support -->|"extends"| node_web_base
node_support -.->|"uses data"| node_userdb
node_group_management -->|"uses data"| node_userdb
node_identity_apps -.->|"integrates with"| node_external_idp

click node_identity_apps "https://github.com/sunet/eduid-backend/tree/main/src/eduid/webapp"
click node_idp "https://github.com/sunet/eduid-backend/tree/main/src/eduid/webapp/idp"
click node_proofing "https://github.com/sunet/eduid-backend/tree/main/src/eduid/webapp/common/proofing"
click node_support "https://github.com/sunet/eduid-backend/blob/main/src/eduid/webapp/support/app.py"
click node_web_base "https://github.com/sunet/eduid-backend/blob/main/src/eduid/webapp/common/api/app.py"
click node_auth_middleware "https://github.com/sunet/eduid-backend/blob/main/src/eduid/webapp/common/authn/middleware.py"
click node_config "https://github.com/sunet/eduid-backend/blob/main/src/eduid/common/config/parsers/__init__.py"
click node_auth_utils "https://github.com/sunet/eduid-backend/blob/main/src/eduid/webapp/common/authn/utils.py"
click node_scim_api "https://github.com/sunet/eduid-backend/blob/main/src/eduid/scimapi/app.py"
click node_scim_routes "https://github.com/sunet/eduid-backend/tree/main/src/eduid/scimapi/routers"
click node_macc_api "https://github.com/sunet/eduid-backend/blob/main/src/eduid/maccapi/app.py"
click node_userdb "https://github.com/sunet/eduid-backend/blob/main/src/eduid/userdb/userdb.py"
click node_proofing_db "https://github.com/sunet/eduid-backend/blob/main/src/eduid/userdb/proofing/db.py"
click node_proofing_logs "https://github.com/sunet/eduid-backend/blob/main/src/eduid/userdb/logs/db.py"
click node_am_relay "https://github.com/sunet/eduid-backend/blob/main/src/eduid/common/rpc/am_relay.py"
click node_msg_relay "https://github.com/sunet/eduid-backend/blob/main/src/eduid/common/rpc/msg_relay.py"
click node_am_worker "https://github.com/sunet/eduid-backend/tree/main/src/eduid/workers/am"
click node_msg_worker "https://github.com/sunet/eduid-backend/tree/main/src/eduid/workers/msg"
click node_group_management "https://github.com/sunet/eduid-backend/blob/main/src/eduid/webapp/group_management/app.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_identity_apps,node_idp,node_proofing,node_support,node_group_management,node_person toneBlue
class node_scim_api,node_scim_routes,node_macc_api toneAmber
class node_web_base,node_auth_middleware,node_config,node_auth_utils toneMint
class node_userdb,node_proofing_db,node_proofing_logs toneRose
class node_am_relay,node_msg_relay,node_am_worker,node_msg_worker,node_external_idp toneIndigo
```

## Components

### Identity applications

- [Identity and proofing apps](https://github.com/sunet/eduid-backend/tree/main/src/eduid/webapp): `src/eduid/webapp`
- [Identity provider](https://github.com/sunet/eduid-backend/tree/main/src/eduid/webapp/idp): `src/eduid/webapp/idp`
- [Proofing services](https://github.com/sunet/eduid-backend/tree/main/src/eduid/webapp/common/proofing): `src/eduid/webapp/common/proofing`
- [Support app](https://github.com/sunet/eduid-backend/blob/main/src/eduid/webapp/support/app.py): `src/eduid/webapp/support/app.py`
- [Group management](https://github.com/sunet/eduid-backend/blob/main/src/eduid/webapp/group_management/app.py): `src/eduid/webapp/group_management/app.py`

### Service APIs

- [SCIM API](https://github.com/sunet/eduid-backend/blob/main/src/eduid/scimapi/app.py): `src/eduid/scimapi/app.py`
- [SCIM routes](https://github.com/sunet/eduid-backend/tree/main/src/eduid/scimapi/routers): `src/eduid/scimapi/routers`
- [MACC API](https://github.com/sunet/eduid-backend/blob/main/src/eduid/maccapi/app.py): `src/eduid/maccapi/app.py`

### Shared platform

- [Web app base](https://github.com/sunet/eduid-backend/blob/main/src/eduid/webapp/common/api/app.py): `src/eduid/webapp/common/api/app.py`
- [Authentication middleware](https://github.com/sunet/eduid-backend/blob/main/src/eduid/webapp/common/authn/middleware.py): `src/eduid/webapp/common/authn/middleware.py`
- [Configuration loader](https://github.com/sunet/eduid-backend/blob/main/src/eduid/common/config/parsers/__init__.py): `src/eduid/common/config/parsers/__init__.py`
- [Authentication utilities](https://github.com/sunet/eduid-backend/blob/main/src/eduid/webapp/common/authn/utils.py): `src/eduid/webapp/common/authn/utils.py`

### Identity data

- [User database](https://github.com/sunet/eduid-backend/blob/main/src/eduid/userdb/userdb.py): `src/eduid/userdb/userdb.py`
- [Proofing state](https://github.com/sunet/eduid-backend/blob/main/src/eduid/userdb/proofing/db.py): `src/eduid/userdb/proofing/db.py`
- [Proofing logs](https://github.com/sunet/eduid-backend/blob/main/src/eduid/userdb/logs/db.py): `src/eduid/userdb/logs/db.py`

### Async services

- [Account sync relay](https://github.com/sunet/eduid-backend/blob/main/src/eduid/common/rpc/am_relay.py): `src/eduid/common/rpc/am_relay.py`
- [Messaging relay](https://github.com/sunet/eduid-backend/blob/main/src/eduid/common/rpc/msg_relay.py): `src/eduid/common/rpc/msg_relay.py`
- [Account manager worker](https://github.com/sunet/eduid-backend/tree/main/src/eduid/workers/am): `src/eduid/workers/am`
- [Messaging worker](https://github.com/sunet/eduid-backend/tree/main/src/eduid/workers/msg): `src/eduid/workers/msg`

### Other components

- **User**
- **External identity services**

## Connections

- User → Identity and proofing apps: uses
- Identity and proofing apps → Web app base: extends (evidence: `src/eduid/webapp/support/app.py`)
- Identity and proofing apps → Configuration loader: loads config (evidence: `src/eduid/webapp/bankid/app.py`)
- Web app base → Configuration loader: uses config (evidence: `src/eduid/webapp/common/api/app.py`)
- Web app base → User database: initializes (evidence: `src/eduid/webapp/common/api/app.py`)
- Web app base → Authentication middleware: supports auth (evidence: `src/eduid/webapp/common/api/app.py`)
- Authentication middleware → Authentication utilities: uses (evidence: `src/eduid/webapp/common/authn/utils.py`)
- Identity provider → Web app base: uses (evidence: `src/eduid/webapp/idp/app.py`)
- Identity provider → Authentication utilities: uses (evidence: `src/eduid/webapp/idp/app.py`)
- Proofing services → Proofing state: stores state
- Identity and proofing apps → Proofing state: uses state (evidence: `src/eduid/webapp/bankid/app.py`)
- Identity and proofing apps → Proofing logs: uses logs (evidence: `src/eduid/webapp/bankid/app.py`)
- Identity and proofing apps → Account sync relay: requests sync (evidence: `src/eduid/webapp/bankid/app.py`)
- Account sync relay → Account manager worker: dispatches tasks (evidence: `src/eduid/common/rpc/am_relay.py`)
- Identity and proofing apps → Messaging relay: requests data (evidence: `src/eduid/webapp/bankid/app.py`)
- Messaging relay → Messaging worker: dispatches tasks (evidence: `src/eduid/common/rpc/msg_relay.py`)
- SCIM API → Configuration loader: loads config (evidence: `src/eduid/scimapi/app.py`)
- SCIM API → SCIM routes: registers routes (evidence: `src/eduid/scimapi/app.py`)
- SCIM API → User: serves requests
- MACC API → Configuration loader: loads config (evidence: `src/eduid/maccapi/app.py`)
- Support app → Web app base: extends (evidence: `src/eduid/webapp/support/app.py`)
- Support app → User database: uses data
- Group management → User database: uses data (evidence: `src/eduid/webapp/group_management/app.py`)
- Identity and proofing apps → External identity services: integrates with
