# sendao/aoc architecture

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

- Interactive diagram: https://gitdiagram.com/sendao/aoc
- Repository: https://github.com/sendao/aoc

## Overview

Based on our analysis of the file tree and the brief README (“# AoC”), it’s clear that this repository is structured as a collection of individual puzzle solutions – most likely for an Advent of Code challenge. Each numbered directory (e.g., “1”, “10”, “11”, … “25”) contains its own set of files such as a JavaScript solution (dayX.js), an input file (data.txt), and additional files when needed (demo.txt, drawing.txt, test.txt, output.txt, etc.). There’s also a separate “pirates” directory that appears to be a standalone module (with its pirates.js and pirates.txt) indicating an extra puzzle or variant.

##### Main Components
- AoC Project Root – The central container for all puzzles.
- Daily Challenge Modules – Each numbered directory (1, 2, 3, …, 25) represents an independent module. Each module typically contains:
- The solution code (dayX.js)
- Input data (data.txt)
- Optional demo, test, or output files which can be depicted as subcomponents.
- Bonus/Extra Module – The “pirates” directory which, although similar in structure, is a distinct module.
- Environment/Runtime – Since these are JavaScript files, it implies a Node.js environment execution.

##### Relationships and Interactions
- Each Daily Challenge Module works autonomously: It reads its own “data.txt” and any demo files, processes the logic in its “dayX.js” file, and may produce outputs or logs.
- There is no direct coupling between the modules. The architecture is highly modular and each module is independent.
- The “pirates” module can be represented similarly but isolated from the regular day modules, showing its special role or extra functionality.

##### Architectural Patterns and Technologies
- Modularity: Each challenge lives in its own namespace (folder) and functions as a loosely coupled module.
- Use of JavaScript (likely Node.js since there are .js files and no modern front-end frameworks or build tools).

## Diagram (Mermaid)

```mermaid
flowchart TD
    AOCProject["AoC Project Root"]:::container
    AOCProject -->|"contains"| day1Data
    AOCProject -->|"contains"| day10Data
    AOCProject -->|"contains"| day25Data
    AOCProject -->|"contains"| pirateData

    subgraph "Daily Challenge Modules"
        subgraph "Day 1 Module"
            day1Data["Input Data (data.txt)"]:::data
            day1Sol["Solution (day1.js)"]:::code
            day1Data -->|"processed_by"| day1Sol
        end

        subgraph "Day 10 Module"
            day10Data["Input Data (data.txt)"]:::data
            day10Sol["Solution (day10.js)"]:::code
            day10Demo["Demo/Output (demo.txt)"]:::demo
            day10Data -->|"processed_by"| day10Sol
            day10Sol -->|"produces"| day10Demo
        end

        subgraph "Day 25 Module"
            day25Data["Input Data (data.txt)"]:::data
            day25Sol["Solution (day25.js)"]:::code
            day25Demo["Demo/Output (demo.txt)"]:::demo
            day25Data -->|"processed_by"| day25Sol
            day25Sol -->|"produces"| day25Demo
        end
    end

    subgraph "Bonus Module: Pirates"
        pirateData["Input/Config (pirates.txt)"]:::data
        pirateSol["Solution (pirates.js)"]:::code
        pirateData -->|"processed_by"| pirateSol
    end

click AOCProject "https://github.com/sendao/aoc/blob/main/README.md"
click day1Sol "https://github.com/sendao/aoc/blob/main/1/day1.js"
click day1Data "https://github.com/sendao/aoc/blob/main/1/data.txt"
click day10Sol "https://github.com/sendao/aoc/blob/main/10/day10.js"
click day10Data "https://github.com/sendao/aoc/blob/main/10/data.txt"
click day10Demo "https://github.com/sendao/aoc/blob/main/10/demo.txt"
click day25Sol "https://github.com/sendao/aoc/blob/main/25/day25.js"
click day25Data "https://github.com/sendao/aoc/blob/main/25/data.txt"
click day25Demo "https://github.com/sendao/aoc/blob/main/25/demo.txt"
click pirateSol "https://github.com/sendao/aoc/blob/main/pirates/pirates.js"
click pirateData "https://github.com/sendao/aoc/blob/main/pirates/pirates.txt"

classDef code fill:#ADD8E6,stroke:#000,color:#000;
classDef data fill:#90EE90,stroke:#000,color:#000;
classDef demo fill:#FFA500,stroke:#000,color:#000;
classDef container fill:#D3D3D3,stroke:#000,color:#000;
```
