# defenseunicorns/uds-software-factory architecture

> Architecture diagram of the GitHub repository defenseunicorns/uds-software-factory, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/defenseunicorns/uds-software-factory
- Repository: https://github.com/defenseunicorns/uds-software-factory

## Overview

##### High-Level Architecture Components

a) Infrastructure Layer:
- K3d/Kubernetes Cluster
- UDS Core Base
- UDS Core Identity and Authorization

b) Primary Software Factory Components:
- GitLab (Core DevOps Platform)
- GitLab Runner (CI/CD)
- Postgres Operator (Database Management)
- Valkey (Redis Alternative)
- Mattermost (Communication)
- SonarQube (Code Quality)
- Renovate (Dependency Management)

c) Lab Components (Experimental):
- Sigstore (Artifact Signing)
- Archivista (Attestation Storage)

##### Component Relationships

- Authentication flows through Identity and Authorization layer
- Database connections from applications to Postgres Operator
- CI/CD pipelines between GitLab and GitLab Runner
- Integration points between tools (e.g., SonarQube → GitLab)

##### Additional Details

Annotations for:
- Resource requirements (CPU/Memory)
- Version compatibility
- Integration points with UDS Core
- Network flows between components

## Diagram (Mermaid)

```mermaid
graph TB
    %% Infrastructure Layer
    subgraph Infrastructure
        K3D[K3d/Kubernetes Cluster]
        UDSCore[UDS Core Base]
        Auth[Identity & Authorization]
    end
    click K3D "https://github.com/defenseunicorns/uds-software-factory/tree/main/bundles/k3d-demo"

    %% Primary Components Layer
    subgraph Primary["Primary Software Factory"]
        GitLab[GitLab]
        Runner[GitLab Runner]
        Postgres[(Postgres Operator)]
        Valkey[(Valkey Redis Alt)]
        Mattermost[Mattermost]
        SonarQube[SonarQube]
        Renovate[Renovate]
    end
    click Renovate "https://github.com/defenseunicorns/uds-software-factory/blob/main/renovate.json"

    %% Lab Components Layer
    subgraph Lab["Lab Components"]
        Sigstore{{"Sigstore"}}
        Archivista{{"Archivista"}}
    end
    click Archivista "https://github.com/defenseunicorns/uds-software-factory/blob/main/adr/0002-store-attestations-in-archivista.md"

    %% Configuration Layer
    subgraph Config["Configuration"]
        BundleDev["Dev Bundle Config"]
        BundleDemo["Demo Bundle Config"]
        ConfigDev["Dev Settings"]
        ConfigDemo["Demo Settings"]
    end
    click BundleDev "https://github.com/defenseunicorns/uds-software-factory/blob/main/bundles/dev/uds-bundle.yaml"
    click BundleDemo "https://github.com/defenseunicorns/uds-software-factory/blob/main/bundles/k3d-demo/uds-bundle.yaml"
    click ConfigDev "https://github.com/defenseunicorns/uds-software-factory/blob/main/bundles/dev/uds-config.yaml"
    click ConfigDemo "https://github.com/defenseunicorns/uds-software-factory/blob/main/bundles/k3d-demo/uds-config.yaml"

    %% Documentation Layer
    subgraph Docs["Documentation"]
        DB_Doc["Database Architecture"]
        Net_Doc["Network Architecture"]
        Dev_Doc["Development Guidelines"]
        Test_Doc["Testing Framework"]
        Ver_Doc["Version Management"]
    end
    click DB_Doc "https://github.com/defenseunicorns/uds-software-factory/blob/main/docs/database.md"
    click Net_Doc "https://github.com/defenseunicorns/uds-software-factory/blob/main/docs/networking.md"
    click Dev_Doc "https://github.com/defenseunicorns/uds-software-factory/blob/main/docs/development.md"
    click Test_Doc "https://github.com/defenseunicorns/uds-software-factory/blob/main/docs/testing.md"
    click Ver_Doc "https://github.com/defenseunicorns/uds-software-factory/blob/main/docs/versioning.md"

    %% Relationships
    K3D --> UDSCore
    UDSCore --> Auth
    Auth --> GitLab
    Auth --> Mattermost
    Auth --> SonarQube
    
    GitLab --> Runner
    GitLab --> Postgres
    Mattermost --> Postgres
    SonarQube --> Postgres
    
    GitLab --> Valkey
    Mattermost --> Valkey
    
    GitLab --> Renovate
    
    GitLab --> Sigstore
    Sigstore --> Archivista
    
    BundleDev --> K3D
    BundleDemo --> K3D
    ConfigDev --> UDSCore
    ConfigDemo --> UDSCore

    %% Styling
    classDef infrastructure fill:#a8d1ff,stroke:#333,stroke-width:1px
    classDef primary fill:#90EE90,stroke:#333,stroke-width:1px
    classDef lab fill:#FFE5B4,stroke:#333,stroke-width:1px
    classDef config fill:#E6E6FA,stroke:#333,stroke-width:1px
    classDef docs fill:#F5F5F5,stroke:#333,stroke-width:1px
    classDef database fill:#F8F8FF,stroke:#333,stroke-width:1px
    
    class K3D,UDSCore,Auth infrastructure
    class GitLab,Runner,Mattermost,SonarQube,Renovate primary
    class Postgres,Valkey database
    class Sigstore,Archivista lab
    class BundleDev,BundleDemo,ConfigDev,ConfigDemo config
    class DB_Doc,Net_Doc,Dev_Doc,Test_Doc,Ver_Doc docs
```
