# yokoinc/orthanc-authelia architecture

> Architecture diagram of the GitHub repository yokoinc/orthanc-authelia, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yokoinc/orthanc-authelia
- Repository: https://github.com/yokoinc/orthanc-authelia

## Overview

ORTHANC-AUTHELIA is a browser-administered PACS combining DICOM storage, Authelia single sign-on, OHIF viewing, and limited external sharing. The main workflow is browser → Nginx → Authelia for account-based access, then OHIF and Orthanc for imaging; share links instead pass through auth-service token validation and enforce study, expiry, and usage limits. Administrators use the same service’s panel for accounts, modalities, Orthanc settings, session/public-address configuration, backups, audit, and health. The README documents these capabilities; sampled source confirms selected routing, token, and admin behavior, not every stack connection.

Main entry points: [`services/nginx`](https://github.com/yokoinc/orthanc-authelia/tree/master/services/nginx) (Nginx gateway), [`services/auth-service/sources/auth_service.py`](https://github.com/yokoinc/orthanc-authelia/blob/master/services/auth-service/sources/auth_service.py) (Auth service), [`orthanc.json.example`](https://github.com/yokoinc/orthanc-authelia/blob/master/orthanc.json.example) (Orthanc PACS), [`authelia-configuration.yml.example`](https://github.com/yokoinc/orthanc-authelia/blob/master/authelia-configuration.yml.example) (Authelia SSO)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access gateway"]
  node_nginx["Nginx gateway"]
end

subgraph group_identity["Identity and sharing"]
  node_authelia["Authelia SSO"]
  node_redis[("Session store")]
  node_auth["Auth service<br/>[auth_service.py]"]
  node_tokens[("Share tokens<br/>[auth_service.py]")]
  node_userdb[("Authelia users")]
  node_tokenui["Share management<br/>[token-manager.js]"]
end

subgraph group_imaging["PACS and viewer"]
  node_ohif["OHIF viewer<br/>[app-config.js]"]
  node_orthanc["Orthanc PACS"]
  node_postgres[("PACS database")]
end

subgraph group_admin["Administration"]
  node_adminui["Admin panel<br/>[admin.html]"]
  node_adminjs["Admin interactions<br/>[admin.js]"]
  node_adminapi["Admin API<br/>[admin_module.py]"]
  node_setup["Setup wizard<br/>[setup.html]"]
  node_i18n["Translations<br/>[i18n.py]"]
end

node_browser(("Browser"))

node_browser -->|"requests PACS"| node_nginx
node_nginx -->|"auth checks"| node_authelia
node_authelia -->|"stores sessions"| node_redis
node_authelia -->|"reads users"| node_userdb
node_nginx -->|"serves viewer"| node_ohif
node_nginx -->|"proxies imaging"| node_orthanc
node_ohif -->|"requests DICOM"| node_orthanc
node_orthanc -->|"stores PACS data"| node_postgres
node_browser -->|"opens share link"| node_nginx
node_nginx -->|"routes share"| node_auth
node_auth -->|"validates usage"| node_tokens
node_auth -->|"uses token state"| node_redis
node_ohif -->|"validates token"| node_auth
node_browser -->|"uses panel"| node_adminui
node_adminui -->|"loads script"| node_adminjs
node_adminjs -->|"calls admin API"| node_adminapi
node_adminapi -->|"reads and updates config"| node_orthanc
node_browser -->|"starts setup"| node_setup
node_setup -->|"submits setup"| node_auth
node_adminui -->|"loads translations"| node_i18n
node_browser -->|"manages shares"| node_tokenui
node_tokenui -->|"calls token API"| node_auth

click node_nginx "https://github.com/yokoinc/orthanc-authelia/tree/master/services/nginx"
click node_authelia "https://github.com/yokoinc/orthanc-authelia/blob/master/authelia-configuration.yml.example"
click node_auth "https://github.com/yokoinc/orthanc-authelia/blob/master/services/auth-service/sources/auth_service.py"
click node_tokens "https://github.com/yokoinc/orthanc-authelia/blob/master/services/auth-service/sources/auth_service.py"
click node_ohif "https://github.com/yokoinc/orthanc-authelia/blob/master/services/ohif/config/app-config.js"
click node_orthanc "https://github.com/yokoinc/orthanc-authelia/blob/master/orthanc.json.example"
click node_postgres "https://github.com/yokoinc/orthanc-authelia/blob/master/services/postgres"
click node_adminui "https://github.com/yokoinc/orthanc-authelia/blob/master/services/auth-service/sources/templates/admin.html"
click node_adminjs "https://github.com/yokoinc/orthanc-authelia/blob/master/services/auth-service/sources/static/admin.js"
click node_adminapi "https://github.com/yokoinc/orthanc-authelia/blob/master/services/auth-service/sources/admin_module.py"
click node_setup "https://github.com/yokoinc/orthanc-authelia/blob/master/services/auth-service/sources/templates/setup.html"
click node_userdb "https://github.com/yokoinc/orthanc-authelia/blob/master/authelia-users.yml.example"
click node_i18n "https://github.com/yokoinc/orthanc-authelia/blob/master/services/auth-service/sources/i18n.py"
click node_tokenui "https://github.com/yokoinc/orthanc-authelia/blob/master/services/auth-service/sources/static/token-manager.js"

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_nginx,node_browser toneBlue
class node_authelia,node_redis,node_auth,node_tokens,node_userdb,node_tokenui toneAmber
class node_ohif,node_orthanc,node_postgres toneMint
class node_adminui,node_adminjs,node_adminapi,node_setup,node_i18n toneRose
```

## Components

### Access gateway

- [Nginx gateway](https://github.com/yokoinc/orthanc-authelia/tree/master/services/nginx): `services/nginx`

### Identity and sharing

- [Authelia SSO](https://github.com/yokoinc/orthanc-authelia/blob/master/authelia-configuration.yml.example): `authelia-configuration.yml.example`
- **Session store**
- [Auth service](https://github.com/yokoinc/orthanc-authelia/blob/master/services/auth-service/sources/auth_service.py): `services/auth-service/sources/auth_service.py`
- [Share tokens](https://github.com/yokoinc/orthanc-authelia/blob/master/services/auth-service/sources/auth_service.py): `services/auth-service/sources/auth_service.py`
- [Authelia users](https://github.com/yokoinc/orthanc-authelia/blob/master/authelia-users.yml.example): `authelia-users.yml.example`
- [Share management](https://github.com/yokoinc/orthanc-authelia/blob/master/services/auth-service/sources/static/token-manager.js): `services/auth-service/sources/static/token-manager.js`

### PACS and viewer

- [OHIF viewer](https://github.com/yokoinc/orthanc-authelia/blob/master/services/ohif/config/app-config.js): `services/ohif/config/app-config.js`
- [Orthanc PACS](https://github.com/yokoinc/orthanc-authelia/blob/master/orthanc.json.example): `orthanc.json.example`
- [PACS database](https://github.com/yokoinc/orthanc-authelia/blob/master/services/postgres): `services/postgres`

### Administration

- [Admin panel](https://github.com/yokoinc/orthanc-authelia/blob/master/services/auth-service/sources/templates/admin.html): `services/auth-service/sources/templates/admin.html`
- [Admin interactions](https://github.com/yokoinc/orthanc-authelia/blob/master/services/auth-service/sources/static/admin.js): `services/auth-service/sources/static/admin.js`
- [Admin API](https://github.com/yokoinc/orthanc-authelia/blob/master/services/auth-service/sources/admin_module.py): `services/auth-service/sources/admin_module.py`
- [Setup wizard](https://github.com/yokoinc/orthanc-authelia/blob/master/services/auth-service/sources/templates/setup.html): `services/auth-service/sources/templates/setup.html`
- [Translations](https://github.com/yokoinc/orthanc-authelia/blob/master/services/auth-service/sources/i18n.py): `services/auth-service/sources/i18n.py`

### Other components

- **Browser**

## Connections

- Browser → Nginx gateway: requests PACS
- Nginx gateway → Authelia SSO: auth checks
- Authelia SSO → Session store: stores sessions
- Authelia SSO → Authelia users: reads users
- Nginx gateway → OHIF viewer: serves viewer
- Nginx gateway → Orthanc PACS: proxies imaging
- OHIF viewer → Orthanc PACS: requests DICOM
- Orthanc PACS → PACS database: stores PACS data
- Browser → Nginx gateway: opens share link
- Nginx gateway → Auth service: routes share
- Auth service → Share tokens: validates usage
- Auth service → Session store: uses token state
- OHIF viewer → Auth service: validates token
- Browser → Admin panel: uses panel
- Admin panel → Admin interactions: loads script
- Admin interactions → Admin API: calls admin API
- Admin API → Orthanc PACS: reads and updates config
- Browser → Setup wizard: starts setup
- Setup wizard → Auth service: submits setup
- Admin panel → Translations: loads translations
- Browser → Share management: manages shares
- Share management → Auth service: calls token API
