# tritonnet/tritondrive architecture

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

- Interactive diagram: https://gitdiagram.com/tritonnet/tritondrive
- Repository: https://github.com/tritonnet/tritondrive

## Overview

TritonDrive turns provider accounts into a protected storage pool, then exposes volume files through shares and a web control plane. The main workflow is account and pool management, redundant encrypted block storage, filesystem access, and administration through WebDAV, SFTP, or the web app. The graph preserves the documented storage, encryption, filesystem, control-plane, and UI capabilities. Some subsystem links rely on README descriptions because their implementation files were not excerpted; those limits are reflected in the evidence citations.

Main entry points: [`web/src/App.tsx`](https://github.com/tritonnet/tritondrive/blob/master/web/src/App.tsx) (Web application), [`src/internal/vfs/vfs.go`](https://github.com/tritonnet/tritondrive/blob/master/src/internal/vfs/vfs.go) (Virtual filesystem), [`src/cmd/tritond/main.go`](https://github.com/tritonnet/tritondrive/blob/master/src/cmd/tritond/main.go) (Triton daemon), [`src/internal/blockstore/stack/stack.go`](https://github.com/tritonnet/tritondrive/blob/master/src/internal/blockstore/stack/stack.go) (Pool stack)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Access and UI"]
  node_daemon["Triton daemon<br/>[main.go]"]
  node_webui["Web application<br/>[App.tsx]"]
  node_webapi["Web API client<br/>[api.ts]"]
  node_accounts["Account management<br/>[Accounts.tsx]"]
  node_poolui["Pool management<br/>[Pool.tsx]"]
  node_volumesui["Volume management<br/>[Volumes.tsx]"]
  node_filesui["File browser<br/>[Files.tsx]"]
  node_sharesui["Share management<br/>[Shares.tsx]"]
  node_settingsui["Settings<br/>[Settings.tsx]"]
end

subgraph group_control["Control plane"]
  node_httpapi["HTTP API<br/>[api.go]"]
  node_server["Control plane<br/>[server.go]"]
  node_systemdb[("System database<br/>[sqlitedb.go]")]
end

subgraph group_filesystem["Files and shares"]
  node_vfs["Virtual filesystem<br/>[vfs.go]"]
  node_metadata[("Filesystem metadata<br/>[store.go]")]
  node_webdav["WebDAV shares<br/>[webdav.go]"]
  node_sftp["SFTP shares<br/>[handler.go]"]
end

subgraph group_protection["Encryption and redundancy"]
  node_crypto["File encryption<br/>[engine.go]"]
  node_redundancy["Redundancy and repair<br/>[repair.go]"]
end

subgraph group_storage["Pool storage"]
  node_stack["Pool stack<br/>[stack.go]"]
  node_cache["Block cache<br/>[cache.go]"]
  node_backends["Storage backends<br/>[backend.go]"]
end

node_operator(("Administrator"))
node_providers[("Storage providers")]

node_operator -->|"manages"| node_webui
node_operator -->|"connects files"| node_webdav
node_operator -->|"connects files"| node_sftp
node_daemon -->|"starts"| node_server
node_daemon -->|"serves"| node_httpapi
node_daemon -->|"serves"| node_webdav
node_daemon -->|"serves"| node_sftp
node_webui -->|"requests data"| node_webapi
node_webui -->|"routes to"| node_accounts
node_webui -->|"routes to"| node_poolui
node_webui -->|"routes to"| node_volumesui
node_webui -->|"routes to"| node_filesui
node_webui -->|"routes to"| node_sharesui
node_webui -->|"routes to"| node_settingsui
node_webapi -->|"calls endpoints"| node_httpapi
node_httpapi -->|"handles requests"| node_server
node_server -->|"stores control data"| node_systemdb
node_server -->|"opens filesystem"| node_vfs
node_webdav -->|"serves files"| node_vfs
node_sftp -->|"serves files"| node_vfs
node_vfs -->|"tracks namespace"| node_metadata
node_vfs -->|"encrypts file data"| node_crypto
node_crypto -->|"stores encrypted blocks"| node_stack
node_stack -->|"uses cache"| node_cache
node_stack -->|"uses placement"| node_redundancy
node_stack -->|"uses drivers"| node_backends
node_backends -->|"reads and writes"| node_providers
node_redundancy -->|"repairs blocks"| node_backends

click node_daemon "https://github.com/tritonnet/tritondrive/blob/master/src/cmd/tritond/main.go"
click node_webui "https://github.com/tritonnet/tritondrive/blob/master/web/src/App.tsx"
click node_webapi "https://github.com/tritonnet/tritondrive/blob/master/web/src/api.ts"
click node_accounts "https://github.com/tritonnet/tritondrive/blob/master/web/src/pages/Accounts.tsx"
click node_poolui "https://github.com/tritonnet/tritondrive/blob/master/web/src/pages/Pool.tsx"
click node_volumesui "https://github.com/tritonnet/tritondrive/blob/master/web/src/pages/Volumes.tsx"
click node_filesui "https://github.com/tritonnet/tritondrive/blob/master/web/src/pages/Files.tsx"
click node_sharesui "https://github.com/tritonnet/tritondrive/blob/master/web/src/pages/Shares.tsx"
click node_settingsui "https://github.com/tritonnet/tritondrive/blob/master/web/src/pages/Settings.tsx"
click node_httpapi "https://github.com/tritonnet/tritondrive/blob/master/src/internal/adapter/httpapi/api.go"
click node_server "https://github.com/tritonnet/tritondrive/blob/master/src/internal/server/server.go"
click node_systemdb "https://github.com/tritonnet/tritondrive/blob/master/src/internal/sqlitedb/sqlitedb.go"
click node_vfs "https://github.com/tritonnet/tritondrive/blob/master/src/internal/vfs/vfs.go"
click node_metadata "https://github.com/tritonnet/tritondrive/blob/master/src/internal/vfs/meta/store.go"
click node_webdav "https://github.com/tritonnet/tritondrive/blob/master/src/internal/adapter/webdav/webdav.go"
click node_sftp "https://github.com/tritonnet/tritondrive/blob/master/src/internal/adapter/sftp/handler.go"
click node_crypto "https://github.com/tritonnet/tritondrive/blob/master/src/internal/crypto/engine.go"
click node_redundancy "https://github.com/tritonnet/tritondrive/blob/master/src/internal/blockstore/redundancy/repair.go"
click node_stack "https://github.com/tritonnet/tritondrive/blob/master/src/internal/blockstore/stack/stack.go"
click node_cache "https://github.com/tritonnet/tritondrive/blob/master/src/internal/blockstore/cache/cache.go"
click node_backends "https://github.com/tritonnet/tritondrive/blob/master/src/internal/blockstore/backend/backend.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_daemon,node_webui,node_webapi,node_accounts,node_poolui,node_volumesui,node_filesui,node_sharesui,node_settingsui toneBlue
class node_httpapi,node_server,node_systemdb,node_providers toneAmber
class node_vfs,node_metadata,node_webdav,node_sftp toneMint
class node_crypto,node_redundancy toneRose
class node_stack,node_cache,node_backends,node_operator toneIndigo
```

## Components

### Access and UI

- [Triton daemon](https://github.com/tritonnet/tritondrive/blob/master/src/cmd/tritond/main.go): `src/cmd/tritond/main.go`
- [Web application](https://github.com/tritonnet/tritondrive/blob/master/web/src/App.tsx): `web/src/App.tsx`
- [Web API client](https://github.com/tritonnet/tritondrive/blob/master/web/src/api.ts): `web/src/api.ts`
- [Account management](https://github.com/tritonnet/tritondrive/blob/master/web/src/pages/Accounts.tsx): `web/src/pages/Accounts.tsx`
- [Pool management](https://github.com/tritonnet/tritondrive/blob/master/web/src/pages/Pool.tsx): `web/src/pages/Pool.tsx`
- [Volume management](https://github.com/tritonnet/tritondrive/blob/master/web/src/pages/Volumes.tsx): `web/src/pages/Volumes.tsx`
- [File browser](https://github.com/tritonnet/tritondrive/blob/master/web/src/pages/Files.tsx): `web/src/pages/Files.tsx`
- [Share management](https://github.com/tritonnet/tritondrive/blob/master/web/src/pages/Shares.tsx): `web/src/pages/Shares.tsx`
- [Settings](https://github.com/tritonnet/tritondrive/blob/master/web/src/pages/Settings.tsx): `web/src/pages/Settings.tsx`

### Control plane

- [HTTP API](https://github.com/tritonnet/tritondrive/blob/master/src/internal/adapter/httpapi/api.go): `src/internal/adapter/httpapi/api.go`
- [Control plane](https://github.com/tritonnet/tritondrive/blob/master/src/internal/server/server.go): `src/internal/server/server.go`
- [System database](https://github.com/tritonnet/tritondrive/blob/master/src/internal/sqlitedb/sqlitedb.go): `src/internal/sqlitedb/sqlitedb.go`

### Files and shares

- [Virtual filesystem](https://github.com/tritonnet/tritondrive/blob/master/src/internal/vfs/vfs.go): `src/internal/vfs/vfs.go`
- [Filesystem metadata](https://github.com/tritonnet/tritondrive/blob/master/src/internal/vfs/meta/store.go): `src/internal/vfs/meta/store.go`
- [WebDAV shares](https://github.com/tritonnet/tritondrive/blob/master/src/internal/adapter/webdav/webdav.go): `src/internal/adapter/webdav/webdav.go`
- [SFTP shares](https://github.com/tritonnet/tritondrive/blob/master/src/internal/adapter/sftp/handler.go): `src/internal/adapter/sftp/handler.go`

### Encryption and redundancy

- [File encryption](https://github.com/tritonnet/tritondrive/blob/master/src/internal/crypto/engine.go): `src/internal/crypto/engine.go`
- [Redundancy and repair](https://github.com/tritonnet/tritondrive/blob/master/src/internal/blockstore/redundancy/repair.go): `src/internal/blockstore/redundancy/repair.go`

### Pool storage

- [Pool stack](https://github.com/tritonnet/tritondrive/blob/master/src/internal/blockstore/stack/stack.go): `src/internal/blockstore/stack/stack.go`
- [Block cache](https://github.com/tritonnet/tritondrive/blob/master/src/internal/blockstore/cache/cache.go): `src/internal/blockstore/cache/cache.go`
- [Storage backends](https://github.com/tritonnet/tritondrive/blob/master/src/internal/blockstore/backend/backend.go): `src/internal/blockstore/backend/backend.go`

### Other components

- **Administrator**
- **Storage providers**

## Connections

- Administrator → Web application: manages
- Administrator → WebDAV shares: connects files
- Administrator → SFTP shares: connects files
- Triton daemon → Control plane: starts (evidence: `src/cmd/tritond/main.go`)
- Triton daemon → HTTP API: serves (evidence: `src/cmd/tritond/main.go`)
- Triton daemon → WebDAV shares: serves (evidence: `src/cmd/tritond/main.go`)
- Triton daemon → SFTP shares: serves (evidence: `src/cmd/tritond/main.go`)
- Web application → Web API client: requests data (evidence: `web/src/App.tsx`)
- Web application → Account management: routes to (evidence: `web/src/App.tsx`)
- Web application → Pool management: routes to (evidence: `web/src/App.tsx`)
- Web application → Volume management: routes to (evidence: `web/src/App.tsx`)
- Web application → File browser: routes to (evidence: `web/src/App.tsx`)
- Web application → Share management: routes to (evidence: `web/src/App.tsx`)
- Web application → Settings: routes to (evidence: `web/src/App.tsx`)
- Web API client → HTTP API: calls endpoints (evidence: `web/src/api.ts`)
- HTTP API → Control plane: handles requests (evidence: `src/internal/adapter/httpapi/api.go`)
- Control plane → System database: stores control data (evidence: `src/internal/server/server.go`)
- Control plane → Virtual filesystem: opens filesystem (evidence: `src/internal/server/server.go`)
- WebDAV shares → Virtual filesystem: serves files (evidence: `src/internal/adapter/webdav/webdav.go`)
- SFTP shares → Virtual filesystem: serves files (evidence: `src/internal/adapter/sftp/handler.go`)
- Virtual filesystem → Filesystem metadata: tracks namespace
- Virtual filesystem → File encryption: encrypts file data
- File encryption → Pool stack: stores encrypted blocks (evidence: `src/internal/crypto/engine.go`)
- Pool stack → Block cache: uses cache (evidence: `src/internal/blockstore/stack/stack.go`)
- Pool stack → Redundancy and repair: uses placement (evidence: `src/internal/blockstore/stack/stack.go`)
- Pool stack → Storage backends: uses drivers (evidence: `src/internal/blockstore/stack/stack.go`)
- Storage backends → Storage providers: reads and writes
- Redundancy and repair → Storage backends: repairs blocks (evidence: `src/internal/blockstore/redundancy/repair.go`)
