# erikbern/git-of-theseus architecture

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

- Interactive diagram: https://gitdiagram.com/erikbern/git-of-theseus
- Repository: https://github.com/erikbern/git-of-theseus

## Overview

- Git Repo → Repository Analyzer
- Repository Analyzer → JSON Storage
- JSON Storage → Plot Generators
- Plot Generators → Output Visualizations

- Matplotlib configuration → Plot Generators
- Docker container dependencies

##### Specific Implementation Details

a. Command-line Interface Layer
- git-of-theseus-analyze
- git-of-theseus-stack-plot
- git-of-theseus-line-plot
- git-of-theseus-survival-plot

b. Core Analysis Modules (from git_of_theseus directory)
- analyze.py
- line_plot.py
- stack_plot.py
- survival_plot.py
- utils.py

##### External Dependencies Section
- Git
- Python
- Matplotlib
- Docker (optional deployment)

##### Processing Pipeline Flow
Sequential steps:
1. Repository Analysis
2. Data Processing
3. JSON Generation
4. Plot Generation

- Direct Python installation
- Docker container deployment
- CI/CD pipeline (.github/workflows/ci-cd.yml)

Important Considerations:

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Legend
        L1[Rectangle: Input/Source]:::input
        L2[/Processing/]:::processing
        L3[(Storage)]:::storage
        L4(["Output/Visualization"]):::output
        L5{{Core Analysis}}:::core
    end

    subgraph "Input Layer"
        GR[Git Repository]:::input
        CP[Configuration Parameters]:::input
        MM[.mailmap file]:::input
    end

    subgraph "Analysis Core"
        RA{{Repository Analyzer}}:::core
        DP{{Data Processors}}:::core
        GHP{{Git History Parser}}:::core
    end

    subgraph "Data Storage"
        CH[(cohorts.json)]:::storage
        AU[(authors.json)]:::storage
        SU[(survival.json)]:::storage
        EX[(exts.json)]:::storage
    end

    subgraph "Visualization Layer"
        SP(/Stack Plot Generator/):::processing
        LP(/Line Plot Generator/):::processing
        SV(/Survival Plot Generator/):::processing
        MI(/Matplotlib Integration/):::processing
    end

    subgraph "External Dependencies"
        GIT[Git]:::ext
        PY[Python]:::ext
        MPL[Matplotlib]:::ext
        DOC[Docker]:::ext
    end

    subgraph "Deployment"
        PIP[/Python Installation/]:::deploy
        DC[/Docker Container/]:::deploy
        CI[/CI/CD Pipeline/]:::deploy
    end

    %% Relationships
    GR --> RA
    CP --> RA
    MM --> RA
    RA --> |Process| DP
    DP --> |Parse| GHP
    GHP --> |Store| CH & AU & SU & EX
    CH & AU & SU & EX --> SP & LP & SV
    MI --> SP & LP & SV
    MPL --> MI

    %% Click Events
    click RA "https://github.com/erikbern/git-of-theseus/blob/master/git_of_theseus/analyze.py"
    click DP "https://github.com/erikbern/git-of-theseus/blob/master/git_of_theseus/utils.py"
    click SP "https://github.com/erikbern/git-of-theseus/blob/master/git_of_theseus/stack_plot.py"
    click LP "https://github.com/erikbern/git-of-theseus/blob/master/git_of_theseus/line_plot.py"
    click SV "https://github.com/erikbern/git-of-theseus/blob/master/git_of_theseus/survival_plot.py"
    click MI "https://github.com/erikbern/git-of-theseus/tree/master/container/root/.config/matplotlib/matplotlibrc"
    click DC "https://github.com/erikbern/git-of-theseus/tree/master/Dockerfile"
    click CI "https://github.com/erikbern/git-of-theseus/blob/master/.github/workflows/ci-cd.yml"

    %% Styling
    classDef input fill:#90EE90
    classDef processing fill:#ADD8E6
    classDef storage fill:#FFFFE0
    classDef output fill:#DDA0DD
    classDef core fill:#4169E1,color:white
    classDef ext fill:#F0F8FF
    classDef deploy fill:#FFE4E1
```
