# mta-solutions/depthz architecture

> Architecture diagram of the GitHub repository mta-solutions/depthz, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mta-solutions/depthz
- Repository: https://github.com/mta-solutions/depthz

## Overview

##### Main Components Identification
The system consists of several key components that should be represented:

a) Core Components:
- Parser Module (src/parser.rs)
- Builder Module (src/builder.rs)
- Main Application (src/main.rs)

b) External Dependencies:
- Git CLI Interface
- File System Interface

c) Configuration Support:
- Multiple format parsers (YAML, JSON, TOML)

**Top Level (Input Layer):**
- Git Repositories
- Local File System
- DEPTHZ Configuration Files (YAML/JSON/TOML)

**Processing Layer:**
- Parser Module
- Builder Module
- Git CLI Interface

**Output Layer:**

##### Key Relationships to Highlight

a) Data Flow:
- How DEPTHZ files are read from various sources
- Parsing process of different file formats
- Demonstrate how the builder constructs the dependency graph

b) Component Interactions:
- Parser interaction with different file formats
- Builder's relationship with the parser
- Git CLI integration points

##### Specific Implementation Details

- Hexagons for external dependencies (Git CLI)
- Rounded rectangles for input/output formats

##### Important Flows

**Input Sources -> Parser Module:**
- DEPTHZ file reading (YAML/JSON/TOML)
- Git repository cloning/pulling

**Parser Module -> Builder Module:**
- Parsed configuration data
- Repository structure information

**Builder Module -> Output:**
- Dependency relationships

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style definitions
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef input fill:#4CAF50,stroke:#388E3C,color:white
    classDef process fill:#FFC107,stroke:#FFA000,color:black
    classDef external fill:#FF9800,stroke:#F57C00,color:white
    classDef output fill:#9C27B0,stroke:#7B1FA2,color:white
    classDef config fill:#00BCD4,stroke:#0097A7,color:white

    %% Input Layer
    subgraph Input
        GIT[Git Repositories]:::input
        FS[Local File System]:::input
        CFG[Configuration Files]:::input
    end

    %% Configuration Formats
    subgraph Configs
        YAML[YAML Format]:::config
        JSON[JSON Format]:::config
        TOML[TOML Format]:::config
        CFG --> YAML & JSON & TOML
    end

    %% Core Processing
    subgraph Processing
        PARSER[Parser Module]:::core
        BUILDER[Builder Module]:::core
        MAIN[Main Application]:::core
        GITCLI[Git CLI Interface]:::external
    end

    %% Output Layer
    subgraph Output
        MERMAID[Mermaid Graph]:::output
    end

    %% Relationships
    GIT --> GITCLI
    FS --> PARSER
    YAML & JSON & TOML --> PARSER
    GITCLI --> PARSER
    PARSER --> BUILDER
    BUILDER --> MAIN
    MAIN --> MERMAID

    %% Click events
    click PARSER "https://github.com/mta-solutions/depthz/blob/main/src/parser.rs"
    click BUILDER "https://github.com/mta-solutions/depthz/blob/main/src/builder.rs"
    click MAIN "https://github.com/mta-solutions/depthz/blob/main/src/main.rs"
    click YAML "https://github.com/mta-solutions/depthz/blob/main/test/repo/DEPTHZ.yml"
    click TOML "https://github.com/mta-solutions/depthz/blob/main/test/repo/b/DEPTHZ.toml"
    click CFG "https://github.com/mta-solutions/depthz/blob/main/Cargo.toml"

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[Input Sources]:::input
        L3[Processing]:::process
        L4[External Dependencies]:::external
        L5[Output Formats]:::output
        L6[Configuration]:::config
    end
```
