# ismtabo/advent-of-code-2022 architecture

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

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

## Overview

##### Main Components Identification

a) Web Application (Frontend)
- Located in /src/app
- React-based interface
- Components for calendar, day selection, and visualization

b) CLI Tool
- Located in /src/cli
- Handles day solution management and execution
- Input file downloading capabilities

c) Solutions Module
- Located in /src/solutions
- Contains individual day solutions
- Structured with part one and part two for each day

##### Component Relationships and Architecture

**[Web Application Layer]**

- React Components
- Static Assets
- Hooks & Utils

**[CLI Tool Layer]**

- Command Handlers
- Templates
- Utils

**[Solutions Layer]**

- Day Solutions
- Input/Sample Files
- Solution Types

##### Data Flow Indicators

- CLI tool interaction with Solutions
- Web App interaction with Solutions
- External data flow (input file downloads)
- Configuration management

##### Technical Details to Highlight

- Deno as the runtime platform
- React for frontend
- TypeScript throughout
- File system interactions
- CLI command structure
- Solution execution flow

##### External Dependencies

Connections to:
- Advent of Code API (for input downloads)
- Deno standard library
- React ecosystem
- Cliffy CLI framework

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Web Application"
        FE[Frontend Entry]
        RC[React Components]
        SA[Static Assets]
        HU[Hooks & Utils]
        
        subgraph "React Components"
            CAL[Calendar]
            DS[Day Selector]
            DV[Day View]
            WC[Welcome]
        end
        
        subgraph "React Dependencies"
            RCore[React Core]
            RDOM[React DOM]
            RRouter[React Router]
        end
        
        FE --> RC
        FE --> SA
        FE --> HU
        RC --> CAL & DS & DV & WC
        RC --> RCore & RDOM & RRouter
    end
    
    subgraph "CLI Tool"
        CLI[CLI Entry]
        CH[Command Handlers]
        TEMP[Templates]
        CUTIL[Utils]
        
        subgraph "Commands"
            CREATE[Create Command]
            DOWN[Download Command]
            RUN[Run Command]
        end
        
        CLI --> CH
        CLI --> TEMP
        CLI --> CUTIL
        CH --> CREATE & DOWN & RUN
    end
    
    subgraph "Solutions Module"
        SM[Solutions Entry]
        DS1[Day Solutions]
        IF[Input Files]
        ST[Solution Types]
        
        subgraph "Solution Structure"
            INPUT["Input Files"]
            SAMPLE["Sample Files"]
            TYPES["Type Definitions"]
        end
        
        SM --> DS1
        SM --> IF
        SM --> ST
        IF --> INPUT & SAMPLE
        ST --> TYPES
    end
    
    CH --> SM
    FE --> SM
    
    %% Click events for component mapping
    click FE "https://github.com/ismtabo/advent-of-code-2022/blob/main/src/app/App.tsx"
    click SA "https://github.com/ismtabo/advent-of-code-2022/tree/main/src/app/static"
    click HU "https://github.com/ismtabo/advent-of-code-2022/tree/main/src/app/hooks"
    click RC "https://github.com/ismtabo/advent-of-code-2022/tree/main/src/app/components"
    click CAL "https://github.com/ismtabo/advent-of-code-2022/blob/main/src/app/components/Calendar.tsx"
    click DS "https://github.com/ismtabo/advent-of-code-2022/blob/main/src/app/components/DaySelector.tsx"
    click DV "https://github.com/ismtabo/advent-of-code-2022/blob/main/src/app/components/Day.tsx"
    click WC "https://github.com/ismtabo/advent-of-code-2022/blob/main/src/app/components/Welcome.tsx"
    click RCore "https://github.com/ismtabo/advent-of-code-2022/blob/main/src/app/deps/react.ts"
    click RDOM "https://github.com/ismtabo/advent-of-code-2022/blob/main/src/app/deps/react-dom.ts"
    click RRouter "https://github.com/ismtabo/advent-of-code-2022/blob/main/src/app/deps/react-router-dom.ts"
    click CLI "https://github.com/ismtabo/advent-of-code-2022/blob/main/src/cli/mod.ts"
    click CREATE "https://github.com/ismtabo/advent-of-code-2022/blob/main/src/cli/create.ts"
    click DOWN "https://github.com/ismtabo/advent-of-code-2022/blob/main/src/cli/download.ts"
    click RUN "https://github.com/ismtabo/advent-of-code-2022/blob/main/src/cli/run.ts"
    click TEMP "https://github.com/ismtabo/advent-of-code-2022/tree/main/src/cli/templates"
    click CUTIL "https://github.com/ismtabo/advent-of-code-2022/blob/main/src/cli/utils.ts"
    click SM "https://github.com/ismtabo/advent-of-code-2022/blob/main/src/solutions/mod.ts"
    click DS1 "https://github.com/ismtabo/advent-of-code-2022/tree/main/src/solutions/day{1-25}"
    click TYPES "https://github.com/ismtabo/advent-of-code-2022/blob/main/src/solutions/day11/types.d.ts"
    click INPUT "https://github.com/ismtabo/advent-of-code-2022/blob/main/src/solutions/day*/input.txt"
    click SAMPLE "https://github.com/ismtabo/advent-of-code-2022/blob/main/src/solutions/day*/sample.txt"
    
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef cli fill:#2ecc71,stroke:#27ae60,color:white
    classDef solutions fill:#e67e22,stroke:#d35400,color:white
    
    class FE,RC,SA,HU,CAL,DS,DV,WC,RCore,RDOM,RRouter frontend
    class CLI,CH,TEMP,CUTIL,CREATE,DOWN,RUN cli
    class SM,DS1,IF,ST,INPUT,SAMPLE,TYPES solutions
```
