# open-hand/choerodon architecture

> Architecture diagram of the GitHub repository open-hand/choerodon, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/open-hand/choerodon
- Repository: https://github.com/open-hand/choerodon

## Overview

##### Project type and purpose
- This is an open-source, full-stack microservices platform (Choerodon 2.0) for enterprise agile collaboration across the whole value chain.
- It provides a suite of Spring Cloud–based microservices (Eureka registry, gateway, authentication, IAM, file/message/monitoring services, DevOps toolchain integration, workflow engine, code+artifact repositories, cluster agent) plus a React/Ant-Design frontend.

##### File structure and README
- The repository itself contains documentation (README files, ROADMAP, screenshots, changelogs) and no service code.
- However, the README enumerates each microservice, its responsibilities, and external integrations (GitLab, Kubernetes, Istio, Knative, Nexus, Harbor, etc.).

##### README for architecture insights
- Component relationship list shows a Maven parent POM (“choerodon-parent”) with child modules for each microservice.
- All backend services use Spring Cloud, register to Eureka, and are routed through Spring Cloud Gateway.
- Key external dependencies: GitLab (code repo), Nexus/Harbor (artifact repo), Kubernetes clusters (deployment environments), message bus or DBs (persistence and events).

##### Detailed capture of essential elements
- Services under the “choerodon-parent” umbrella to show their common inheritance of dependencies.
- Cross-cutting services (choerodon-swagger for docs, choerodon-monitor for auditing).
- How choerodon-starters (core library) underpins all microservices, even though it’s not a runtime component.
- Cluster-agent’s dual role: connecting the platform to Kubernetes clusters for continuous delivery and environment management.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        UI["Choerodon Frontend (React/AntD)"]:::frontend
    end

    %% API Gateway and Registry
    subgraph "API Boundary"
        direction TB
        Gateway["API Gateway<br/>(choerodon-gateway)"]:::core
        Registry["Service Registry<br/>(Eureka)"]:::core
    end

    UI -->|HTTPS| Gateway
    Gateway -->|registers/discovers| Registry

    %% Backend Microservices
    subgraph "Backend Microservices" 
        direction TB
        subgraph "Auth & IAM"
            direction TB
            OAuth["Authentication/OAuth2<br/>(choerodon-oauth)"]:::core
            IAM["IAM & Admin<br/>(choerodon-iam / choerodon-admin)"]:::core
            Platform["Core Platform<br/>(choerodon-platform)"]:::core
        end

        subgraph "DevOps & Repos"
            direction TB
            DevOps["DevOps Service<br/>(devops-service-business)"]:::devops
            GitLabInt["GitLab Integration<br/>(gitlab-service)"]:::devops
            CodeRepo["Code Repo Service<br/>(code-repo-service)"]:::devops
            ProdRepo["Artifact Repo Service<br/>(prod-repo-service)"]:::devops
            ClusterAgent["Cluster Agent<br/>(choerodon-cluster-agent)"]:::devops
        end

        subgraph "Workflow & Infra Services"
            direction TB
            Workflow["Workflow Engine<br/>(workflow-service)"]:::core
            FileSvc["File Service<br/>(choerodon-file)"]:::core
            MsgSvc["Message Service<br/>(choerodon-message)"]:::core
            Monitor["Monitoring Service<br/>(choerodon-monitor)"]:::core
            Swagger["Swagger Docs<br/>(choerodon-swagger)"]:::core
        end
    end

    %% Infrastructure & External Systems
    subgraph "Infrastructure & External Systems"
        direction TB
        GitLab["GitLab Server"]:::external
        Nexus["Nexus / Harbor Registry"]:::external
        Kubernetes["Kubernetes Clusters<br/>(Istio/Knative)"]:::external
        DB["Databases / Message Bus"]:::external
    end

    %% Flows
    Gateway -->|authenticate| OAuth
    OAuth -->|token| Gateway
    Gateway -->|API calls| IAM
    Gateway -->|API calls| Platform

    DevOps -->|SCM calls| GitLabInt
    GitLabInt --> GitLab
    DevOps -->|repo operations| CodeRepo
    CodeRepo -->|stores code| GitLab
    DevOps -->|push artifacts| ProdRepo
    ProdRepo --> Nexus
    DevOps -->|deploy| ClusterAgent
    ClusterAgent --> Kubernetes

    Workflow -->|invokes| Platform
    Workflow -->|uses| MsgSvc
    MsgSvc --> DB

    FileSvc --> DB
    Monitor --> DB
    Swagger --> Registry

    %% Connections to Registry
    OAuth -->|registers| Registry
    IAM -->|registers| Registry
    Platform -->|registers| Registry
    DevOps -->|registers| Registry
    GitLabInt -->|registers| Registry
    CodeRepo -->|registers| Registry
    ProdRepo -->|registers| Registry
    ClusterAgent -->|registers| Registry
    Workflow -->|registers| Registry
    FileSvc -->|registers| Registry
    MsgSvc -->|registers| Registry
    Monitor -->|registers| Registry
    Swagger -->|registers| Registry

    %% Styles
    classDef frontend fill:#D8BFD8,stroke:#663399,color:#000
    classDef core fill:#ADD8E6,stroke:#0077B6,color:#000
    classDef devops fill:#90EE90,stroke:#2E8B57,color:#000
    classDef external fill:#FFA500,stroke:#D2691E,color:#000
```
