# simeg/eureka architecture

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

- Interactive diagram: https://gitdiagram.com/simeg/eureka
- Repository: https://github.com/simeg/eureka

## Overview

##### Main Components Identification

a) CLI Interface Layer
- Entry point (bin/eureka.rs)
- User interaction handling

b) Core Components
- Config Management (config_manager.rs)
- Git Operations (git.rs)
- I/O Operations
- Printer (printer.rs)
- Reader (reader.rs)
- Program Access (program_access.rs)

c) External Dependencies
- Git Repository
- Text Editor ($EDITOR)
- Pager ($PAGER)
- File System (XDG Base Directory/config storage)

##### Specific Component Details

For each component, include these details:

**CLI Interface (eureka.rs)**
- Command parsing
- Workflow orchestration

**Core Components**
- ConfigManager
- Config file R/W
- Environment variables
- GitManager
- Repository operations
- Commit/Push handling
- Printer/Reader
- User input handling
- Output formatting
- ProgramAccess
- External program execution

**External Dependencies**
- Git Repository
- Text Editor
- Pager
- Config Storage

## Diagram (Mermaid)

```mermaid
graph TB
    %% Main Layers
    subgraph CLI["CLI Interface Layer"]
        EntryPoint["CLI Entry Point"]:::cli
        CmdParser["Command Parser"]:::cli
    end

    subgraph Core["Core Components"]
        ConfigMgr["Config Manager"]:::core
        GitOps["Git Operations"]:::core
        IOPrinter["Printer"]:::core
        IOReader["Reader"]:::core
        ProgramAcc["Program Access"]:::core
        LibInterface["Library Interface"]:::core
    end

    subgraph External["External Dependencies"]
        Git[("Git Repository")]:::external
        Editor["Text Editor"]:::external
        Pager["Pager"]:::external
        ConfigStore[("Config Storage")]:::external
    end

    %% Relationships
    EntryPoint --> CmdParser
    CmdParser --> LibInterface
    LibInterface --> ConfigMgr
    LibInterface --> GitOps
    LibInterface --> IOPrinter
    LibInterface --> IOReader
    LibInterface --> ProgramAcc

    ConfigMgr -.- ConfigStore
    GitOps -.-> Git
    ProgramAcc -.-> Editor
    ProgramAcc -.-> Pager
    IOReader --> ProgramAcc
    IOPrinter --> ProgramAcc

    %% Click Events
    click EntryPoint "https://github.com/simeg/eureka/blob/master/src/bin/eureka.rs"
    click ConfigMgr "https://github.com/simeg/eureka/blob/master/src/config_manager.rs"
    click GitOps "https://github.com/simeg/eureka/blob/master/src/git.rs"
    click IOPrinter "https://github.com/simeg/eureka/blob/master/src/printer.rs"
    click IOReader "https://github.com/simeg/eureka/blob/master/src/reader.rs"
    click ProgramAcc "https://github.com/simeg/eureka/blob/master/src/program_access.rs"
    click LibInterface "https://github.com/simeg/eureka/blob/master/src/lib.rs"

    %% Styles
    classDef cli fill:#f9f,stroke:#333,stroke-width:2px
    classDef core fill:#9cf,stroke:#333,stroke-width:2px
    classDef external fill:#ff9,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1["CLI Components"]:::cli
        L2["Core Components"]:::core
        L3["External Dependencies"]:::external
        L4[("Storage")]:::external
    end

    %% Notes
    style ConfigStore fill:#ddd,stroke:#333,stroke-width:2px
    style Git fill:#ddd,stroke:#333,stroke-width:2px
```
