# danmou/advent-of-code-2024-rust architecture

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

- Interactive diagram: https://gitdiagram.com/danmou/advent-of-code-2024-rust
- Repository: https://github.com/danmou/advent-of-code-2024-rust

## Overview

##### Main Components

a. Input Processing System
- An input directory handler component that manages the reading of challenge input files
- File system interaction for the 'inputs/*.txt' files

b. Solution Modules Structure
- Binary modules (Days 1-17, parts A and B)
- Hierarchical organization of the solutions

c. Build System
- Cargo (Rust's package manager) as a component
- Dependency management flow

**[Component Layout]**

**Top Level:**

- Input Layer  | --> | Solution Modules |

- ^                      |
- v

- Build System  | <-- |  Output Handler  |

##### Detailed Component Breakdown

Solution Modules Section:

- Solution Modules    |

- Day 1-17      |  |

- Part A    |   |  |
- Part B    |   |  |

##### Implementation Details to Highlight

- How each solution module (aocXa/b) is an independent binary
- Common input handling pattern across solutions
- Demonstrate the build system's role in managing multiple binaries

##### Additional Elements

- Version control integration point (.gitignore)
- Cargo.toml configuration influence on the system

- The modular nature of the solutions
- The clear separation between input handling and solution logic
- The build system's role in managing multiple binary targets
- The consistent structure across all challenge solutions

Remember to maintain a balance between showing the overall architecture while not getting too granular with individual solution implementations. The focus should be on the system's organization and data flow rather than specific algorithm details.

- How to add new solutions
- Where to place input files
- How the build system manages the project
- The relationship between components

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Input
        InputDir["Input Directory"]
        InputFiles["Challenge Input Files"]
        InputDir --> InputFiles
    end

    subgraph Solutions
        BinDir["Binary Directory"]
        Day1["Day 1 Solutions"]
        Day2["Day 2 Solutions"]
        DayN["Days 3-17..."]
        
        BinDir --> Day1
        BinDir --> Day2
        BinDir --> DayN
        
        subgraph Day1Solutions
            D1A["Part A"]
            D1B["Part B"]
            Day1 --> D1A
            Day1 --> D1B
        end
        
        subgraph Day2Solutions
            D2A["Part A"]
            D2B["Part B"]
            Day2 --> D2A
            Day2 --> D2B
        end
    end

    subgraph BuildSystem
        Cargo["Cargo Package Manager"]
        CargoToml["Cargo.toml"]
        CargoLock["Cargo.lock"]
        GitIgnore[".gitignore"]
        
        Cargo --> CargoToml
        Cargo --> CargoLock
        Cargo --> GitIgnore
    end

    subgraph Documentation
        README["README.md"]
    end

    Input --> Solutions
    Solutions --> BuildSystem
    BuildSystem --> Documentation

    classDef default fill:#f9f9f9,stroke:#333,stroke-width:1px
    classDef input fill:#b3e0ff,stroke:#333
    classDef solution fill:#90EE90,stroke:#333
    classDef build fill:#FFB366,stroke:#333
    classDef doc fill:#E6E6FA,stroke:#333

    class InputDir,InputFiles input
    class BinDir,Day1,Day2,DayN,D1A,D1B,D2A,D2B solution
    class Cargo,CargoToml,CargoLock,GitIgnore build
    class README doc

    click InputDir "https://github.com/danmou/advent-of-code-2024-rust/tree/main/inputs"
    click BinDir "https://github.com/danmou/advent-of-code-2024-rust/tree/main/src/bin"
    click D1A "https://github.com/danmou/advent-of-code-2024-rust/blob/main/src/bin/aoc1a/main.rs"
    click D1B "https://github.com/danmou/advent-of-code-2024-rust/blob/main/src/bin/aoc1b/main.rs"
    click D2A "https://github.com/danmou/advent-of-code-2024-rust/blob/main/src/bin/aoc2a/main.rs"
    click D2B "https://github.com/danmou/advent-of-code-2024-rust/blob/main/src/bin/aoc2b/main.rs"
    click CargoToml "https://github.com/danmou/advent-of-code-2024-rust/blob/main/Cargo.toml"
    click CargoLock "https://github.com/danmou/advent-of-code-2024-rust/blob/main/Cargo.lock"
    click GitIgnore "https://github.com/danmou/advent-of-code-2024-rust/blob/main/.gitignore"
    click README "https://github.com/danmou/advent-of-code-2024-rust/blob/main/README.md"
```
