# nihil2501/footgauntlet architecture

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

- Interactive diagram: https://gitdiagram.com/nihil2501/footgauntlet
- Repository: https://github.com/nihil2501/footgauntlet

## Overview

##### Main Components Identification

a) CLI Layer (Entry Point)
- Located in lib/footgauntlet/cli/
- Handles user input/output and command-line options
- Components: IO, Options, Exit handlers

b) Core Layer (Business Logic)
- Located in lib/footgauntlet/core/
- Contains the main domain logic
- Key components:
- Models
- Processors (specifically LeagueSummaryProcessor)
- Streams (LeagueSummaryStream)

c) Utils Layer (Infrastructure)
- Located in lib/footgauntlet/utils/
- Contains the Brod framework for stream processing
- Configuration management
- Shared utilities

##### Component Relationships

- Data flow: Input → CLI → Stream → Processor → Output
- Dependencies: Show how components depend on each other
- Inheritance/Implementation relationships

##### Specific Elements

a) Input/Output
- Input stream of soccer data
- Output stream of processed results

b) Processing Pipeline
- Stream processing nature
- How data transforms through the pipeline

c) Framework Integration
- How Brod framework integrates with the core components

##### Notes

Notes to explain:
- Stream processing pattern
- Data transformation steps
- Configuration points

##### The extensibility points in the architecture

Remember to highlight the Brod framework's role as it appears to be a crucial part of the architecture, handling the stream processing infrastructure.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph CLI
        CLI_Interface["CLI Interface"]:::cli
        CLI_IO["IO Handler"]:::cli
        CLI_Options["Options Handler"]:::cli
        CLI_Exit["Exit Handler"]:::cli
        
        CLI_Interface --> CLI_IO
        CLI_Interface --> CLI_Options
        CLI_Interface --> CLI_Exit
    end

    subgraph Core
        Models["Core Models"]:::core
        
        subgraph "Processing Pipeline"
            LSStream["League Summary Stream"]:::core
            LSProcessor["League Summary Processor"]:::core
            Ranker["Ranker"]:::core
            UniqueTracker["Unique Run Tracker"]:::core
            
            LSStream --> LSProcessor
            LSProcessor --> Ranker
            LSProcessor --> UniqueTracker
        end
    end

    subgraph Utils
        subgraph "Brod Framework"
            Producer["Producer"]:::utils
            Consumer["Consumer"]:::utils
            Stream["Stream"]:::utils
            Topic["Topic"]:::utils
            
            Producer --> Topic
            Consumer --> Topic
            Stream --> Producer
            Stream --> Consumer
        end
        
        Config["Configuration Factory"]:::utils
    end

    Input((("Soccer Data\nInput"))):::io
    Output((("Processed\nResults"))):::io

    Input --> CLI_Interface
    CLI_Interface --> LSStream
    LSProcessor --> Output

    %% Component Relationships
    LSStream --> Stream
    Config --> CLI_Interface
    Models --> LSProcessor

    %% Styling
    classDef cli fill:#2196F3,stroke:#1565C0,color:white
    classDef core fill:#4CAF50,stroke:#2E7D32,color:white
    classDef utils fill:#FFC107,stroke:#FFA000,color:black
    classDef io fill:#9E9E9E,stroke:#616161,color:white

    %% Click Events
    click CLI_Interface "https://github.com/nihil2501/footgauntlet/blob/main/lib/footgauntlet/cli.rb"
    click CLI_IO "https://github.com/nihil2501/footgauntlet/blob/main/lib/footgauntlet/cli/io.rb"
    click CLI_Options "https://github.com/nihil2501/footgauntlet/blob/main/lib/footgauntlet/cli/options.rb"
    click CLI_Exit "https://github.com/nihil2501/footgauntlet/blob/main/lib/footgauntlet/cli/exit.rb"
    click Models "https://github.com/nihil2501/footgauntlet/blob/main/lib/footgauntlet/core/models.rb"
    click LSProcessor "https://github.com/nihil2501/footgauntlet/blob/main/lib/footgauntlet/core/processors/league_summary_processor.rb"
    click Ranker "https://github.com/nihil2501/footgauntlet/blob/main/lib/footgauntlet/core/processors/league_summary_processor/ranker.rb"
    click UniqueTracker "https://github.com/nihil2501/footgauntlet/blob/main/lib/footgauntlet/core/processors/league_summary_processor/unique_run_tracker.rb"
    click LSStream "https://github.com/nihil2501/footgauntlet/blob/main/lib/footgauntlet/core/streams/league_summary_stream.rb"
    click Producer "https://github.com/nihil2501/footgauntlet/blob/main/lib/footgauntlet/utils/brod/producer.rb"
    click Consumer "https://github.com/nihil2501/footgauntlet/blob/main/lib/footgauntlet/utils/brod/consumer.rb"
    click Stream "https://github.com/nihil2501/footgauntlet/blob/main/lib/footgauntlet/utils/brod/stream.rb"
    click Topic "https://github.com/nihil2501/footgauntlet/blob/main/lib/footgauntlet/utils/brod/topic.rb"
    click Config "https://github.com/nihil2501/footgauntlet/blob/main/lib/footgauntlet/utils/configuration_factory.rb"
```
