# io-sea/hestia architecture

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

- Interactive diagram: https://gitdiagram.com/io-sea/hestia
- Repository: https://github.com/io-sea/hestia

## Overview

Hestia is an HSM interface over object stores. A typical workflow creates an object, writes data to a storage tier, tracks the resulting action, copies or retrieves data across tiers, and manages metadata. CLI, C/Python, HTTP REST, and S3 are documented interfaces; the implementation also includes a web UI and a policy engine. The sampled service code shows HSM actions coordinating CRUD and object-store requests. Some UI/API routing and storage wiring was not sampled, so uncertain links are omitted.

Main entry points: [`src/hsm/hsm_service/HsmService.cc`](https://github.com/io-sea/hestia/blob/master/src/hsm/hsm_service/HsmService.cc) (HSM service), [`src/hestia/HestiaClient.cc`](https://github.com/io-sea/hestia/blob/master/src/hestia/HestiaClient.cc) (Hestia client), [`src/integrations/PolicyEngine.cc`](https://github.com/io-sea/hestia/blob/master/src/integrations/PolicyEngine.cc) (Policy engine), [`src/hsm/object_store/ObjectStoreClientManager.cc`](https://github.com/io-sea/hestia/blob/master/src/hsm/object_store/ObjectStoreClientManager.cc) (Backend manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli["CLI<br/>[HestiaCli.cc]"]
  node_public_api["C and Python APIs<br/>[HestiaCApi.cc]"]
  node_python_binding["Python binding<br/>[hestia_client.py]"]
  node_http_api["HTTP REST API<br/>[HestiaWebApp.cc]"]
  node_s3_api["S3 API<br/>[HestiaS3WebApp.cc]"]
  node_web_ui["Web UI<br/>[app.component.ts]"]
end

subgraph group_hsm["HSM domain"]
  node_hsm_objects["HSM objects<br/>[HsmObject.cc]"]
  node_actions["HSM actions<br/>[HsmAction.cc]"]
  node_tiers["Storage tiers<br/>[StorageTier.cc]"]
end

subgraph group_services["Services and policy"]
  node_client["Hestia client<br/>[HestiaClient.cc]"]
  node_hsm_service["HSM service<br/>[HsmService.cc]"]
  node_distributed_service["Distributed HSM"]
  node_policy_engine["Policy engine<br/>[PolicyEngine.cc]"]
  node_crud["CRUD services<br/>[CrudService.cc]"]
  node_event_feed["Event feed<br/>[EventFeed.cc]"]
  node_policy_db[("Policy database<br/>[PolicyEngine.cc]")]
end

subgraph group_storage["Storage backends"]
  node_storage_objects["Storage objects<br/>[StorageObject.cc]"]
  node_object_store_client["Object-store client"]
  node_store_manager["Backend manager"]
  node_file_backend[("File backends")]
  node_s3_backend[("S3 backend")]
end

node_user(("User"))
node_external_store[("Object store")]

node_user -->|"issues commands"| node_cli
node_user -->|"uses API"| node_public_api
node_python_binding -->|"wraps API"| node_public_api
node_user -->|"sends requests"| node_http_api
node_user -->|"uses API"| node_s3_api
node_cli -->|"dispatches requests"| node_client
node_public_api -.->|"uses client"| node_client
node_client -->|"routes HSM requests"| node_hsm_service
node_client -->|"routes CRUD requests"| node_crud
node_hsm_service -->|"manages records"| node_crud
node_hsm_service -->|"issues data requests"| node_object_store_client
node_hsm_service -->|"creates actions"| node_actions
node_hsm_service -->|"reads objects"| node_hsm_objects
node_hsm_service -->|"resolves tiers"| node_tiers
node_hsm_service -->|"emits events"| node_event_feed
node_distributed_service -.->|"extends service"| node_hsm_service
node_object_store_client -->|"handles objects"| node_storage_objects
node_store_manager -->|"configures backends"| node_tiers
node_store_manager -.->|"sets up clients"| node_file_backend
node_store_manager -.->|"sets up clients"| node_s3_backend
node_file_backend -.->|"reads and writes"| node_external_store
node_s3_backend -.->|"reads and writes"| node_external_store
node_policy_engine -->|"synchronizes state"| node_policy_db
node_policy_engine -->|"lists and updates"| node_hsm_objects
node_policy_engine -.->|"polls event feed"| node_event_feed
node_web_ui -.->|"presents controls"| node_user

click node_cli "https://github.com/io-sea/hestia/blob/master/src/hestia/HestiaCli.cc"
click node_public_api "https://github.com/io-sea/hestia/blob/master/src/hestia/HestiaCApi.cc"
click node_python_binding "https://github.com/io-sea/hestia/blob/master/bindings/python/hestia/hestia/hestia_client.py"
click node_http_api "https://github.com/io-sea/hestia/blob/master/src/hestia/web/http/HestiaWebApp.cc"
click node_s3_api "https://github.com/io-sea/hestia/blob/master/src/hestia/web/s3/HestiaS3WebApp.cc"
click node_web_ui "https://github.com/io-sea/hestia/blob/master/site/hestia/src/app/app.component.ts"
click node_client "https://github.com/io-sea/hestia/blob/master/src/hestia/HestiaClient.cc"
click node_hsm_service "https://github.com/io-sea/hestia/blob/master/src/hsm/hsm_service/HsmService.cc"
click node_distributed_service "https://github.com/io-sea/hestia/blob/master/src/hsm/hsm_service/DistributedHsmService.cc"
click node_policy_engine "https://github.com/io-sea/hestia/blob/master/src/integrations/PolicyEngine.cc"
click node_crud "https://github.com/io-sea/hestia/blob/master/src/base/crud/service/CrudService.cc"
click node_event_feed "https://github.com/io-sea/hestia/blob/master/src/base/crud/events/EventFeed.cc"
click node_hsm_objects "https://github.com/io-sea/hestia/blob/master/src/hsm/base_types/HsmObject.cc"
click node_actions "https://github.com/io-sea/hestia/blob/master/src/hsm/base_types/HsmAction.cc"
click node_tiers "https://github.com/io-sea/hestia/blob/master/src/hsm/base_types/StorageTier.cc"
click node_storage_objects "https://github.com/io-sea/hestia/blob/master/src/base/storage/base_types/StorageObject.cc"
click node_object_store_client "https://github.com/io-sea/hestia/blob/master/src/base/storage/ObjectStoreClient.cc"
click node_store_manager "https://github.com/io-sea/hestia/blob/master/src/hsm/object_store/ObjectStoreClientManager.cc"
click node_file_backend "https://github.com/io-sea/hestia/blob/master/src/base/storage/clients/file/FileHsmObjectStoreClient.cc"
click node_s3_backend "https://github.com/io-sea/hestia/blob/master/src/base/storage/clients/s3/S3ObjectStoreClient.cc"
click node_policy_db "https://github.com/io-sea/hestia/blob/master/src/integrations/PolicyEngine.cc"

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_cli,node_public_api,node_python_binding,node_http_api,node_s3_api,node_web_ui,node_user toneBlue
class node_hsm_objects,node_actions,node_tiers,node_external_store toneAmber
class node_client,node_hsm_service,node_distributed_service,node_policy_engine,node_crud,node_event_feed,node_policy_db toneMint
class node_storage_objects,node_object_store_client,node_store_manager,node_file_backend,node_s3_backend toneRose
```

## Components

### User interfaces

- [CLI](https://github.com/io-sea/hestia/blob/master/src/hestia/HestiaCli.cc): `src/hestia/HestiaCli.cc`
- [C and Python APIs](https://github.com/io-sea/hestia/blob/master/src/hestia/HestiaCApi.cc): `src/hestia/HestiaCApi.cc`
- [Python binding](https://github.com/io-sea/hestia/blob/master/bindings/python/hestia/hestia/hestia_client.py): `bindings/python/hestia/hestia/hestia_client.py`
- [HTTP REST API](https://github.com/io-sea/hestia/blob/master/src/hestia/web/http/HestiaWebApp.cc): `src/hestia/web/http/HestiaWebApp.cc`
- [S3 API](https://github.com/io-sea/hestia/blob/master/src/hestia/web/s3/HestiaS3WebApp.cc): `src/hestia/web/s3/HestiaS3WebApp.cc`
- [Web UI](https://github.com/io-sea/hestia/blob/master/site/hestia/src/app/app.component.ts): `site/hestia/src/app/app.component.ts`

### HSM domain

- [HSM objects](https://github.com/io-sea/hestia/blob/master/src/hsm/base_types/HsmObject.cc): `src/hsm/base_types/HsmObject.cc`
- [HSM actions](https://github.com/io-sea/hestia/blob/master/src/hsm/base_types/HsmAction.cc): `src/hsm/base_types/HsmAction.cc`
- [Storage tiers](https://github.com/io-sea/hestia/blob/master/src/hsm/base_types/StorageTier.cc): `src/hsm/base_types/StorageTier.cc`

### Services and policy

- [Hestia client](https://github.com/io-sea/hestia/blob/master/src/hestia/HestiaClient.cc): `src/hestia/HestiaClient.cc`
- [HSM service](https://github.com/io-sea/hestia/blob/master/src/hsm/hsm_service/HsmService.cc): `src/hsm/hsm_service/HsmService.cc`
- [Distributed HSM](https://github.com/io-sea/hestia/blob/master/src/hsm/hsm_service/DistributedHsmService.cc): `src/hsm/hsm_service/DistributedHsmService.cc`
- [Policy engine](https://github.com/io-sea/hestia/blob/master/src/integrations/PolicyEngine.cc): `src/integrations/PolicyEngine.cc`
- [CRUD services](https://github.com/io-sea/hestia/blob/master/src/base/crud/service/CrudService.cc): `src/base/crud/service/CrudService.cc`
- [Event feed](https://github.com/io-sea/hestia/blob/master/src/base/crud/events/EventFeed.cc): `src/base/crud/events/EventFeed.cc`
- [Policy database](https://github.com/io-sea/hestia/blob/master/src/integrations/PolicyEngine.cc): `src/integrations/PolicyEngine.cc`

### Storage backends

- [Storage objects](https://github.com/io-sea/hestia/blob/master/src/base/storage/base_types/StorageObject.cc): `src/base/storage/base_types/StorageObject.cc`
- [Object-store client](https://github.com/io-sea/hestia/blob/master/src/base/storage/ObjectStoreClient.cc): `src/base/storage/ObjectStoreClient.cc`
- [Backend manager](https://github.com/io-sea/hestia/blob/master/src/hsm/object_store/ObjectStoreClientManager.cc): `src/hsm/object_store/ObjectStoreClientManager.cc`
- [File backends](https://github.com/io-sea/hestia/blob/master/src/base/storage/clients/file/FileHsmObjectStoreClient.cc): `src/base/storage/clients/file/FileHsmObjectStoreClient.cc`
- [S3 backend](https://github.com/io-sea/hestia/blob/master/src/base/storage/clients/s3/S3ObjectStoreClient.cc): `src/base/storage/clients/s3/S3ObjectStoreClient.cc`

### Other components

- **User**
- **Object store**

## Connections

- User → CLI: issues commands
- User → C and Python APIs: uses API
- Python binding → C and Python APIs: wraps API (evidence: `bindings/python/hestia/hestia/hestia_client.py`)
- User → HTTP REST API: sends requests
- User → S3 API: uses API
- CLI → Hestia client: dispatches requests
- C and Python APIs → Hestia client: uses client
- Hestia client → HSM service: routes HSM requests (evidence: `src/hestia/HestiaClient.cc`)
- Hestia client → CRUD services: routes CRUD requests (evidence: `src/hestia/HestiaClient.cc`)
- HSM service → CRUD services: manages records (evidence: `src/hsm/hsm_service/HsmService.cc`)
- HSM service → Object-store client: issues data requests (evidence: `src/hsm/hsm_service/HsmService.cc`)
- HSM service → HSM actions: creates actions (evidence: `src/hsm/hsm_service/HsmService.cc`)
- HSM service → HSM objects: reads objects (evidence: `src/hsm/hsm_service/HsmService.cc`)
- HSM service → Storage tiers: resolves tiers (evidence: `src/hsm/hsm_service/HsmService.cc`)
- HSM service → Event feed: emits events (evidence: `src/hsm/hsm_service/HsmService.cc`)
- Distributed HSM → HSM service: extends service
- Object-store client → Storage objects: handles objects (evidence: `src/base/storage/ObjectStoreClient.cc`)
- Backend manager → Storage tiers: configures backends
- Backend manager → File backends: sets up clients
- Backend manager → S3 backend: sets up clients
- File backends → Object store: reads and writes
- S3 backend → Object store: reads and writes
- Policy engine → Policy database: synchronizes state (evidence: `src/integrations/PolicyEngine.cc`)
- Policy engine → HSM objects: lists and updates (evidence: `src/integrations/PolicyEngine.cc`)
- Policy engine → Event feed: polls event feed
- Web UI → User: presents controls
