# tmcg/adventofcode2023 architecture

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

- Interactive diagram: https://gitdiagram.com/tmcg/adventofcode2023
- Repository: https://github.com/tmcg/adventofcode2023

## Overview

##### Main Components

a) Project Structure Layer
- Root Project Container
- Daily Challenge Modules (day-01 through day-10)
- Shared Library Module
- Template Generation System

b) Build and Development Layer
- Cargo Build System
- Just Command Runner
- Cargo Generate Template System

**┌─ Project Architecture ─────────────────────────────────────┐**

- ┌─ Development Tools ─┐    ┌─ Template System ─┐        │
- Just Commands     │    │ - Template Dir    │        │
- Cargo Build      │    │ - Cargo Generate  │        │
- ┘        │
- ↓                    │
- ┌─ Challenge Modules ──────────────────────────┐       │

- ┌─ Day-XX Module ─┐  ┌─ Shared Library ─┐  │       │
- Source Code   │  │ - Common Code    │  │       │
- Input Files   │←─│ - Utilities      │  │       │
- Problem Desc  │  └────────────────┘  │       │
- ┘          ↑           │       │
- ↑                    │           │       │
- ┌─ Day-XX Module ─┐         │           │       │
- Source Code   │─────────┘           │       │
- Input Files   │                     │       │
- Problem Desc  │                     │       │
- ┘                     │       │
- ┘       │
- ┘

##### Key Elements to Highlight

a) Module Independence:
- Each day module is independent
- All days share common structure
- Shared library provides common functionality

b) Development Workflow:
- Template-based generation of new days
- Standardized testing and running procedures
- Consistent project structure

##### Important Relationships

- Template System → Day Modules (generation)
- Shared Library → Day Modules (dependency)
- Just Commands → All Modules (execution)
- Cargo Build → All Modules (compilation)

##### Additional Notes

- The modular nature of the challenge solutions
- The automation tools for development
- The standardized structure across all days
- The role of shared components

- Component types
- Command relationships

- How to add new challenge solutions
- Where to find common functionality
- How the build and test system works
- The overall project organization

The level of detail should be sufficient to understand the project structure while avoiding implementation-specific details of individual challenge solutions.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Project["Project Architecture"]
        subgraph DevTools["Development Tools"]
            Just["Just Commands"]:::devtool
            Cargo["Cargo Build"]:::devtool
        end

        subgraph TemplateSystem["Template System"]
            TemplateDir["Template Directory"]:::template
            CargoGen["Cargo Generate"]:::template
            TemplateConfig["Template Config"]:::template
            TemplateSource["Template Source"]:::template
        end

        subgraph Challenges["Challenge Modules"]
            subgraph DayModule1["Day Module Example 1"]
                Source1["Source Code"]:::module
                Input1["Input Files"]:::module
                Desc1["Problem Description"]:::module
            end

            subgraph DayModule2["Day Module Example 2"]
                Source2["Source Code"]:::module
                Input2["Input Files"]:::module
                Desc2["Problem Description"]:::module
            end

            SharedLib["Shared Library"]:::shared
        end

        %% Relationships
        TemplateDir --> DayModule1
        TemplateDir --> DayModule2
        CargoGen --> TemplateDir
        TemplateConfig --> CargoGen
        TemplateSource --> TemplateDir
        
        SharedLib --> DayModule1
        SharedLib --> DayModule2
        
        Just --> Challenges
        Cargo --> Challenges

    end

    %% Styling
    classDef devtool fill:#3498db,stroke:#2980b9,color:white
    classDef template fill:#e67e22,stroke:#d35400,color:white
    classDef module fill:#2ecc71,stroke:#27ae60,color:white
    classDef shared fill:#f1c40f,stroke:#f39c12,color:black

    %% Click events
    click Just "https://github.com/tmcg/AdventOfCode2023/tree/main/justfile"
    click Cargo "https://github.com/tmcg/AdventOfCode2023/blob/main/Cargo.toml"
    click TemplateDir "https://github.com/tmcg/AdventOfCode2023/tree/main/template/"
    click TemplateConfig "https://github.com/tmcg/AdventOfCode2023/blob/main/template/cargo-generate.toml"
    click TemplateSource "https://github.com/tmcg/AdventOfCode2023/blob/main/template/src/main.rs"
    click Source1 "https://github.com/tmcg/AdventOfCode2023/blob/main/day-01/src/main.rs"
    click Input1 "https://github.com/tmcg/AdventOfCode2023/blob/main/day-01/input*.txt"
    click Desc1 "https://github.com/tmcg/AdventOfCode2023/blob/main/day-01/problem.txt"
    click Source2 "https://github.com/tmcg/AdventOfCode2023/blob/main/day-02/src/main.rs"
    click Input2 "https://github.com/tmcg/AdventOfCode2023/blob/main/day-02/input*.txt"
    click Desc2 "https://github.com/tmcg/AdventOfCode2023/blob/main/day-02/problem.txt"
    click SharedLib "https://github.com/tmcg/AdventOfCode2023/tree/main/shared/"
```
