# chr0nzz/traefik-manager architecture

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

- Interactive diagram: https://gitdiagram.com/chr0nzz/traefik-manager
- Repository: https://github.com/chr0nzz/traefik-manager

## Overview

Traefik Manager is a self-hosted web application for managing Traefik without hand-editing YAML. The main workflow is an administrator using the UI to inspect or change routes and related configuration, which the Flask application exposes and persists; monitoring and notifications provide ongoing operational feedback. The README documents broader capabilities such as certificates, CrowdSec, provider views, backups, and remote agents. Several connections reflect documented capabilities or imports; unsampled implementation details are not inferred.

Main entry points: [`app.py`](https://github.com/chr0nzz/traefik-manager/blob/main/app.py) (Flask application), [`core/monitor.py`](https://github.com/chr0nzz/traefik-manager/blob/main/core/monitor.py) (Background monitor), [`core/routes_build.py`](https://github.com/chr0nzz/traefik-manager/blob/main/core/routes_build.py) (Route config builder), [`core/settings.py`](https://github.com/chr0nzz/traefik-manager/blob/main/core/settings.py) (Settings store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web interface"]
  node_webui["Management UI<br/>[core.js]"]
  node_routes_ui["Route editor<br/>[routes.js]"]
  node_services_ui["Service editor<br/>[services.js]"]
  node_settings_ui["Settings UI<br/>[settings-modal.js]"]
  node_logs_ui["Logs and analytics UI<br/>[logs.js]"]
  node_crowdsec_ui["CrowdSec UI<br/>[crowdsec.js]"]
end

subgraph group_management["Traefik management"]
  node_api["Flask application<br/>[app.py]"]
  node_route_builder["Route config builder<br/>[routes_build.py]"]
  node_composite["Composite services"]
  node_ownership["Service ownership"]
  node_traefik_api["Traefik API access<br/>[traefik.py]"]
  node_dynamic_config["Dynamic config files<br/>[config.py]"]
  node_backups["Backups and restore<br/>[backups.py]"]
  node_git["Git backup integration<br/>[git.py]"]
end

subgraph group_operations["Operations and insights"]
  node_certificates["Certificate management<br/>[certs.py]"]
  node_acme_store["ACME certificate store<br/>[acme_store.py]"]
  node_monitor["Background monitor<br/>[monitor.py]"]
  node_route_health["Route health checks<br/>[route_health.py]"]
  node_crowdsec["CrowdSec insights<br/>[crowdsec.py]"]
  node_geoip["GeoIP enrichment<br/>[geoip.py]"]
  node_notifications["Notification dispatch<br/>[notifications.py]"]
  node_notify_providers["Notification providers"]
  node_providers["Provider discovery<br/>[providers.py]"]
  node_updates["Release checks<br/>[updates.py]"]
end

subgraph group_security["Identity and agents"]
  node_auth["Authentication<br/>[auth.py]"]
  node_oidc["OIDC token handling<br/>[oidc_tokens.py]"]
  node_agent_api["Agent HTTP client<br/>[agents_http.py]"]
  node_agent_store["Agent registry<br/>[agents_store.py]"]
  node_remote_agent["Remote host agent<br/>[handlers.go]"]
end

subgraph group_shared["Shared runtime"]
  node_settings["Settings store<br/>[settings.py]"]
  node_crypto["Secret encryption<br/>[crypto.py]"]
  node_rate_store["Rate-limit state<br/>[rate_store.py]"]
  node_env["Runtime environment<br/>[env.py]"]
end

node_admin(("Administrator"))

node_admin -->|"uses"| node_webui
node_webui -->|"requests management"| node_api
node_routes_ui -->|"edits routes"| node_api
node_services_ui -->|"edits services"| node_api
node_settings_ui -->|"changes settings"| node_api
node_api -->|"uses"| node_route_builder
node_api -->|"uses"| node_composite
node_api -->|"uses"| node_ownership
node_api -->|"reads and writes"| node_dynamic_config
node_route_builder -->|"builds config"| node_dynamic_config
node_route_builder -->|"uses"| node_traefik_api
node_composite -->|"uses"| node_ownership
node_api -->|"manages"| node_certificates
node_api -->|"uses"| node_acme_store
node_api -->|"uses"| node_monitor
node_monitor -->|"queries"| node_traefik_api
node_monitor -->|"checks"| node_crowdsec
node_monitor -->|"checks"| node_geoip
node_monitor -->|"raises alerts"| node_notifications
node_monitor -->|"discovers tabs"| node_providers
node_route_health -->|"uses monitor state"| node_monitor
node_api -->|"uses"| node_notifications
node_notifications -->|"delivers through"| node_notify_providers
node_api -->|"uses"| node_auth
node_auth -->|"tracks attempts"| node_rate_store
node_api -->|"uses"| node_settings
node_settings -->|"encrypts secrets"| node_crypto
node_settings -->|"loads registry"| node_agent_store
node_api -->|"uses"| node_agent_api
node_agent_api -.->|"sends requests"| node_remote_agent
node_api -->|"uses"| node_backups
node_api -->|"uses"| node_git
node_logs_ui -->|"requests logs"| node_api
node_crowdsec_ui -->|"views CrowdSec"| node_api
node_api -.->|"checks releases"| node_updates
node_api -->|"uses runtime paths"| node_env

click node_webui "https://github.com/chr0nzz/traefik-manager/blob/main/static/js/core.js"
click node_routes_ui "https://github.com/chr0nzz/traefik-manager/blob/main/static/js/routes.js"
click node_services_ui "https://github.com/chr0nzz/traefik-manager/blob/main/static/js/services.js"
click node_settings_ui "https://github.com/chr0nzz/traefik-manager/blob/main/static/js/settings-modal.js"
click node_api "https://github.com/chr0nzz/traefik-manager/blob/main/app.py"
click node_route_builder "https://github.com/chr0nzz/traefik-manager/blob/main/core/routes_build.py"
click node_composite "https://github.com/chr0nzz/traefik-manager/blob/main/core/composite_services.py"
click node_ownership "https://github.com/chr0nzz/traefik-manager/blob/main/core/service_ownership.py"
click node_traefik_api "https://github.com/chr0nzz/traefik-manager/blob/main/core/traefik.py"
click node_dynamic_config "https://github.com/chr0nzz/traefik-manager/blob/main/core/config.py"
click node_certificates "https://github.com/chr0nzz/traefik-manager/blob/main/core/certs.py"
click node_acme_store "https://github.com/chr0nzz/traefik-manager/blob/main/core/acme_store.py"
click node_monitor "https://github.com/chr0nzz/traefik-manager/blob/main/core/monitor.py"
click node_route_health "https://github.com/chr0nzz/traefik-manager/blob/main/core/route_health.py"
click node_crowdsec "https://github.com/chr0nzz/traefik-manager/blob/main/core/crowdsec.py"
click node_geoip "https://github.com/chr0nzz/traefik-manager/blob/main/core/geoip.py"
click node_notifications "https://github.com/chr0nzz/traefik-manager/blob/main/core/notifications.py"
click node_notify_providers "https://github.com/chr0nzz/traefik-manager/blob/main/core/notify_providers.py"
click node_logs_ui "https://github.com/chr0nzz/traefik-manager/blob/main/static/js/logs.js"
click node_crowdsec_ui "https://github.com/chr0nzz/traefik-manager/blob/main/static/js/crowdsec.js"
click node_auth "https://github.com/chr0nzz/traefik-manager/blob/main/core/auth.py"
click node_oidc "https://github.com/chr0nzz/traefik-manager/blob/main/core/oidc_tokens.py"
click node_agent_api "https://github.com/chr0nzz/traefik-manager/blob/main/core/agents_http.py"
click node_agent_store "https://github.com/chr0nzz/traefik-manager/blob/main/core/agents_store.py"
click node_remote_agent "https://github.com/chr0nzz/traefik-manager/blob/main/agent/handlers.go"
click node_settings "https://github.com/chr0nzz/traefik-manager/blob/main/core/settings.py"
click node_crypto "https://github.com/chr0nzz/traefik-manager/blob/main/core/crypto.py"
click node_rate_store "https://github.com/chr0nzz/traefik-manager/blob/main/core/rate_store.py"
click node_env "https://github.com/chr0nzz/traefik-manager/blob/main/core/env.py"
click node_backups "https://github.com/chr0nzz/traefik-manager/blob/main/core/backups.py"
click node_git "https://github.com/chr0nzz/traefik-manager/blob/main/core/git.py"
click node_providers "https://github.com/chr0nzz/traefik-manager/blob/main/core/providers.py"
click node_updates "https://github.com/chr0nzz/traefik-manager/blob/main/core/updates.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_webui,node_routes_ui,node_services_ui,node_settings_ui,node_logs_ui,node_crowdsec_ui toneBlue
class node_api,node_route_builder,node_composite,node_ownership,node_traefik_api,node_dynamic_config,node_backups,node_git toneAmber
class node_certificates,node_acme_store,node_monitor,node_route_health,node_crowdsec,node_geoip,node_notifications,node_notify_providers,node_providers,node_updates toneMint
class node_auth,node_oidc,node_agent_api,node_agent_store,node_remote_agent toneRose
class node_settings,node_crypto,node_rate_store,node_env,node_admin toneIndigo
```

## Components

### Web interface

- [Management UI](https://github.com/chr0nzz/traefik-manager/blob/main/static/js/core.js): `static/js/core.js`
- [Route editor](https://github.com/chr0nzz/traefik-manager/blob/main/static/js/routes.js): `static/js/routes.js`
- [Service editor](https://github.com/chr0nzz/traefik-manager/blob/main/static/js/services.js): `static/js/services.js`
- [Settings UI](https://github.com/chr0nzz/traefik-manager/blob/main/static/js/settings-modal.js): `static/js/settings-modal.js`
- [Logs and analytics UI](https://github.com/chr0nzz/traefik-manager/blob/main/static/js/logs.js): `static/js/logs.js`
- [CrowdSec UI](https://github.com/chr0nzz/traefik-manager/blob/main/static/js/crowdsec.js): `static/js/crowdsec.js`

### Traefik management

- [Flask application](https://github.com/chr0nzz/traefik-manager/blob/main/app.py): `app.py`
- [Route config builder](https://github.com/chr0nzz/traefik-manager/blob/main/core/routes_build.py): `core/routes_build.py`
- [Composite services](https://github.com/chr0nzz/traefik-manager/blob/main/core/composite_services.py): `core/composite_services.py`
- [Service ownership](https://github.com/chr0nzz/traefik-manager/blob/main/core/service_ownership.py): `core/service_ownership.py`
- [Traefik API access](https://github.com/chr0nzz/traefik-manager/blob/main/core/traefik.py): `core/traefik.py`
- [Dynamic config files](https://github.com/chr0nzz/traefik-manager/blob/main/core/config.py): `core/config.py`
- [Backups and restore](https://github.com/chr0nzz/traefik-manager/blob/main/core/backups.py): `core/backups.py`
- [Git backup integration](https://github.com/chr0nzz/traefik-manager/blob/main/core/git.py): `core/git.py`

### Operations and insights

- [Certificate management](https://github.com/chr0nzz/traefik-manager/blob/main/core/certs.py): `core/certs.py`
- [ACME certificate store](https://github.com/chr0nzz/traefik-manager/blob/main/core/acme_store.py): `core/acme_store.py`
- [Background monitor](https://github.com/chr0nzz/traefik-manager/blob/main/core/monitor.py): `core/monitor.py`
- [Route health checks](https://github.com/chr0nzz/traefik-manager/blob/main/core/route_health.py): `core/route_health.py`
- [CrowdSec insights](https://github.com/chr0nzz/traefik-manager/blob/main/core/crowdsec.py): `core/crowdsec.py`
- [GeoIP enrichment](https://github.com/chr0nzz/traefik-manager/blob/main/core/geoip.py): `core/geoip.py`
- [Notification dispatch](https://github.com/chr0nzz/traefik-manager/blob/main/core/notifications.py): `core/notifications.py`
- [Notification providers](https://github.com/chr0nzz/traefik-manager/blob/main/core/notify_providers.py): `core/notify_providers.py`
- [Provider discovery](https://github.com/chr0nzz/traefik-manager/blob/main/core/providers.py): `core/providers.py`
- [Release checks](https://github.com/chr0nzz/traefik-manager/blob/main/core/updates.py): `core/updates.py`

### Identity and agents

- [Authentication](https://github.com/chr0nzz/traefik-manager/blob/main/core/auth.py): `core/auth.py`
- [OIDC token handling](https://github.com/chr0nzz/traefik-manager/blob/main/core/oidc_tokens.py): `core/oidc_tokens.py`
- [Agent HTTP client](https://github.com/chr0nzz/traefik-manager/blob/main/core/agents_http.py): `core/agents_http.py`
- [Agent registry](https://github.com/chr0nzz/traefik-manager/blob/main/core/agents_store.py): `core/agents_store.py`
- [Remote host agent](https://github.com/chr0nzz/traefik-manager/blob/main/agent/handlers.go): `agent/handlers.go`

### Shared runtime

- [Settings store](https://github.com/chr0nzz/traefik-manager/blob/main/core/settings.py): `core/settings.py`
- [Secret encryption](https://github.com/chr0nzz/traefik-manager/blob/main/core/crypto.py): `core/crypto.py`
- [Rate-limit state](https://github.com/chr0nzz/traefik-manager/blob/main/core/rate_store.py): `core/rate_store.py`
- [Runtime environment](https://github.com/chr0nzz/traefik-manager/blob/main/core/env.py): `core/env.py`

### Other components

- **Administrator**

## Connections

- Administrator → Management UI: uses (evidence: `README.md`)
- Management UI → Flask application: requests management (evidence: `README.md`)
- Route editor → Flask application: edits routes (evidence: `README.md`)
- Service editor → Flask application: edits services (evidence: `README.md`)
- Settings UI → Flask application: changes settings (evidence: `README.md`)
- Flask application → Route config builder: uses (evidence: `app.py`)
- Flask application → Composite services: uses (evidence: `app.py`)
- Flask application → Service ownership: uses (evidence: `app.py`)
- Flask application → Dynamic config files: reads and writes (evidence: `app.py`)
- Route config builder → Dynamic config files: builds config (evidence: `core/routes_build.py`)
- Route config builder → Traefik API access: uses (evidence: `core/routes_build.py`)
- Composite services → Service ownership: uses (evidence: `core/composite_services.py`)
- Flask application → Certificate management: manages (evidence: `app.py`)
- Flask application → ACME certificate store: uses (evidence: `app.py`)
- Flask application → Background monitor: uses (evidence: `app.py`)
- Background monitor → Traefik API access: queries (evidence: `core/monitor.py`)
- Background monitor → CrowdSec insights: checks (evidence: `core/monitor.py`)
- Background monitor → GeoIP enrichment: checks (evidence: `core/monitor.py`)
- Background monitor → Notification dispatch: raises alerts (evidence: `core/monitor.py`)
- Background monitor → Provider discovery: discovers tabs (evidence: `core/monitor.py`)
- Route health checks → Background monitor: uses monitor state (evidence: `core/route_health.py`)
- Flask application → Notification dispatch: uses (evidence: `app.py`)
- Notification dispatch → Notification providers: delivers through (evidence: `core/notifications.py`)
- Flask application → Authentication: uses (evidence: `app.py`)
- Authentication → Rate-limit state: tracks attempts (evidence: `core/auth.py`)
- Flask application → Settings store: uses (evidence: `app.py`)
- Settings store → Secret encryption: encrypts secrets (evidence: `core/settings.py`)
- Settings store → Agent registry: loads registry (evidence: `core/settings.py`)
- Flask application → Agent HTTP client: uses (evidence: `app.py`)
- Agent HTTP client → Remote host agent: sends requests (evidence: `README.md`)
- Flask application → Backups and restore: uses (evidence: `app.py`)
- Flask application → Git backup integration: uses (evidence: `app.py`)
- Logs and analytics UI → Flask application: requests logs (evidence: `README.md`)
- CrowdSec UI → Flask application: views CrowdSec (evidence: `README.md`)
- Flask application → Release checks: checks releases (evidence: `README.md`)
- Flask application → Runtime environment: uses runtime paths (evidence: `app.py`)
