# sq-2026-c/opencloud architecture

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

- Interactive diagram: https://gitdiagram.com/sq-2026-c/opencloud
- Repository: https://github.com/sq-2026-c/opencloud

## Overview

OpenCloud is a filesystem-backed Go server composed of independently runnable services. The documented operator workflow initializes configuration and then starts the server; users authenticate through OpenID Connect and use its APIs and storage services. The graph highlights identity, content, collaboration, and event-history capabilities plus service startup and shared runtime layers. Relationships are limited to README statements and SOURCE INDEX references; unsampled implementation details and cross-service wiring are not inferred.

Main entry points: [`pkg/runner/runner.go`](https://github.com/sq-2026-c/opencloud/blob/main/pkg/runner/runner.go) (Service runner), [`opencloud/cmd/opencloud/main.go`](https://github.com/sq-2026-c/opencloud/blob/main/opencloud/cmd/opencloud/main.go) (OpenCloud CLI), [`pkg/storage/storage.go`](https://github.com/sq-2026-c/opencloud/blob/main/pkg/storage/storage.go) (Storage abstraction), [`services/collaboration/pkg/command/server.go`](https://github.com/sq-2026-c/opencloud/blob/main/services/collaboration/pkg/command/server.go) (Collaboration service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Startup and runtime"]
  node_opencloud["OpenCloud CLI<br/>[main.go]"]
  node_runner["Service runner<br/>[runner.go]"]
  node_config["Configuration<br/>[config.go]"]
end

subgraph group_identity["Identity and access"]
  node_idp["Embedded identity provider<br/>[Routes.jsx]"]
  node_oidc["OIDC support<br/>[client.go]"]
  node_authapp["Application auth<br/>[server.go]"]
  node_idm["Identity management<br/>[server.go]"]
end

subgraph group_content["Content and APIs"]
  node_graph["Graph API<br/>[server.go]"]
  node_users["User directory<br/>[server.go]"]
  node_storageusers["User storage<br/>[server.go]"]
  node_storagesystem["System storage<br/>[server.go]"]
  node_storage["Storage abstraction<br/>[storage.go]"]
end

subgraph group_collaboration["Collaboration"]
  node_collaboration["Collaboration service<br/>[server.go]"]
  node_connector["Content connectors<br/>[connector.go]"]
end

subgraph group_events["Events and history"]
  node_activitylog["Activity log<br/>[server.go]"]
  node_activitystore["Activity persistence<br/>[activitylog.go]"]
  node_userlog["User event log<br/>[server.go]"]
  node_eventhistory["Event history<br/>[server.go]"]
  node_notifications["Notifications<br/>[server.go]"]
  node_nats["NATS messaging<br/>[server.go]"]
end

node_operator(("Operator"))
node_filesystem[("Filesystem")]
node_oidcprovider["OIDC provider"]

node_operator -->|"initializes and starts"| node_opencloud
node_opencloud -.->|"starts services"| node_runner
node_opencloud -.->|"loads configuration"| node_config
node_oidcprovider -->|"authenticates users"| node_oidc
node_authapp -->|"registers service"| node_runner
node_idm -->|"runs service"| node_runner
node_graph -->|"runs service"| node_runner
node_users -->|"registers service"| node_runner
node_storageusers -->|"uses storage"| node_storage
node_storagesystem -->|"uses storage"| node_storage
node_storage -->|"stores data"| node_filesystem
node_collaboration -->|"uses connectors"| node_connector
node_collaboration -->|"runs servers"| node_runner
node_activitylog -->|"creates activity log"| node_activitystore
node_activitylog -->|"runs service"| node_runner
node_userlog -->|"runs service"| node_runner
node_eventhistory -->|"runs service"| node_runner
node_notifications -->|"creates history client"| node_eventhistory
node_notifications -->|"runs service"| node_runner
node_nats -->|"runs service"| node_runner

click node_opencloud "https://github.com/sq-2026-c/opencloud/blob/main/opencloud/cmd/opencloud/main.go"
click node_runner "https://github.com/sq-2026-c/opencloud/blob/main/pkg/runner/runner.go"
click node_config "https://github.com/sq-2026-c/opencloud/blob/main/pkg/config/config.go"
click node_idp "https://github.com/sq-2026-c/opencloud/blob/main/services/idp/src/Routes.jsx"
click node_oidc "https://github.com/sq-2026-c/opencloud/blob/main/pkg/oidc/client.go"
click node_authapp "https://github.com/sq-2026-c/opencloud/blob/main/services/auth-app/pkg/command/server.go"
click node_idm "https://github.com/sq-2026-c/opencloud/blob/main/services/idm/pkg/command/server.go"
click node_graph "https://github.com/sq-2026-c/opencloud/blob/main/services/graph/pkg/command/server.go"
click node_users "https://github.com/sq-2026-c/opencloud/blob/main/services/users/pkg/command/server.go"
click node_storageusers "https://github.com/sq-2026-c/opencloud/blob/main/services/storage-users/pkg/command/server.go"
click node_storagesystem "https://github.com/sq-2026-c/opencloud/blob/main/services/storage-system/pkg/command/server.go"
click node_storage "https://github.com/sq-2026-c/opencloud/blob/main/pkg/storage/storage.go"
click node_collaboration "https://github.com/sq-2026-c/opencloud/blob/main/services/collaboration/pkg/command/server.go"
click node_connector "https://github.com/sq-2026-c/opencloud/blob/main/services/collaboration/pkg/connector/connector.go"
click node_activitylog "https://github.com/sq-2026-c/opencloud/blob/main/services/activitylog/pkg/command/server.go"
click node_activitystore "https://github.com/sq-2026-c/opencloud/blob/main/services/activitylog/pkg/service/activitylog/activitylog.go"
click node_userlog "https://github.com/sq-2026-c/opencloud/blob/main/services/userlog/pkg/command/server.go"
click node_eventhistory "https://github.com/sq-2026-c/opencloud/blob/main/services/eventhistory/pkg/command/server.go"
click node_notifications "https://github.com/sq-2026-c/opencloud/blob/main/services/notifications/pkg/command/server.go"
click node_nats "https://github.com/sq-2026-c/opencloud/blob/main/services/nats/pkg/command/server.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_opencloud,node_runner,node_config toneBlue
class node_idp,node_oidc,node_authapp,node_idm,node_filesystem toneAmber
class node_graph,node_users,node_storageusers,node_storagesystem,node_storage toneMint
class node_collaboration,node_connector toneRose
class node_activitylog,node_activitystore,node_userlog,node_eventhistory,node_notifications,node_nats,node_operator,node_oidcprovider toneIndigo
```

## Components

### Startup and runtime

- [OpenCloud CLI](https://github.com/sq-2026-c/opencloud/blob/main/opencloud/cmd/opencloud/main.go): `opencloud/cmd/opencloud/main.go`
- [Service runner](https://github.com/sq-2026-c/opencloud/blob/main/pkg/runner/runner.go): `pkg/runner/runner.go`
- [Configuration](https://github.com/sq-2026-c/opencloud/blob/main/pkg/config/config.go): `pkg/config/config.go`

### Identity and access

- [Embedded identity provider](https://github.com/sq-2026-c/opencloud/blob/main/services/idp/src/Routes.jsx): `services/idp/src/Routes.jsx`
- [OIDC support](https://github.com/sq-2026-c/opencloud/blob/main/pkg/oidc/client.go): `pkg/oidc/client.go`
- [Application auth](https://github.com/sq-2026-c/opencloud/blob/main/services/auth-app/pkg/command/server.go): `services/auth-app/pkg/command/server.go`
- [Identity management](https://github.com/sq-2026-c/opencloud/blob/main/services/idm/pkg/command/server.go): `services/idm/pkg/command/server.go`

### Content and APIs

- [Graph API](https://github.com/sq-2026-c/opencloud/blob/main/services/graph/pkg/command/server.go): `services/graph/pkg/command/server.go`
- [User directory](https://github.com/sq-2026-c/opencloud/blob/main/services/users/pkg/command/server.go): `services/users/pkg/command/server.go`
- [User storage](https://github.com/sq-2026-c/opencloud/blob/main/services/storage-users/pkg/command/server.go): `services/storage-users/pkg/command/server.go`
- [System storage](https://github.com/sq-2026-c/opencloud/blob/main/services/storage-system/pkg/command/server.go): `services/storage-system/pkg/command/server.go`
- [Storage abstraction](https://github.com/sq-2026-c/opencloud/blob/main/pkg/storage/storage.go): `pkg/storage/storage.go`

### Collaboration

- [Collaboration service](https://github.com/sq-2026-c/opencloud/blob/main/services/collaboration/pkg/command/server.go): `services/collaboration/pkg/command/server.go`
- [Content connectors](https://github.com/sq-2026-c/opencloud/blob/main/services/collaboration/pkg/connector/connector.go): `services/collaboration/pkg/connector/connector.go`

### Events and history

- [Activity log](https://github.com/sq-2026-c/opencloud/blob/main/services/activitylog/pkg/command/server.go): `services/activitylog/pkg/command/server.go`
- [Activity persistence](https://github.com/sq-2026-c/opencloud/blob/main/services/activitylog/pkg/service/activitylog/activitylog.go): `services/activitylog/pkg/service/activitylog/activitylog.go`
- [User event log](https://github.com/sq-2026-c/opencloud/blob/main/services/userlog/pkg/command/server.go): `services/userlog/pkg/command/server.go`
- [Event history](https://github.com/sq-2026-c/opencloud/blob/main/services/eventhistory/pkg/command/server.go): `services/eventhistory/pkg/command/server.go`
- [Notifications](https://github.com/sq-2026-c/opencloud/blob/main/services/notifications/pkg/command/server.go): `services/notifications/pkg/command/server.go`
- [NATS messaging](https://github.com/sq-2026-c/opencloud/blob/main/services/nats/pkg/command/server.go): `services/nats/pkg/command/server.go`

### Other components

- **Operator**
- **Filesystem**
- **OIDC provider**

## Connections

- Operator → OpenCloud CLI: initializes and starts
- OpenCloud CLI → Service runner: starts services
- OpenCloud CLI → Configuration: loads configuration
- OIDC provider → OIDC support: authenticates users
- Application auth → Service runner: registers service (evidence: `services/auth-app/pkg/command/server.go`)
- Identity management → Service runner: runs service (evidence: `services/idm/pkg/command/server.go`)
- Graph API → Service runner: runs service (evidence: `services/graph/pkg/command/server.go`)
- User directory → Service runner: registers service (evidence: `services/users/pkg/command/server.go`)
- User storage → Storage abstraction: uses storage (evidence: `services/storage-users/pkg/command/server.go`)
- System storage → Storage abstraction: uses storage (evidence: `services/storage-system/pkg/command/server.go`)
- Storage abstraction → Filesystem: stores data
- Collaboration service → Content connectors: uses connectors (evidence: `services/collaboration/pkg/command/server.go`)
- Collaboration service → Service runner: runs servers (evidence: `services/collaboration/pkg/command/server.go`)
- Activity log → Activity persistence: creates activity log (evidence: `services/activitylog/pkg/command/server.go`)
- Activity log → Service runner: runs service (evidence: `services/activitylog/pkg/command/server.go`)
- User event log → Service runner: runs service (evidence: `services/userlog/pkg/command/server.go`)
- Event history → Service runner: runs service (evidence: `services/eventhistory/pkg/command/server.go`)
- Notifications → Event history: creates history client (evidence: `services/notifications/pkg/command/server.go`)
- Notifications → Service runner: runs service (evidence: `services/notifications/pkg/command/server.go`)
- NATS messaging → Service runner: runs service (evidence: `services/nats/pkg/command/server.go`)
