How opencloud-eu/opencloud works
System’s main logical layers and components
• Clients: Browsers (UI), CLI (opencloud binary), acceptance‐test harness
• Ingress / API Gateway: services/gateway (HTTP + gRPC routing & proxy)
• Authentication/Identity:
• External IdP (Keycloak) or
• Embedded LibreGraph Connect (services/idp, generated via Hugo & React UI under services/idp/src)
• Microservices Layer: dozens of Go services under services/… (e.g. sharing, search, settings, collaboration, ocs, notifications, activitylog, app‐registry, etc.)
• Messaging/Event‐Bus: NATS (services/nats) for pub/sub between services
• Shared Libraries & Utilities: the pkg/… modules (config, middleware, logging, OIDC, registry, crypto, conversions, clihelper, protogen generated code under protogen/…)
• Runtime Orchestrator & CLI: the opencloud binary under opencloud/cmd/opencloud and its runtime package (opencloud/pkg/runtime) which can spawn and supervise services locally
• Data Store: local filesystem (rooted at $HOME/.opencloud) – no traditional database
Component relationships & data flows
• Client → Gateway (HTTP/REST & gRPC)
• Gateway → Microservices (routes requests by URL or gRPC service namespace)
• Microservices ↔ NATS (publish/subscribe events)
• Microservices ↔ Filesystem (read/write application data, logs)
• Microservices ↔ Identity Provider (OIDC token validation via HTTP/gRPC)
• Microservices ↔ Shared Libraries (internal call Graph of pkg/… modules and protogen‐generated stubs)
• Runtime → Services (invokes each service binary or goroutine via the runtime package)
Core architectural patterns & principles
• Microservices: each service in services/… is an independent Go module, built into its own binary.
• API Gateway: central entry point that enforces cross‐cutting concerns (auth, logging, rate‐limit) before routing.
• Event-Driven: NATS for loosely coupled asynchronous communication.
• Shared Code Modules: common concerns (config, logging, middleware) live in pkg/… and are imported by all services.
• Code Generation: proto definitions under protogen/proto → code under protogen/gen produce consistent gRPC + HTTP bindings.
• Filesystem as Storage: domain data (settings, users, shares, notifications) is serialized to disk – highlight that no RDBMS is used.
Detail level
• Major service group rather than all 70+ services individually; illustrate examples (Sharing, OCS, Collaboration, Search).
• How the OpenCloud CLI (opencloud server) uses the opencloud/pkg/runtime to start/monitor services locally for development.
• That acceptance tests spin up infrastructure via Docker Compose configs in deployments/examples/opencloud_full.