# daveagill/aoc2024 architecture

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

- Interactive diagram: https://gitdiagram.com/daveagill/aoc2024
- Repository: https://github.com/daveagill/aoc2024

## Overview

##### Main Components Organization

a) Runtime Environment Layer
- TypeScript compiler representation
- Permissions (--allow-read) configuration

b) Project Structure Layer
- Helpers.ts utility module connection

##### Day Module Pattern (repeat for each day)
- Input Handler (data.txt, example.txt)
- Solution Components (part1.ts, part2.ts)
- Test Runner (test.ts)

- Blue: Runtime components
- Green: Solution modules
- Yellow: Test components
- Gray: Input/data files
- Purple: Utility/helper components

##### Data Flow Representation

- File system read operations (data.txt → solution)
- Test execution flow (test.ts → part1/part2)
- Helper utility usage (helpers.ts → day modules)

##### Specific Elements

**┌─ Core Infrastructure ─────┐**
- Deno Runtime           │
- TypeScript Compiler    │
- File System Access     │
- ┘

b) Day Module Template:
**┌─ Day N ─────────────────┐**
- ┌─ Input ─┐ ┌─ Logic ─┐ │
- data    │ │ part1   │ │
- example │ │ part2   │ │
- ┘ └─────────┘ │
- ┌─ Tests ─────────────┐ │
- test.ts        │ │
- ┘ │
- ┘

##### Integration Points

How the following integrate:
- deno.json configuration
- helpers.ts utility functions
- test runner system

##### Execution Flow

Two main execution paths:
##### Single Solution Mode: `deno task dNpM`

Key Considerations:

##### Maintain Consistency
- Keep module representations uniform
- Apply consistent naming conventions

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Runtime
        DR["Deno Runtime"]
        TS["TypeScript Compiler"]
        FA["File System Access"]
        DR --> TS
        DR --> FA
    end

    subgraph Core
        RC["Runtime Config"]:::config
        HU["Helper Utilities"]:::helper
        IC["IDE Config"]:::config
        DOC["Documentation"]:::doc
    end

    subgraph "Day Module Pattern"
        DM["Day Module"]
        subgraph "Input Files"
            DF["data.txt"]:::data
            EF["example.txt"]:::data
        end
        subgraph "Solution Files"
            P1["part1.ts"]:::solution
            P2["part2.ts"]:::solution
        end
        subgraph "Test Files"
            TF["test.ts"]:::test
        end
        DF --> P1
        DF --> P2
        EF --> TF
        TF --> P1
        TF --> P2
    end

    HU --> DM
    DR --> DM

    subgraph "Special Cases"
        D3["Day 3"]:::day
        D16["Day 16"]:::day
        D17["Day 17"]:::day
    end

    classDef runtime fill:#b3d9ff,stroke:#333
    classDef config fill:#f9f9f9,stroke:#333
    classDef helper fill:#e6b3ff,stroke:#333
    classDef doc fill:#f2f2f2,stroke:#333
    classDef data fill:#d9d9d9,stroke:#333
    classDef solution fill:#99ff99,stroke:#333
    classDef test fill:#ffff99,stroke:#333
    classDef day fill:#ffb366,stroke:#333

    click HU "https://github.com/daveagill/aoc2024/blob/main/helpers.ts"
    click RC "https://github.com/daveagill/aoc2024/blob/main/deno.json"
    click IC "https://github.com/daveagill/aoc2024/blob/main/.vscode"
    click DOC "https://github.com/daveagill/aoc2024/blob/main/README.md"
    click D3 "https://github.com/daveagill/aoc2024/tree/main/day3"
    click D16 "https://github.com/daveagill/aoc2024/tree/main/day16"
    click D17 "https://github.com/daveagill/aoc2024/tree/main/day17"
    click DF "https://github.com/daveagill/aoc2024/blob/main/day1/data.txt"
    click EF "https://github.com/daveagill/aoc2024/blob/main/day1/example.txt"
    click P1 "https://github.com/daveagill/aoc2024/blob/main/day1/part1.ts"
    click P2 "https://github.com/daveagill/aoc2024/blob/main/day1/part2.ts"
    click TF "https://github.com/daveagill/aoc2024/blob/main/day1/test.ts"
```
