# recck/advent2022 architecture

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

## Overview

##### Main Components

a. Entry Point Layer:
- Cmd/main.go as the application entry point
- Command-line argument handling for puzzle number and input file path

b. Puzzle Interface Layer:
- Internal/puzzles/puzzle.go as the core interface/contract
- This likely defines the common behavior for all puzzle solutions

c. Implementation Layer:
- Collection of day1.go through day11.go puzzle implementations
- As concrete implementations of the puzzle interface

##### Component Relationships

- Use a top-down hierarchical structure:
- Command Layer (main.go) at the top
- Puzzle Interface in the middle
- Individual Puzzle Implementations at the bottom

##### Additional Details

- Command-line interface pattern: "go run cmd/main.go [puzzle number] [input file path]"

##### Key Architectural Patterns to Highlight

- Interface-based design pattern
- Command-line application structure
- Separation of concerns (cmd vs internal packages)
- Plugin-like architecture for puzzle solutions

##### How individual puzzles implement the solution logic

Remember to include a title: "Advent of Code 2022 - Solution Architecture" and any necessary notes about the Go module structure or build requirements.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Title
    title[Advent of Code 2022 - Solution Architecture]
    style title fill:none,stroke:none

    %% Main Components
    EntryPoint["Main Entry Point<br/>(Command Line Interface)"]:::entry
    click EntryPoint "https://github.com/recck/advent2022/blob/main/cmd/main.go"
    
    PuzzleInterface(("Puzzle Interface<br/>(Core Contract)")):::interface
    click PuzzleInterface "https://github.com/recck/advent2022/blob/main/internal/puzzles/puzzle.go"
    
    InputFile[("Input File<br/>(Puzzle Input)")]:::file
    
    %% Implementation Layer
    subgraph Implementations["Puzzle Implementations"]
        Day1["Day 1"]:::implementation
        Day2["Day 2"]:::implementation
        Day3["Day 3"]:::implementation
        Day4["Day 4"]:::implementation
        Day5["Day 5"]:::implementation
        Day6["Day 6"]:::implementation
        Day7["Day 7"]:::implementation
        Day8["Day 8"]:::implementation
        Day9["Day 9"]:::implementation
        Day10["Day 10"]:::implementation
        Day11["Day 11"]:::implementation
    end
    
    click Day1 "https://github.com/recck/advent2022/blob/main/internal/puzzles/day1.go"
    click Day2 "https://github.com/recck/advent2022/blob/main/internal/puzzles/day2.go"
    click Day3 "https://github.com/recck/advent2022/blob/main/internal/puzzles/day3.go"
    click Day4 "https://github.com/recck/advent2022/blob/main/internal/puzzles/day4.go"
    click Day5 "https://github.com/recck/advent2022/blob/main/internal/puzzles/day5.go"
    click Day6 "https://github.com/recck/advent2022/blob/main/internal/puzzles/day6.go"
    click Day7 "https://github.com/recck/advent2022/blob/main/internal/puzzles/day7.go"
    click Day8 "https://github.com/recck/advent2022/blob/main/internal/puzzles/day8.go"
    click Day9 "https://github.com/recck/advent2022/blob/main/internal/puzzles/day9.go"
    click Day10 "https://github.com/recck/advent2022/blob/main/internal/puzzles/day10.go"
    click Day11 "https://github.com/recck/advent2022/blob/main/internal/puzzles/day11.go"

    %% Relationships
    EntryPoint --> PuzzleInterface
    EntryPoint --> InputFile
    Day1 --> PuzzleInterface
    Day2 --> PuzzleInterface
    Day3 --> PuzzleInterface
    Day4 --> PuzzleInterface
    Day5 --> PuzzleInterface
    Day6 --> PuzzleInterface
    Day7 --> PuzzleInterface
    Day8 --> PuzzleInterface
    Day9 --> PuzzleInterface
    Day10 --> PuzzleInterface
    Day11 --> PuzzleInterface

    %% Styles
    classDef entry fill:#4a90e2,stroke:#2171c7,color:white
    classDef interface fill:#50c878,stroke:#2e8b57,color:white
    classDef implementation fill:#ffd700,stroke:#daa520,color:black
    classDef file fill:#a9a9a9,stroke:#696969,color:white

    %% Legend
    subgraph Legend
        L1["Entry Point"]:::entry
        L2(("Interface")):::interface
        L3["Implementation"]:::implementation
        L4[("File")]:::file
    end
```
