# sta-cloud-dev/sta-edge architecture

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

- Interactive diagram: https://gitdiagram.com/sta-cloud-dev/sta-edge
- Repository: https://github.com/sta-cloud-dev/sta-edge

## Overview

STA Proxy Manager is a Windows desktop app for administering Caddy servers over SSH. The main workflow is to manage a server connection, inspect its host and Caddy state, edit and validate configuration, then apply changes with backup and recovery support. Separate capabilities cover Certbot, background tasks, SSH keys, local/cloud workspaces, and signed updates. The graph follows documented capabilities and visible references; several frontend-to-command links and unsampled subsystem details are left unasserted.

Main entry points: [`windows/src/App.tsx`](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src/App.tsx) (Application shell), [`windows/src-tauri/src/ssh.rs`](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/ssh.rs) (SSH sessions and inventory), [`windows/src/services/api.ts`](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src/services/api.ts) (Tauri API client), [`windows/src-tauri/src/management.rs`](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/management.rs) (Management operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Desktop interface"]
  node_app["Application shell<br/>[App.tsx]"]
  node_management_ui["Server management UI<br/>[Management.tsx]"]
  node_workspace_ui["Workspace UI<br/>[Workspace.tsx]"]
  node_updates_ui["Update UI<br/>[Updates.tsx]"]
  node_forms_ui["Connection forms<br/>[Forms.tsx]"]
  node_editor["Caddy editor<br/>[CaddyEditor.tsx]"]
  node_api["Tauri API client<br/>[api.ts]"]
end

subgraph group_backend["Command and management"]
  node_commands["Tauri commands<br/>[commands.rs]"]
  node_management["Management operations<br/>[management.rs]"]
  node_models["Domain models<br/>[models.rs]"]
end

subgraph group_remote["SSH and server access"]
  node_ssh["SSH sessions and inventory<br/>[ssh.rs]"]
  node_remote["Remote operations<br/>[remote.rs]"]
  node_security["Validation and protection<br/>[security.rs]"]
end

subgraph group_config["Configuration and recovery"]
  node_caddy_parser["Caddy parser<br/>[caddy_parser.rs]"]
  node_configuration["Config planning<br/>[configuration.rs]"]
  node_certbot["Certbot operations<br/>[certbot.rs]"]
  node_tasks["Remote tasks and backups<br/>[tasks.rs]"]
end

subgraph group_state["Workspace and state"]
  node_database[("Local state store<br/>[database.rs]")]
  node_workspace["Workspace sync<br/>[workspace.rs]"]
  node_updates["Update service<br/>[updates.rs]"]
end

node_user(("Administrator"))
node_remote_host["Managed Linux host"]
node_cloud_db[("Cloud database")]
node_github["GitHub Releases"]

node_user -->|"uses"| node_app
node_app -->|"renders"| node_management_ui
node_app -->|"renders"| node_workspace_ui
node_app -->|"renders"| node_updates_ui
node_app -->|"invokes"| node_api
node_management_ui -->|"invokes"| node_api
node_management_ui -->|"renders"| node_editor
node_management_ui -->|"uses"| node_forms_ui
node_workspace_ui -->|"invokes"| node_api
node_updates_ui -->|"invokes"| node_api
node_api -.->|"dispatches"| node_commands
node_commands -->|"reads and writes"| node_database
node_commands -->|"uses"| node_ssh
node_commands -->|"validates"| node_security
node_management -->|"uses"| node_remote
node_management -->|"plans"| node_configuration
node_management -->|"launches"| node_tasks
node_management -->|"delegates"| node_certbot
node_ssh -->|"checks host keys"| node_database
node_ssh -->|"uses"| node_security
node_ssh -->|"connects"| node_remote_host
node_remote -->|"uses"| node_ssh
node_configuration -.->|"parses config"| node_caddy_parser
node_tasks -->|"applies plans"| node_configuration
node_database -->|"protects credentials"| node_security
node_workspace -->|"uses local state"| node_database
node_workspace -->|"syncs payload"| node_cloud_db
node_updates_ui -.->|"requests updates"| node_updates
node_updates -->|"checks releases"| node_github

click node_app "https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src/App.tsx"
click node_management_ui "https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src/components/Management.tsx"
click node_workspace_ui "https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src/components/Workspace.tsx"
click node_updates_ui "https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src/components/Updates.tsx"
click node_forms_ui "https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src/components/Forms.tsx"
click node_editor "https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src/components/CaddyEditor.tsx"
click node_api "https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src/services/api.ts"
click node_commands "https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/commands.rs"
click node_management "https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/management.rs"
click node_models "https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/models.rs"
click node_ssh "https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/ssh.rs"
click node_remote "https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/remote.rs"
click node_security "https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/security.rs"
click node_caddy_parser "https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/caddy_parser.rs"
click node_configuration "https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/configuration.rs"
click node_certbot "https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/certbot.rs"
click node_tasks "https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/tasks.rs"
click node_database "https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/database.rs"
click node_workspace "https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/workspace.rs"
click node_updates "https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/updates.rs"

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_app,node_management_ui,node_workspace_ui,node_updates_ui,node_forms_ui,node_editor,node_api toneBlue
class node_commands,node_management,node_models,node_cloud_db toneAmber
class node_ssh,node_remote,node_security toneMint
class node_caddy_parser,node_configuration,node_certbot,node_tasks toneRose
class node_database,node_workspace,node_updates,node_user,node_remote_host,node_github toneIndigo
```

## Components

### Desktop interface

- [Application shell](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src/App.tsx): `windows/src/App.tsx`
- [Server management UI](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src/components/Management.tsx): `windows/src/components/Management.tsx`
- [Workspace UI](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src/components/Workspace.tsx): `windows/src/components/Workspace.tsx`
- [Update UI](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src/components/Updates.tsx): `windows/src/components/Updates.tsx`
- [Connection forms](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src/components/Forms.tsx): `windows/src/components/Forms.tsx`
- [Caddy editor](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src/components/CaddyEditor.tsx): `windows/src/components/CaddyEditor.tsx`
- [Tauri API client](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src/services/api.ts): `windows/src/services/api.ts`

### Command and management

- [Tauri commands](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/commands.rs): `windows/src-tauri/src/commands.rs`
- [Management operations](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/management.rs): `windows/src-tauri/src/management.rs`
- [Domain models](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/models.rs): `windows/src-tauri/src/models.rs`

### SSH and server access

- [SSH sessions and inventory](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/ssh.rs): `windows/src-tauri/src/ssh.rs`
- [Remote operations](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/remote.rs): `windows/src-tauri/src/remote.rs`
- [Validation and protection](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/security.rs): `windows/src-tauri/src/security.rs`

### Configuration and recovery

- [Caddy parser](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/caddy_parser.rs): `windows/src-tauri/src/caddy_parser.rs`
- [Config planning](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/configuration.rs): `windows/src-tauri/src/configuration.rs`
- [Certbot operations](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/certbot.rs): `windows/src-tauri/src/certbot.rs`
- [Remote tasks and backups](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/tasks.rs): `windows/src-tauri/src/tasks.rs`

### Workspace and state

- [Local state store](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/database.rs): `windows/src-tauri/src/database.rs`
- [Workspace sync](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/workspace.rs): `windows/src-tauri/src/workspace.rs`
- [Update service](https://github.com/sta-cloud-dev/sta-edge/blob/main/windows/src-tauri/src/updates.rs): `windows/src-tauri/src/updates.rs`

### Other components

- **Administrator**
- **Managed Linux host**
- **Cloud database**
- **GitHub Releases**

## Connections

- Administrator → Application shell: uses (evidence: `README.md`)
- Application shell → Server management UI: renders (evidence: `windows/src/App.tsx`)
- Application shell → Workspace UI: renders (evidence: `windows/src/App.tsx`)
- Application shell → Update UI: renders (evidence: `windows/src/App.tsx`)
- Application shell → Tauri API client: invokes (evidence: `windows/src/App.tsx`)
- Server management UI → Tauri API client: invokes (evidence: `windows/src/components/Management.tsx`)
- Server management UI → Caddy editor: renders (evidence: `windows/src/components/Management.tsx`)
- Server management UI → Connection forms: uses (evidence: `windows/src/components/Management.tsx`)
- Workspace UI → Tauri API client: invokes (evidence: `windows/src/components/Workspace.tsx`)
- Update UI → Tauri API client: invokes (evidence: `windows/src/components/Updates.tsx`)
- Tauri API client → Tauri commands: dispatches
- Tauri commands → Local state store: reads and writes (evidence: `windows/src-tauri/src/commands.rs`)
- Tauri commands → SSH sessions and inventory: uses (evidence: `windows/src-tauri/src/commands.rs`)
- Tauri commands → Validation and protection: validates (evidence: `windows/src-tauri/src/commands.rs`)
- Management operations → Remote operations: uses (evidence: `windows/src-tauri/src/management.rs`)
- Management operations → Config planning: plans (evidence: `windows/src-tauri/src/management.rs`)
- Management operations → Remote tasks and backups: launches (evidence: `windows/src-tauri/src/management.rs`)
- Management operations → Certbot operations: delegates (evidence: `windows/src-tauri/src/management.rs`)
- SSH sessions and inventory → Local state store: checks host keys (evidence: `windows/src-tauri/src/ssh.rs`)
- SSH sessions and inventory → Validation and protection: uses (evidence: `windows/src-tauri/src/ssh.rs`)
- SSH sessions and inventory → Managed Linux host: connects (evidence: `README.md`)
- Remote operations → SSH sessions and inventory: uses (evidence: `windows/src-tauri/src/remote.rs`)
- Config planning → Caddy parser: parses config
- Remote tasks and backups → Config planning: applies plans (evidence: `windows/src-tauri/src/tasks.rs`)
- Local state store → Validation and protection: protects credentials (evidence: `windows/src-tauri/src/database.rs`)
- Workspace sync → Local state store: uses local state (evidence: `windows/src-tauri/src/workspace.rs`)
- Workspace sync → Cloud database: syncs payload (evidence: `README.md`)
- Update UI → Update service: requests updates
- Update service → GitHub Releases: checks releases (evidence: `README.md`)
