# revoltchat/self-hosted architecture

> Architecture diagram of the GitHub repository revoltchat/self-hosted, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/revoltchat/self-hosted
- Repository: https://github.com/revoltchat/self-hosted

## Overview

This repository packages Stoat for self-hosting rather than implementing the chat application itself. The documented operator workflow is to prepare a server and domain, generate secrets and configuration, then start the full instance with Docker Compose. The README identifies the deployed backend, web front end, file server, and metadata/image proxy. Source excerpts were unavailable, so service wiring and routing details are limited to relationships stated in the README; the Compose and Caddy configuration contents are not inferred.

Main entry points: [`compose.yml`](https://github.com/revoltchat/self-hosted/blob/main/compose.yml) (Compose deployment), [`generate_config.sh`](https://github.com/revoltchat/self-hosted/blob/main/generate_config.sh) (Config generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Host and setup"]
  node_host["Server and domain"]
  node_config_generator["Config generator<br/>[generate_config.sh]"]
  node_secrets["Instance secrets<br/>[generate_config.sh]"]
end

subgraph group_deployment["Instance deployment"]
  node_compose["Compose deployment<br/>[compose.yml]"]
  node_backend["Stoat backend<br/>[compose.yml]"]
  node_web["Web front end<br/>[compose.yml]"]
  node_files["File server<br/>[compose.yml]"]
  node_proxy["Metadata and image proxy<br/>[compose.yml]"]
  node_caddy["Caddy routing"]
end

subgraph group_operations["Operations"]
  node_migrations["Database migrations"]
end

node_operator(("Instance operator"))

node_operator -->|"prepares"| node_host
node_operator -->|"runs for domain"| node_config_generator
node_config_generator -->|"generates"| node_secrets
node_operator -->|"starts instance"| node_compose
node_compose -->|"deploys"| node_backend
node_compose -->|"deploys"| node_web
node_compose -->|"deploys"| node_files
node_compose -->|"deploys"| node_proxy

click node_config_generator "https://github.com/revoltchat/self-hosted/blob/main/generate_config.sh"
click node_secrets "https://github.com/revoltchat/self-hosted/blob/main/generate_config.sh"
click node_compose "https://github.com/revoltchat/self-hosted/blob/main/compose.yml"
click node_backend "https://github.com/revoltchat/self-hosted/blob/main/compose.yml"
click node_web "https://github.com/revoltchat/self-hosted/blob/main/compose.yml"
click node_files "https://github.com/revoltchat/self-hosted/blob/main/compose.yml"
click node_proxy "https://github.com/revoltchat/self-hosted/blob/main/compose.yml"
click node_caddy "https://github.com/revoltchat/self-hosted/blob/main/Caddyfile"
click node_migrations "https://github.com/revoltchat/self-hosted/tree/main/migrations"

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_host,node_config_generator,node_secrets toneBlue
class node_compose,node_backend,node_web,node_files,node_proxy,node_caddy toneAmber
class node_migrations toneMint
class node_operator toneIndigo
```

## Components

### Host and setup

- **Server and domain**
- [Config generator](https://github.com/revoltchat/self-hosted/blob/main/generate_config.sh): `generate_config.sh`
- [Instance secrets](https://github.com/revoltchat/self-hosted/blob/main/generate_config.sh): `generate_config.sh`

### Instance deployment

- [Compose deployment](https://github.com/revoltchat/self-hosted/blob/main/compose.yml): `compose.yml`
- [Stoat backend](https://github.com/revoltchat/self-hosted/blob/main/compose.yml): `compose.yml`
- [Web front end](https://github.com/revoltchat/self-hosted/blob/main/compose.yml): `compose.yml`
- [File server](https://github.com/revoltchat/self-hosted/blob/main/compose.yml): `compose.yml`
- [Metadata and image proxy](https://github.com/revoltchat/self-hosted/blob/main/compose.yml): `compose.yml`
- [Caddy routing](https://github.com/revoltchat/self-hosted/blob/main/Caddyfile): `Caddyfile`

### Operations

- [Database migrations](https://github.com/revoltchat/self-hosted/tree/main/migrations): `migrations`

### Other components

- **Instance operator**

## Connections

- Instance operator → Server and domain: prepares (evidence: `README.md`)
- Instance operator → Config generator: runs for domain (evidence: `README.md`)
- Config generator → Instance secrets: generates (evidence: `README.md`)
- Instance operator → Compose deployment: starts instance (evidence: `README.md`)
- Compose deployment → Stoat backend: deploys (evidence: `README.md`)
- Compose deployment → Web front end: deploys (evidence: `README.md`)
- Compose deployment → File server: deploys (evidence: `README.md`)
- Compose deployment → Metadata and image proxy: deploys (evidence: `README.md`)
