# burntsushi/advent-of-code architecture

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

- Interactive diagram: https://gitdiagram.com/burntsushi/advent-of-code
- Repository: https://github.com/burntsushi/advent-of-code

## Overview

##### Project type and purpose
- This is an open-source collection of small, independent CLI applications—one per Advent of Code puzzle day—written in Rust.
- Its goal is to provide idiomatic, panic-free Rust solutions for each puzzle; each directory (aoc01…aoc25) is a standalone Cargo crate that reads an input file, computes answers, and prints results.

##### File structure
- Top-level:
- .gitignore, LICENSE, README.md
- `aoc01/ … aoc25/`: 25 independent crates
- `setup-day` script (presumably a helper for bootstrapping new puzzle directories)
- Within each `aocNN/`:
- Cargo.toml & Cargo.lock (crate metadata & lockfile)
- `src/main.rs` (entry point implementing parsing & solving logic)
- `input/` folder containing `input.txt` and optional `test*.txt` files
- No shared libraries or services—every day is isolated and self-contained.

##### README for additional insights
- Confirms the use of Cargo and Rust’s standard tooling: to run, you `cd` into a crate and invoke `cargo run --release < input/input.txt`.
- No mention of external services, databases, or network I/O—pure CPU-bound puzzle solvers.
- Encourages issues for questions, implying a typical open-source support model.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Actors and Tools
    Developer["Developer"]:::actor
    Developer -->|"uses"| Setup
    Developer -->|"invokes"| CargoTool

    %% Tooling
    Setup["setup-day Script"]:::tool
    CargoTool["Rust/Cargo Toolchain"]:::tool

    %% Monorepo Root
    Setup -->|"bootstraps new day"| Monorepo
    Monorepo["Monorepo Root"]:::root
    CargoTool -->|"builds & runs"| CratePattern

    %% Crate Pattern Subgraph
    subgraph "aocNN Crate (days 1–25)"
        direction TB
        CrateDir["aocNN/"]:::crate
        CrateDir --> CargoMeta
        CrateDir --> Main
        CrateDir --> InputFiles
        CargoMeta["Cargo Metadata"]:::metadata
        CargoMeta --> Toml
        CargoMeta --> Lock
        Toml["Cargo.toml"]:::metadata
        Lock["Cargo.lock"]:::metadata
        Main["src/main.rs\n(Parser & Solver)"]:::code
        InputFiles["input/*.txt"]:::data
        InputFiles --> Parser
        Parser["Parser/Solver"]:::process
        Parser --> Stdout
        Stdout["stdout (output)"]:::output
    end

    Monorepo -->|“contains”| CrateDir

    %% Click Events
    click Monorepo "https://github.com/burntsushi/advent-of-code/tree/master/./"
    click Setup "https://github.com/burntsushi/advent-of-code/tree/master/./setup-day"
    click CrateDir "https://github.com/burntsushi/advent-of-code/tree/master/./aocNN/"
    click Toml "https://github.com/burntsushi/advent-of-code/blob/master/./aocNN/Cargo.toml"
    click Lock "https://github.com/burntsushi/advent-of-code/blob/master/./aocNN/Cargo.lock"
    click Main "https://github.com/burntsushi/advent-of-code/blob/master/./aocNN/src/main.rs"
    click InputFiles "https://github.com/burntsushi/advent-of-code/blob/master/./aocNN/input/input.txt"

    %% Styling
    classDef actor fill:#FFD580,stroke:#E59400,stroke-width:2px
    classDef tool fill:#C0C0C0,stroke:#808080,stroke-width:2px
    classDef root fill:#E0F7FA,stroke:#00796B,stroke-width:2px
    classDef crate fill:#E8F5E9,stroke:#2E7D32,stroke-width:2px
    classDef metadata fill:#FFF3E0,stroke:#EF6C00,stroke-width:2px
    classDef code fill:#EDE7F6,stroke:#5E35B1,stroke-width:2px
    classDef data fill:#FFEBEE,stroke:#C62828,stroke-width:2px
    classDef process fill:#F3E5F5,stroke:#8E24AA,stroke-width:2px
    classDef output fill:#E1F5FE,stroke:#039BE5,stroke-width:2px
```
