# weitgraven/tela architecture

> Architecture diagram of the GitHub repository weitgraven/tela, 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/weitgraven/tela
- Repository: https://github.com/weitgraven/tela

## Overview

Tela is a self-hosted hosting control panel. An administrator signs in to the web panel, uses feature screens to request hosting changes, and the panel API delegates privileged work to a local Unix-socket agent; the agent validates and dispatches named actions that configure server services. Separate feature branches cover websites, databases, DNS, mail, backups, and WordPress. The README documents all of these capabilities, although several corresponding source modules were not excerpted, so their internal calls are not inferred here.

Main entry points: [`src/tela_agent/registry.py`](https://github.com/weitgraven/tela/blob/main/src/tela_agent/registry.py) (Action registry), [`src/tela_agent/actions/websites.py`](https://github.com/weitgraven/tela/blob/main/src/tela_agent/actions/websites.py) (Website actions), [`src/tela_agent/actions/dns.py`](https://github.com/weitgraven/tela/blob/main/src/tela_agent/actions/dns.py) (DNS actions), [`src/tela/api/websites.py`](https://github.com/weitgraven/tela/blob/main/src/tela/api/websites.py) (Website API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_panel["Panel"]
  node_web["Panel UI<br/>[app.js]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_api_sites["Website API<br/>[websites.py]"]
  node_api_features["Feature APIs"]
  node_panel_db[("Panel database<br/>[db.py]")]
  node_client["Agent client<br/>[agent_client.py]"]
end

subgraph group_agent["Privileged agent"]
  node_server["Agent server<br/>[server.py]"]
  node_registry["Action registry<br/>[registry.py]"]
  node_validation["Input validation<br/>[validate.py]"]
end

subgraph group_hosting["Hosting features"]
  node_websites["Website actions<br/>[websites.py]"]
  node_databases["Database actions<br/>[databases.py]"]
  node_dns["DNS actions<br/>[dns.py]"]
  node_mail["Mail actions<br/>[mail.py]"]
  node_backups["Backup actions<br/>[backups.py]"]
  node_wordpress["WordPress actions<br/>[wordpress.py]"]
end

subgraph group_services["Server services"]
  node_ols["Web server config<br/>[ols.py]"]
  node_system["Host operations<br/>[sysops.py]"]
  node_mariadb[("MariaDB<br/>[mariadb.py]")]
  node_cloudflare["Cloudflare<br/>[cloudflare.py]"]
  node_powerdns["PowerDNS<br/>[powerdns.py]"]
  node_restic["Restic backups<br/>[restic.py]"]
end

node_admin(("Administrator"))

node_admin -->|"uses"| node_web
node_web -.->|"requests changes"| node_api_sites
node_web -.->|"requests features"| node_api_features
node_api_sites -->|"checks identity"| node_auth
node_api_sites -->|"reads ownership"| node_panel_db
node_api_sites -->|"calls agent"| node_client
node_api_features -.->|"delegates actions"| node_client
node_auth -->|"stores sessions"| node_panel_db
node_client -.->|"sends socket request"| node_server
node_server -->|"dispatches action"| node_registry
node_registry -.->|"routes actions"| node_websites
node_registry -.->|"routes actions"| node_databases
node_registry -.->|"routes actions"| node_dns
node_registry -.->|"routes actions"| node_mail
node_registry -.->|"routes actions"| node_backups
node_registry -.->|"routes actions"| node_wordpress
node_websites -->|"validates input"| node_validation
node_databases -->|"validates input"| node_validation
node_websites -->|"configures sites"| node_ols
node_websites -.->|"adds site records"| node_dns
node_databases -->|"manages databases"| node_mariadb
node_dns -->|"edits zones"| node_cloudflare
node_dns -->|"manages zones"| node_powerdns
node_mail -->|"adds mail records"| node_dns
node_backups -.->|"runs snapshots"| node_restic
node_wordpress -->|"uses backup actions"| node_backups
node_websites -->|"manages host users"| node_system
node_websites -->|"checks name conflicts"| node_dns

click node_web "https://github.com/weitgraven/tela/blob/main/web/app.js"
click node_auth "https://github.com/weitgraven/tela/blob/main/src/tela/api/auth.py"
click node_api_sites "https://github.com/weitgraven/tela/blob/main/src/tela/api/websites.py"
click node_api_features "https://github.com/weitgraven/tela/tree/main/src/tela/api"
click node_panel_db "https://github.com/weitgraven/tela/blob/main/src/tela/db.py"
click node_client "https://github.com/weitgraven/tela/blob/main/src/tela/agent_client.py"
click node_server "https://github.com/weitgraven/tela/blob/main/src/tela_agent/server.py"
click node_registry "https://github.com/weitgraven/tela/blob/main/src/tela_agent/registry.py"
click node_validation "https://github.com/weitgraven/tela/blob/main/src/tela_agent/validate.py"
click node_websites "https://github.com/weitgraven/tela/blob/main/src/tela_agent/actions/websites.py"
click node_databases "https://github.com/weitgraven/tela/blob/main/src/tela_agent/actions/databases.py"
click node_dns "https://github.com/weitgraven/tela/blob/main/src/tela_agent/actions/dns.py"
click node_mail "https://github.com/weitgraven/tela/blob/main/src/tela_agent/actions/mail.py"
click node_backups "https://github.com/weitgraven/tela/blob/main/src/tela_agent/actions/backups.py"
click node_wordpress "https://github.com/weitgraven/tela/blob/main/src/tela_agent/actions/wordpress.py"
click node_ols "https://github.com/weitgraven/tela/blob/main/src/tela_agent/ols.py"
click node_system "https://github.com/weitgraven/tela/blob/main/src/tela_agent/sysops.py"
click node_mariadb "https://github.com/weitgraven/tela/blob/main/src/tela_agent/mariadb.py"
click node_cloudflare "https://github.com/weitgraven/tela/blob/main/src/tela_agent/cloudflare.py"
click node_powerdns "https://github.com/weitgraven/tela/blob/main/src/tela_agent/powerdns.py"
click node_restic "https://github.com/weitgraven/tela/blob/main/src/tela_agent/restic.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_web,node_auth,node_api_sites,node_api_features,node_panel_db,node_client toneBlue
class node_server,node_registry,node_validation toneAmber
class node_websites,node_databases,node_dns,node_mail,node_backups,node_wordpress toneMint
class node_ols,node_system,node_mariadb,node_cloudflare,node_powerdns,node_restic toneRose
class node_admin toneIndigo
```

## Components

### Panel

- [Panel UI](https://github.com/weitgraven/tela/blob/main/web/app.js): `web/app.js`
- [Authentication](https://github.com/weitgraven/tela/blob/main/src/tela/api/auth.py): `src/tela/api/auth.py`
- [Website API](https://github.com/weitgraven/tela/blob/main/src/tela/api/websites.py): `src/tela/api/websites.py`
- [Feature APIs](https://github.com/weitgraven/tela/tree/main/src/tela/api): `src/tela/api`
- [Panel database](https://github.com/weitgraven/tela/blob/main/src/tela/db.py): `src/tela/db.py`
- [Agent client](https://github.com/weitgraven/tela/blob/main/src/tela/agent_client.py): `src/tela/agent_client.py`

### Privileged agent

- [Agent server](https://github.com/weitgraven/tela/blob/main/src/tela_agent/server.py): `src/tela_agent/server.py`
- [Action registry](https://github.com/weitgraven/tela/blob/main/src/tela_agent/registry.py): `src/tela_agent/registry.py`
- [Input validation](https://github.com/weitgraven/tela/blob/main/src/tela_agent/validate.py): `src/tela_agent/validate.py`

### Hosting features

- [Website actions](https://github.com/weitgraven/tela/blob/main/src/tela_agent/actions/websites.py): `src/tela_agent/actions/websites.py`
- [Database actions](https://github.com/weitgraven/tela/blob/main/src/tela_agent/actions/databases.py): `src/tela_agent/actions/databases.py`
- [DNS actions](https://github.com/weitgraven/tela/blob/main/src/tela_agent/actions/dns.py): `src/tela_agent/actions/dns.py`
- [Mail actions](https://github.com/weitgraven/tela/blob/main/src/tela_agent/actions/mail.py): `src/tela_agent/actions/mail.py`
- [Backup actions](https://github.com/weitgraven/tela/blob/main/src/tela_agent/actions/backups.py): `src/tela_agent/actions/backups.py`
- [WordPress actions](https://github.com/weitgraven/tela/blob/main/src/tela_agent/actions/wordpress.py): `src/tela_agent/actions/wordpress.py`

### Server services

- [Web server config](https://github.com/weitgraven/tela/blob/main/src/tela_agent/ols.py): `src/tela_agent/ols.py`
- [Host operations](https://github.com/weitgraven/tela/blob/main/src/tela_agent/sysops.py): `src/tela_agent/sysops.py`
- [MariaDB](https://github.com/weitgraven/tela/blob/main/src/tela_agent/mariadb.py): `src/tela_agent/mariadb.py`
- [Cloudflare](https://github.com/weitgraven/tela/blob/main/src/tela_agent/cloudflare.py): `src/tela_agent/cloudflare.py`
- [PowerDNS](https://github.com/weitgraven/tela/blob/main/src/tela_agent/powerdns.py): `src/tela_agent/powerdns.py`
- [Restic backups](https://github.com/weitgraven/tela/blob/main/src/tela_agent/restic.py): `src/tela_agent/restic.py`

### Other components

- **Administrator**

## Connections

- Administrator → Panel UI: uses
- Panel UI → Website API: requests changes
- Panel UI → Feature APIs: requests features
- Website API → Authentication: checks identity (evidence: `src/tela/api/websites.py`)
- Website API → Panel database: reads ownership (evidence: `src/tela/api/websites.py`)
- Website API → Agent client: calls agent (evidence: `src/tela/api/websites.py`)
- Feature APIs → Agent client: delegates actions (evidence: `src/tela/api/common.py`)
- Authentication → Panel database: stores sessions
- Agent client → Agent server: sends socket request
- Agent server → Action registry: dispatches action (evidence: `src/tela_agent/server.py`)
- Action registry → Website actions: routes actions (evidence: `src/tela_agent/actions/websites.py`)
- Action registry → Database actions: routes actions (evidence: `src/tela_agent/actions/databases.py`)
- Action registry → DNS actions: routes actions (evidence: `src/tela_agent/actions/dns.py`)
- Action registry → Mail actions: routes actions (evidence: `src/tela_agent/actions/mail.py`)
- Action registry → Backup actions: routes actions
- Action registry → WordPress actions: routes actions (evidence: `src/tela_agent/actions/wordpress.py`)
- Website actions → Input validation: validates input (evidence: `src/tela_agent/actions/websites.py`)
- Database actions → Input validation: validates input (evidence: `src/tela_agent/actions/databases.py`)
- Website actions → Web server config: configures sites (evidence: `src/tela_agent/actions/websites.py`)
- Website actions → DNS actions: adds site records (evidence: `src/tela_agent/actions/websites.py`)
- Database actions → MariaDB: manages databases (evidence: `src/tela_agent/actions/databases.py`)
- DNS actions → Cloudflare: edits zones (evidence: `src/tela_agent/actions/dns.py`)
- DNS actions → PowerDNS: manages zones (evidence: `src/tela_agent/actions/dns.py`)
- Mail actions → DNS actions: adds mail records (evidence: `src/tela_agent/actions/mail.py`)
- Backup actions → Restic backups: runs snapshots
- WordPress actions → Backup actions: uses backup actions (evidence: `src/tela_agent/actions/wordpress.py`)
- Website actions → Host operations: manages host users (evidence: `src/tela_agent/actions/websites.py`)
- Website actions → DNS actions: checks name conflicts (evidence: `src/tela_agent/actions/websites.py`)
