# stealth-deplover/stealth architecture

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

- Interactive diagram: https://gitdiagram.com/stealth-deplover/stealth
- Repository: https://github.com/stealth-deplover/stealth

## Overview

Stealth is a self-hostable developer cloud: operators install and configure it, then users manage project resources through the Next.js console and Go API. The API handles authenticated control-plane requests; asynchronous work is handed to workers for builds, executions, delivery, and realtime publication. The README also documents database, storage, messaging, webhooks, agents, and owner-facing observability capabilities. Edges reflect the README’s architecture and sampled storage code; most individual resource-handler wiring was not sampled, so uncertain links are omitted.

Main entry points: [`cmd/worker/main.go`](https://github.com/stealth-deplover/stealth/blob/main/cmd/worker/main.go) (Go worker), [`internal/httpapi/server.go`](https://github.com/stealth-deplover/stealth/blob/main/internal/httpapi/server.go) (Go API), [`console/src/api/client.ts`](https://github.com/stealth-deplover/stealth/blob/main/console/src/api/client.ts) (Console API client), [`internal/httpapi/server_storage.go`](https://github.com/stealth-deplover/stealth/blob/main/internal/httpapi/server_storage.go) (Storage handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Console"]
  node_web["Next.js console"]
  node_console_api["Console API client<br/>[client.ts]"]
  node_storage_ui["Storage screens<br/>[storage-view.tsx]"]
  node_storage_queries["Storage queries<br/>[storage.ts]"]
  node_storage_mutations["Storage mutations<br/>[storage.ts]"]
end

subgraph group_control["Control plane"]
  node_api["Go API<br/>[server.go]"]
  node_routes["Resource routes<br/>[routes.go]"]
  node_storage_handlers["Storage handlers<br/>[server_storage.go]"]
  node_repository["Control repositories<br/>[repository.go]"]
  node_storage_repository["Storage repository<br/>[storage.go]"]
end

subgraph group_async["Workers and runtimes"]
  node_worker["Go worker<br/>[main.go]"]
  node_function_runner["Function and site runners<br/>[worker.go]"]
  node_app_worker["App builds<br/>[worker.go]"]
  node_messaging["Messaging delivery<br/>[worker.go]"]
  node_webhook["Webhook delivery<br/>[worker.go]"]
  node_agents["Agent runs<br/>[worker.go]"]
end

subgraph group_state["Persistence"]
  node_postgres[("PostgreSQL")]
  node_redis[("Redis")]
  node_object_storage[("Local or S3 storage<br/>[store.go]")]
  node_work_queue["Durable work queues"]
end

subgraph group_operations["Installation and observability"]
  node_installer["Host installer<br/>[installer.go]"]
  node_install_engine["Install engine<br/>[engine.go]"]
  node_telemetry["Telemetry pipeline<br/>[store.go]"]
  node_collector[("OTel Collector and ClickHouse")]
end

node_user(("Platform user"))

node_user -->|"uses"| node_web
node_web -->|"requests"| node_console_api
node_storage_ui -->|"loads buckets"| node_storage_queries
node_storage_ui -->|"creates buckets"| node_storage_mutations
node_storage_queries -->|"queries"| node_console_api
node_storage_mutations -->|"mutates"| node_console_api
node_console_api -->|"HTTP requests"| node_api
node_api -->|"dispatches"| node_routes
node_routes -->|"routes storage"| node_storage_handlers
node_storage_handlers -->|"reads and writes"| node_storage_repository
node_repository -->|"reads and writes"| node_postgres
node_storage_repository -->|"stores metadata"| node_postgres
node_storage_handlers -->|"uploads files"| node_object_storage
node_api -->|"rate limits and realtime"| node_redis
node_api -->|"enqueues work"| node_work_queue
node_work_queue -->|"dispatches work"| node_worker
node_worker -->|"runs workloads"| node_function_runner
node_worker -->|"builds apps"| node_app_worker
node_worker -->|"delivers messages"| node_messaging
node_worker -->|"delivers webhooks"| node_webhook
node_worker -->|"handles agent runs"| node_agents
node_worker -->|"uses artifacts"| node_object_storage
node_installer -->|"executes installation"| node_install_engine
node_api -->|"serves protected queries"| node_telemetry
node_telemetry -.->|"queries telemetry"| node_collector

click node_web "https://github.com/stealth-deplover/stealth/tree/main/console/src/app"
click node_console_api "https://github.com/stealth-deplover/stealth/blob/main/console/src/api/client.ts"
click node_storage_ui "https://github.com/stealth-deplover/stealth/blob/main/console/src/features/storage/storage-view.tsx"
click node_storage_queries "https://github.com/stealth-deplover/stealth/blob/main/console/src/api/queries/storage.ts"
click node_storage_mutations "https://github.com/stealth-deplover/stealth/blob/main/console/src/api/mutations/storage.ts"
click node_api "https://github.com/stealth-deplover/stealth/blob/main/internal/httpapi/server.go"
click node_routes "https://github.com/stealth-deplover/stealth/blob/main/internal/httpapi/routes.go"
click node_storage_handlers "https://github.com/stealth-deplover/stealth/blob/main/internal/httpapi/server_storage.go"
click node_repository "https://github.com/stealth-deplover/stealth/blob/main/internal/repository/repository.go"
click node_storage_repository "https://github.com/stealth-deplover/stealth/blob/main/internal/repository/storage.go"
click node_object_storage "https://github.com/stealth-deplover/stealth/blob/main/internal/storage/store.go"
click node_work_queue "https://github.com/stealth-deplover/stealth/tree/main/internal/repository"
click node_worker "https://github.com/stealth-deplover/stealth/blob/main/cmd/worker/main.go"
click node_function_runner "https://github.com/stealth-deplover/stealth/blob/main/internal/functionrunner/worker.go"
click node_app_worker "https://github.com/stealth-deplover/stealth/blob/main/internal/appbuilder/worker.go"
click node_messaging "https://github.com/stealth-deplover/stealth/blob/main/internal/messagingrunner/worker.go"
click node_webhook "https://github.com/stealth-deplover/stealth/blob/main/internal/webhookrunner/worker.go"
click node_agents "https://github.com/stealth-deplover/stealth/blob/main/internal/agentrunner/worker.go"
click node_installer "https://github.com/stealth-deplover/stealth/blob/main/internal/cli/installer.go"
click node_install_engine "https://github.com/stealth-deplover/stealth/blob/main/internal/installengine/engine.go"
click node_telemetry "https://github.com/stealth-deplover/stealth/blob/main/internal/telemetry/store.go"

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_console_api,node_storage_ui,node_storage_queries,node_storage_mutations,node_user toneBlue
class node_api,node_routes,node_storage_handlers,node_repository,node_storage_repository toneAmber
class node_worker,node_function_runner,node_app_worker,node_messaging,node_webhook,node_agents toneMint
class node_postgres,node_redis,node_object_storage,node_work_queue toneRose
class node_installer,node_install_engine,node_telemetry,node_collector toneIndigo
```

## Components

### Console

- [Next.js console](https://github.com/stealth-deplover/stealth/tree/main/console/src/app): `console/src/app`
- [Console API client](https://github.com/stealth-deplover/stealth/blob/main/console/src/api/client.ts): `console/src/api/client.ts`
- [Storage screens](https://github.com/stealth-deplover/stealth/blob/main/console/src/features/storage/storage-view.tsx): `console/src/features/storage/storage-view.tsx`
- [Storage queries](https://github.com/stealth-deplover/stealth/blob/main/console/src/api/queries/storage.ts): `console/src/api/queries/storage.ts`
- [Storage mutations](https://github.com/stealth-deplover/stealth/blob/main/console/src/api/mutations/storage.ts): `console/src/api/mutations/storage.ts`

### Control plane

- [Go API](https://github.com/stealth-deplover/stealth/blob/main/internal/httpapi/server.go): `internal/httpapi/server.go`
- [Resource routes](https://github.com/stealth-deplover/stealth/blob/main/internal/httpapi/routes.go): `internal/httpapi/routes.go`
- [Storage handlers](https://github.com/stealth-deplover/stealth/blob/main/internal/httpapi/server_storage.go): `internal/httpapi/server_storage.go`
- [Control repositories](https://github.com/stealth-deplover/stealth/blob/main/internal/repository/repository.go): `internal/repository/repository.go`
- [Storage repository](https://github.com/stealth-deplover/stealth/blob/main/internal/repository/storage.go): `internal/repository/storage.go`

### Workers and runtimes

- [Go worker](https://github.com/stealth-deplover/stealth/blob/main/cmd/worker/main.go): `cmd/worker/main.go`
- [Function and site runners](https://github.com/stealth-deplover/stealth/blob/main/internal/functionrunner/worker.go): `internal/functionrunner/worker.go`
- [App builds](https://github.com/stealth-deplover/stealth/blob/main/internal/appbuilder/worker.go): `internal/appbuilder/worker.go`
- [Messaging delivery](https://github.com/stealth-deplover/stealth/blob/main/internal/messagingrunner/worker.go): `internal/messagingrunner/worker.go`
- [Webhook delivery](https://github.com/stealth-deplover/stealth/blob/main/internal/webhookrunner/worker.go): `internal/webhookrunner/worker.go`
- [Agent runs](https://github.com/stealth-deplover/stealth/blob/main/internal/agentrunner/worker.go): `internal/agentrunner/worker.go`

### Persistence

- **PostgreSQL**
- **Redis**
- [Local or S3 storage](https://github.com/stealth-deplover/stealth/blob/main/internal/storage/store.go): `internal/storage/store.go`
- [Durable work queues](https://github.com/stealth-deplover/stealth/tree/main/internal/repository): `internal/repository`

### Installation and observability

- [Host installer](https://github.com/stealth-deplover/stealth/blob/main/internal/cli/installer.go): `internal/cli/installer.go`
- [Install engine](https://github.com/stealth-deplover/stealth/blob/main/internal/installengine/engine.go): `internal/installengine/engine.go`
- [Telemetry pipeline](https://github.com/stealth-deplover/stealth/blob/main/internal/telemetry/store.go): `internal/telemetry/store.go`
- **OTel Collector and ClickHouse**

### Other components

- **Platform user**

## Connections

- Platform user → Next.js console: uses
- Next.js console → Console API client: requests
- Storage screens → Storage queries: loads buckets
- Storage screens → Storage mutations: creates buckets
- Storage queries → Console API client: queries
- Storage mutations → Console API client: mutates
- Console API client → Go API: HTTP requests
- Go API → Resource routes: dispatches
- Resource routes → Storage handlers: routes storage
- Storage handlers → Storage repository: reads and writes
- Control repositories → PostgreSQL: reads and writes
- Storage repository → PostgreSQL: stores metadata
- Storage handlers → Local or S3 storage: uploads files
- Go API → Redis: rate limits and realtime
- Go API → Durable work queues: enqueues work
- Durable work queues → Go worker: dispatches work
- Go worker → Function and site runners: runs workloads
- Go worker → App builds: builds apps
- Go worker → Messaging delivery: delivers messages
- Go worker → Webhook delivery: delivers webhooks
- Go worker → Agent runs: handles agent runs
- Go worker → Local or S3 storage: uses artifacts
- Host installer → Install engine: executes installation
- Go API → Telemetry pipeline: serves protected queries
- Telemetry pipeline → OTel Collector and ClickHouse: queries telemetry
