# gregowen/wreath architecture

> Architecture diagram of the GitHub repository gregowen/wreath, 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/gregowen/wreath
- Repository: https://github.com/gregowen/wreath

## Overview

##### Project Type Analysis
This is a command-line utility tool written in Rust that interacts with Git repositories to modify commit messages. The project structure suggests a modular design with separate binary targets and a core library.

##### Main Components

a) Core Components:
- Library Core (lib.rs)
- Strategy Module (strategies.rs)
- Binary Executables
- Main Wreath CLI (wreath.rs)
- Editor (editor.rs)
- Sequence Editor (sequence_editor.rs)

b) External Dependencies:
- Git System
- File System (for message files)

**┌─ User Interface Layer ─────────────────┐**

- CLI Binaries (wreath, editor, etc.)  │

- Core Logic Layer ──────────────────┐ │

- lib.rs (Core Library)             │ │
- Message Processing            │ │
- Git Integration              │ │

- Strategy Layer ───────────────────┤ │

- strategies.rs                     │ │
- Default Strategy             │ │
- Cycle Strategy              │ │

- ┘ │

**External Systems:                      │**
- Git Repository                      │
- Message Files                       │

##### Component Relationships

- User input → CLI Binaries
- CLI Binaries → Core Library
- Core Library → Strategy Module
- Core Library ↔ Git Repository
- Core Library ↔ Message Files

##### Important Details

a) Process Flow Annotations:
##### Git integration performs commit message updates

b) Configuration Elements:
- Environment variable (WREATH_STRATEGY) influence
- File system paths for messages

##### Technical Notes

- The Rust crate structure
- Binary targets vs library components
- External system dependencies
- Configuration points

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph UI["User Interface Layer"]
        CLI["Main CLI"]
        Editor["Editor"]
        SeqEditor["Sequence Editor"]
    end

    subgraph Core["Core Logic Layer"]
        LibCore["Core Library"]
        subgraph Processing["Message Processing"]
            MsgLoad["Message Loading"]
            MsgApply["Message Application"]
        end
        GitInt["Git Integration"]
    end

    subgraph Strategy["Strategy Layer"]
        StratMod["Strategy Module"]
        DefStrat["Default Strategy"]
        CycleStrat["Cycle Strategy"]
    end

    subgraph External["External Systems"]
        Git[("Git Repository")]
        MsgFiles["Message Files"]
        Config["Configuration"]
    end

    %% Relationships
    CLI --> LibCore
    Editor --> LibCore
    SeqEditor --> LibCore
    LibCore --> Processing
    LibCore --> GitInt
    GitInt <--> Git
    Processing <--> MsgFiles
    LibCore --> StratMod
    StratMod --> DefStrat
    StratMod --> CycleStrat
    Config --> StratMod

    %% Click Events
    click CLI "https://github.com/GregOwen/wreath/blob/master/src/bin/wreath.rs"
    click Editor "https://github.com/GregOwen/wreath/blob/master/src/bin/editor.rs"
    click SeqEditor "https://github.com/GregOwen/wreath/blob/master/src/bin/sequence_editor.rs"
    click LibCore "https://github.com/GregOwen/wreath/blob/master/src/lib.rs"
    click StratMod "https://github.com/GregOwen/wreath/blob/master/src/strategies.rs"
    click MsgFiles "https://github.com/GregOwen/wreath/tree/master/messages"
    click Config "https://github.com/GregOwen/wreath/blob/master/Cargo.toml"

    %% Styling
    classDef ui fill:#90EE90,stroke:#333,stroke-width:2px
    classDef core fill:#87CEEB,stroke:#333,stroke-width:2px
    classDef strategy fill:#FFD700,stroke:#333,stroke-width:2px
    classDef external fill:#D3D3D3,stroke:#333,stroke-width:2px
    classDef processing fill:#ADD8E6,stroke:#333,stroke-width:2px

    class CLI,Editor,SeqEditor ui
    class LibCore,GitInt core
    class Processing,MsgLoad,MsgApply processing
    class StratMod,DefStrat,CycleStrat strategy
    class Git,MsgFiles,Config external

    %% Legend
    subgraph Legend
        UI_L["User Interface"]:::ui
        Core_L["Core Components"]:::core
        Strat_L["Strategy Components"]:::strategy
        Ext_L["External Systems"]:::external
    end
```
