# finos/legend-sdlc architecture

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

- Interactive diagram: https://gitdiagram.com/finos/legend-sdlc
- Repository: https://github.com/finos/legend-sdlc

## Overview

##### Project Type and Purpose
- This is a Java‐based, model-centric SDLC server, delivered as a multi-module Maven project.
- Supplementary modules provide serializing/deserializing entities, code generation (files, models, services, tests), protocol converters, plugins, and server backends (FS or GitLab).

##### Top-Level Modules & Patterns
- Plugin architecture via Java ServiceLoader (META-INF/services entries in serialization & protocol modules).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Clients
    subgraph "Clients"
        UI["UI / Custom Tools (Model Editors, CI Scripts)"]:::external
    end

    %% Legend SDLC Server
    subgraph "Legend SDLC Server"
        subgraph "Presentation Layer"
            REST["REST API Resources"]:::frontend
        end
        subgraph "Application Layer"
            APP["Application / Command Layer"]:::domain
        end
        subgraph "Domain Layer"
            DM["Domain Model"]:::domain
            API["Domain-API Abstractions"]:::domain
        end
        subgraph "Infrastructure Layer"
            SHARED["Shared Server Infrastructure"]:::infra
            subgraph "Persistence Backends"
                FS["FileSystem Backend"]:::infra
                GL["GitLab Backend"]:::infra
            end
        end
    end

    %% Plugin & Library Modules
    subgraph "Plugins & Libraries"
        ES["Entity Serialization SPI"]:::infra
        PC["Protocol Converters"]:::infra
        PP["Protocol Converters (Pure)"]:::infra
        subgraph "Code Generation Modules"
            EMP["Entity Maven Plugin"]:::infra
            FGPm["File Generation Maven Plugin"]:::infra
            FGL["File Generation Library"]:::infra
            MGPm["Model Generation Maven Plugin"]:::infra
            MGL["Model Generation Library"]:::infra
            SGPm["Service Generation Maven Plugin"]:::infra
            SGL["Service Generation Library"]:::infra
            TGPm["Test Generation Maven Plugin"]:::infra
            TGL["Test Generation Library"]:::infra
            SGU["Shared Generation Utilities"]:::infra
        end
    end

    %% External Services
    subgraph "External"
        GITLAB_SERVICE["GitLab (OAuth & Repo Hosting)"]:::external
        CI["Maven, GitHub/GitLab CI, Docker"]:::external
    end

    %% Data Flows
    UI -->|"HTTP" | REST
    REST -->|"delegates to"| APP
    APP -->|"uses"| DM
    APP -->|"calls"| API
    API -->|"persists via"| FS
    API -->|"persists via"| GL
    FS -->|"File I/O"| CI
    GL -->|"GitLab HTTP" | GITLAB_SERVICE
    SHARED -->|"loads plugins via ServiceLoader"| ES
    SHARED -->|"loads plugins via ServiceLoader"| PC
    SHARED -->|"loads plugins via ServiceLoader"| PP
    APP -->|"invokes code generation"| FGPm
    APP -->|"invokes code generation"| MGPm
    APP -->|"invokes code generation"| SGPm
    APP -->|"invokes code generation"| TGPm
    EMP -->|"build-time plugin"| CI
    FGPm -->|"uses utilities"| SGU
    MGPm -->|"uses utilities"| SGU
    SGPm -->|"uses utilities"| SGU
    TGPm -->|"uses utilities"| SGU

    %% Click Events
    click SHARED "https://github.com/finos/legend-sdlc/tree/master/legend-sdlc-server-shared/"
    click FS "https://github.com/finos/legend-sdlc/tree/master/legend-sdlc-server-fs/"
    click GL "https://github.com/finos/legend-sdlc/tree/master/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/gitlab/"
    click REST "https://github.com/finos/legend-sdlc/tree/master/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/"
    click APP "https://github.com/finos/legend-sdlc/tree/master/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/application/"
    click API "https://github.com/finos/legend-sdlc/tree/master/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/domain/api/"
    click DM "https://github.com/finos/legend-sdlc/tree/master/legend-sdlc-model/"
    click ES "https://github.com/finos/legend-sdlc/tree/master/legend-sdlc-entity-serialization/"
    click PC "https://github.com/finos/legend-sdlc/tree/master/legend-sdlc-protocol/"
    click PP "https://github.com/finos/legend-sdlc/tree/master/legend-sdlc-protocol-pure/"
    click EMP "https://github.com/finos/legend-sdlc/tree/master/legend-sdlc-entity-maven-plugin/"
    click FGPm "https://github.com/finos/legend-sdlc/tree/master/legend-sdlc-generation-file-maven-plugin/"
    click FGL "https://github.com/finos/legend-sdlc/tree/master/legend-sdlc-generation-file/"
    click MGPm "https://github.com/finos/legend-sdlc/tree/master/legend-sdlc-generation-model-maven-plugin/"
    click MGL "https://github.com/finos/legend-sdlc/tree/master/legend-sdlc-generation-model/"
    click SGPm "https://github.com/finos/legend-sdlc/tree/master/legend-sdlc-generation-service-maven-plugin/"
    click SGL "https://github.com/finos/legend-sdlc/tree/master/legend-sdlc-generation-service/"
    click TGPm "https://github.com/finos/legend-sdlc/tree/master/legend-sdlc-test-generation-maven-plugin/"
    click TGL "https://github.com/finos/legend-sdlc/tree/master/legend-sdlc-test-generation/"
    click SGU "https://github.com/finos/legend-sdlc/tree/master/legend-sdlc-generation-shared/"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000,color:#000;
    classDef domain fill:#90EE90,stroke:#000,color:#000;
    classDef infra fill:#FFA500,stroke:#000,color:#000;
    classDef external fill:#D3D3D3,stroke:#000,color:#000;
```
