# princek0/learning-cpp architecture

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

- Interactive diagram: https://gitdiagram.com/princek0/learning-cpp
- Repository: https://github.com/princek0/learning-cpp

## Overview

##### Project type and purpose
- This is not a service or full‑stack app but a **code‑sample repository** (“Learning-CPP”) containing:
- A simple “Hello World” program
- Solutions to competitive/programming‑challenge problems from CSES, LeetCode, Project Euler
- Its goal is to organize and version these C++ examples, not to run as a unified system.

##### File structure
- Top‑level:
- Other/ — misc or demo code (HelloWorld.cpp)
- Problems/ — all challenge solutions, further grouped
- README.md — repo description
- Under Problems/:
- .vscode/ — IDE launch and build configs
- CSES/ — subfolder “Introductory Problems” with .cpp and compiled .exe
- Leetcode/ — individual .cpp files
- Project Euler/ — .cpp, .exe and .vscode config
- Each .cpp is compiled (e.g., via g++ or VS) into a .exe.

##### README for additional insights
- Confirms: “Random C++ projects/solutions to problems/implementations.”
- No runtime or server components—just source → compile → binary.

a. Main components
1. Developer Environment
- Editor/IDE (.vscode)
- C++ Compiler Toolchain (g++, clang++, MSVC)
2. Source Tree
- Other Module (HelloWorld)
- Problems Module
- CSES
- LeetCode
- Project Euler
3. Build Artifacts
- Executable binaries (.exe)
b. Relationships and data flow
- Dev edits .cpp in VS Code → invokes compiler → outputs .exe
- Organizing folders group by source domain (CSES, etc.)
c. Architectural patterns / principles
- **Separation of concerns** by problem category
- **Convention over configuration**: each problem’s naming is self‑descriptive
- Minimal “build pipeline” per folder (via .vscode tasks)
d. Relevant technologies
- C++17/20 standard
- VS Code tasks and launch configurations
- g++ / MSVC command‑line arguments

## Diagram (Mermaid)

```mermaid
graph TB
    %% Developer Environment
    subgraph "Developer Environment"
        DevEnv["VS Code + C++ Toolchain"]:::env
        VSConfigGeneral[".vscode (Tasks Config)"]:::config
        VSConfigPE[".vscode (Project Euler Config)"]:::config
    end

    %% Source Modules
    Other["Other\nHelloWorld.cpp"]:::src
    subgraph "Problems"
        CSES["CSES\nIntroductory Problems"]:::src
        LeetCode["LeetCode\n412 Fizz Buzz.cpp"]:::src
        PE["Project Euler\n1.cpp"]:::src
    end

    %% Binaries
    HelloExe["HelloWorld.exe"]:::bin
    MNExe["Missing Number 1083.exe"]:::bin
    WAExe["Weird Algorithm 1068.exe"]:::bin
    LEExe["412 Fizz Buzz.exe"]:::bin
    PEExe["1.exe"]:::bin

    %% Repository Description
    README["README.md"]:::doc

    %% Connections: editing
    DevEnv -->|"open/edit"| Other
    DevEnv -->|"open/edit"| CSES
    DevEnv -->|"open/edit"| LeetCode
    DevEnv -->|"open/edit"| PE

    %% Connections: config
    VSConfigGeneral -->|applies to| CSES
    VSConfigGeneral -->|applies to| LeetCode
    VSConfigGeneral -->|applies to| Other
    VSConfigPE -->|applies to| PE

    %% Connections: compile to binaries
    Other -->|"compile"| HelloExe
    CSES -->|"compile"| MNExe
    CSES -->|"compile"| WAExe
    LeetCode -->|"compile"| LEExe
    PE -->|"compile"| PEExe

    %% Repository description link
    DevEnv -->|"views"| README

    %% Click Events
    click VSConfigGeneral "https://github.com/princek0/learning-cpp/blob/main/Problems/.vscode"
    click VSConfigPE "https://github.com/princek0/learning-cpp/blob/main/Problems/Project Euler/.vscode"
    click Other "https://github.com/princek0/learning-cpp/blob/main/Other/HelloWorld.cpp"
    click CSES "https://github.com/princek0/learning-cpp/tree/main/Problems/CSES/Introductory Problems/"
    click LeetCode "https://github.com/princek0/learning-cpp/blob/main/Problems/Leetcode/412 Fizz Buzz.cpp"
    click PE "https://github.com/princek0/learning-cpp/blob/main/Problems/Project Euler/1.cpp"
    click README "https://github.com/princek0/learning-cpp/blob/main/README.md"

    %% Styles
    classDef src fill:#AED6F1,stroke:#1F618D,stroke-width:1px
    classDef bin fill:#A9DFBF,stroke:#196F3D,stroke-width:1px
    classDef config fill:#F9E79F,stroke:#B7950B,stroke-width:1px
    classDef env fill:#D5DBDB,stroke:#626567,stroke-width:1px
    classDef doc fill:#F2D7D5,stroke:#943126,stroke-width:1px
```
