# ebzych/amphimixis architecture

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

- Interactive diagram: https://gitdiagram.com/ebzych/amphimixis
- Repository: https://github.com/ebzych/amphimixis

## Overview

##### Project type and purpose
- Amphimixis is a Python-based CLI tool whose goal is to automate project builds and profile application performance across platforms.
- It is not a web app or microservice ecosystem; rather it is a developer-tool suite composed of distinct functional modules.

##### File structure
- Top-level files and directories:
- ci/: shell scripts driving CI checks (black, mypy, pylint).
- pyproject.toml: Python packaging and dependency configuration.
- src/main.py: CLI entrypoint.
- src/{analyzer, builder, configurator, profiler, shell, general}: functional subpackages.
- Each subpackage encapsulates one concern:
- configurator: environment setup.
- shell: abstracts local vs SSH command execution.
- builder: invokes Make or CMake.
- analyzer: inspects project for CI, tests, benchmarks, dependencies.
- profiler: runs perf or flamegraph and gathers metrics.
- general: logging, coloring, shared utilities.

##### README for additional insights
- Amphimixis workflows:
a) A target project.
b) Configure environment.
c) Build with multiple systems.
d) Profile performance.
e) Compare results across platforms (local or remote via SSH).

##### Details
- Of the six subpackages as its own block.
- Strategy switch inside Shell Handler (local vs SSH).
- Data flow: configuration parameters → build commands → profiling data → analysis output.
- Do not overwhelm with file-level detail; group files by module.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core Orchestration
    subgraph "Core Orchestration"
        CLI["CLI Entrypoint\n(main.py)"]:::core
        Configurator["Configurator"]:::core
    end

    %% Execution Layers
    subgraph "Execution Layers"
        Builder["Builder"]:::exec
        Profiler["Profiler"]:::exec
        subgraph "Shell Handler"
            ShellBase["Shell Abstraction"]:::exec
            ShellInterface["Shell Interface"]:::exec
            LocalShell["Local Strategy"]:::exec
            SSHShell["SSH Strategy"]:::exec
            ShellBase --> ShellInterface
            ShellInterface --> LocalShell
            ShellInterface --> SSHShell
        end
    end

    %% Analysis
    subgraph "Analysis"
        Analyzer["Analyzer"]:::analysis
        SharedUtils["Shared Utilities"]:::analysis
    end

    %% External Systems
    subgraph "External Systems"
        TargetProject["Target Project\n(Source Repo)"]:::external
        BuildSystems["Build Systems\n(Make / CMake)"]:::external
        ProfilingTools["Profiling Tools\n(perf / flamegraph)"]:::external
        RemoteHost["Remote Host\n(SSH)"]:::external
        CI["CI Scripts"]:::external
        Packaging["pyproject.toml"]:::external
    end

    %% Control Flow
    CLI --> Analyzer
    CLI --> Configurator
    CLI --> Builder
    CLI --> Profiler

    Configurator --> ShellInterface
    Builder --> ShellInterface
    Profiler --> ShellInterface
    Profiler --> Analyzer

    %% Data/Tool Interactions
    Analyzer --> TargetProject
    ShellInterface --> BuildSystems
    ShellInterface --> ProfilingTools
    LocalShell -- uses --> RemoteHost
    SSHShell -.-> RemoteHost

    %% Shared Utilities usage
    SharedUtils --- CLI
    SharedUtils --- Configurator
    SharedUtils --- Builder
    SharedUtils --- Profiler
    SharedUtils --- Analyzer

    %% Click Events
    click CLI "https://github.com/ebzych/amphimixis/blob/main/src/main.py"
    click Configurator "https://github.com/ebzych/amphimixis/tree/main/src/configurator/"
    click ShellBase "https://github.com/ebzych/amphimixis/blob/main/src/shell/shell.py"
    click ShellInterface "https://github.com/ebzych/amphimixis/blob/main/src/shell/shell_interface.py"
    click LocalShell "https://github.com/ebzych/amphimixis/blob/main/src/shell/local_shell_handler.py"
    click SSHShell "https://github.com/ebzych/amphimixis/blob/main/src/shell/ssh_shell_handler.py"
    click Builder "https://github.com/ebzych/amphimixis/tree/main/src/builder/"
    click Profiler "https://github.com/ebzych/amphimixis/tree/main/src/profiler/"
    click Analyzer "https://github.com/ebzych/amphimixis/tree/main/src/analyzer/"
    click SharedUtils "https://github.com/ebzych/amphimixis/tree/main/src/general/"
    click CI "https://github.com/ebzych/amphimixis/tree/main/ci/"
    click Packaging "https://github.com/ebzych/amphimixis/blob/main/pyproject.toml"

    %% Styles
    classDef core fill:#D0E8FF,stroke:#0366D6;
    classDef exec fill:#DFF5E1,stroke:#2E8B57;
    classDef analysis fill:#FFE5B4,stroke:#FF8C00;
    classDef external fill:#E0E0E0,stroke:#888888,stroke-dasharray: 5 5;
```
