# lompy/otushw architecture

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

- Interactive diagram: https://gitdiagram.com/lompy/otushw
- Repository: https://github.com/lompy/otushw

## Overview

##### Project type and purpose
- This repository (“otushw”) is a collection of C++ homework exercises organized by lesson number.
- There is no “live” multi-tier application or service: each subdirectory under `cpp-basic` (e.g., `02`, `03`) contains standalone example programs and corresponding CMake build files.

##### File structure
- Top-level:
- `.gitignore`
- `README.md` (project overview)
- `cpp-basic/` (container for course exercises)
- Under `cpp-basic`:
- `02/` and `03/` directories, each with
– `CMakeLists.txt` (build configuration)
– `.cpp` and `.hpp` files (source and header files)
- There are no external services, databases, or tests folders—just code examples and CMake build rules.

##### README for additional insights
- The README simply states this is an Otus homework repository, with each course occupying its own folder.
- No further architectural guidance or external dependencies are documented.

a. Main components
1. Source Code Modules
– Example programs (`example.cpp`, `hello_world.cpp`, etc.)
– Header files (`.hpp`)
2. Build System
– CMake (`CMakeLists.txt`)
3. Build Targets / Executables
– Generated binaries for each exercise
4. Developer Environment (implicit)
– Compiler (e.g., GCC/Clang)
– CMake generator (Makefiles, Ninja, etc.)

b. Relationships and interactions
- CMakeLists.txt reads the source and header files to configure build targets.
- CMake invokes the local compiler toolchain to produce executables.
- Developers run the binaries to verify behavior.

c. Architectural patterns / design principles
- Modular organization by lesson number.
- Clear separation of source (`.cpp`) and interface (`.hpp`).
- Use of a cross-platform build system (CMake).

d. Key technologies / frameworks
- C++17 (or whichever standard is specified in `CMakeLists.txt`)
- CMake (build orchestration)

##### Detailed breakdown
- Top layer: “otushw” root (label it)
- Underneath: two parallel lanes, one for `cpp-basic/02`, one for `cpp-basic/03`
- Inside each lane:
- Central build flow:
- “CMake” → “Build System” → “Compiler/Linker” → “Executable(s)”

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "otushw (root)"
        rootREADME["README.md"]:::config
        rootGitignore[".gitignore"]:::config
    end

    subgraph "Lesson 02 (cpp-basic/02)"
        exampleCPP["example.cpp"]:::code
        exampleHPP["example.hpp"]:::code
        helloCPP["hello_world.cpp"]:::code
        moveCPP["move_me_out.cpp"]:::code
        moveHPP["move_me_out.hpp"]:::code
        CMake02["CMakeLists.txt"]:::config
    end

    subgraph "Lesson 03 (cpp-basic/03)"
        argumentsCPP["arguments.cpp"]:::code
        argumentsHPP["arguments.hpp"]:::code
        guessCPP["guess_the_number.cpp"]:::code
        randCPP["randval.cpp"]:::code
        randHPP["randval.hpp"]:::code
        storageCPP["storage.cpp"]:::code
        storageHPP["storage.hpp"]:::code
        CMake03["CMakeLists.txt"]:::config
    end

    CMake02 -->|"reads modules"| CMake["CMake"]:::process
    exampleCPP --> CMake
    exampleHPP --> CMake
    helloCPP --> CMake
    moveCPP --> CMake
    moveHPP --> CMake

    CMake03 -->|"reads modules"| CMake
    argumentsCPP --> CMake
    argumentsHPP --> CMake
    guessCPP --> CMake
    randCPP --> CMake
    randHPP --> CMake
    storageCPP --> CMake
    storageHPP --> CMake

    CMake -->|"generate build files"| BuildSystem["Build System"]:::process
    BuildSystem -->|"invoke compiler"| Compiler["Compiler/Linker"]:::process
    Compiler -->|"produce binaries"| Exec02["Lesson02 Executable"]:::output
    Compiler -->|"produce binaries"| Exec03["Lesson03 Executable"]:::output

    click rootREADME "https://github.com/lompy/otushw/blob/main/README.md"
    click rootGitignore "https://github.com/lompy/otushw/blob/main/.gitignore"
    click CMake02 "https://github.com/lompy/otushw/blob/main/cpp-basic/02/CMakeLists.txt"
    click CMake03 "https://github.com/lompy/otushw/blob/main/cpp-basic/03/CMakeLists.txt"
    click exampleCPP "https://github.com/lompy/otushw/blob/main/cpp-basic/02/example.cpp"
    click exampleHPP "https://github.com/lompy/otushw/blob/main/cpp-basic/02/example.hpp"
    click helloCPP "https://github.com/lompy/otushw/blob/main/cpp-basic/02/hello_world.cpp"
    click moveCPP "https://github.com/lompy/otushw/blob/main/cpp-basic/02/move_me_out.cpp"
    click moveHPP "https://github.com/lompy/otushw/blob/main/cpp-basic/02/move_me_out.hpp"
    click argumentsCPP "https://github.com/lompy/otushw/blob/main/cpp-basic/03/arguments.cpp"
    click argumentsHPP "https://github.com/lompy/otushw/blob/main/cpp-basic/03/arguments.hpp"
    click guessCPP "https://github.com/lompy/otushw/blob/main/cpp-basic/03/guess_the_number.cpp"
    click randCPP "https://github.com/lompy/otushw/blob/main/cpp-basic/03/randval.cpp"
    click randHPP "https://github.com/lompy/otushw/blob/main/cpp-basic/03/randval.hpp"
    click storageCPP "https://github.com/lompy/otushw/blob/main/cpp-basic/03/storage.cpp"
    click storageHPP "https://github.com/lompy/otushw/blob/main/cpp-basic/03/storage.hpp"

    classDef code fill:#ADD8E6,stroke:#000,color:#000
    classDef config fill:#FFA500,stroke:#000,color:#000
    classDef process fill:#f9f,stroke:#000,color:#000
    classDef output fill:#90EE90,stroke:#000,color:#000
```
