# janayasserfawzi/cs2-textutility-youssef_jana architecture

> Architecture diagram of the GitHub repository janayasserfawzi/cs2-textutility-youssef_jana, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/janayasserfawzi/cs2-textutility-youssef_jana
- Repository: https://github.com/janayasserfawzi/cs2-textutility-youssef_jana

## Overview

##### Project type and purpose
- This is a native C++ text‐processing library (CS2-TextUtility) with a small driver (`main.cpp`) to demonstrate/verify functionality. It is neither a multi-tier web app nor a service mesh; it’s a monolithic CLI tool/static library implementing basic string operations on C-style char arrays.

##### File structure
- Top level:
- CMakeLists.txt – build description
- main.cpp – executable entrypoint (CLI)
- text_utility_jana.{h,cpp}, text_utility_youssef.{h,cpp} – two sets of equivalent implementations of core functions
- builder/ – auto-generated CMake build artifacts (object files, link scripts, generated `my_program` executable)
- No external services, no network or DB layers, no MVC folders.

##### README
- Confirms library scope and lists ten core functions: word_count, char_count, count_vowels_consonants, reverse_string, is_palindrome, to_uppercase, to_lowercase, count_substring, caesar_encryption, caesar_decryption.
- No runtime dependencies beyond the C++ standard library.

##### Main components
a. User/CLI Interface
- Represents command‐line input parsing in `main.cpp`.
b. Core Library Module
- Two parallel implementation modules:
- TextUtilityJana
- TextUtilityYoussef
- Each module exposes the same public API (the ten functions).
c. Function Groupings
- Word operations (word_count, count_substring)
- Character operations (char_count, count_vowels_consonants, case conversions)
- String transformations (reverse_string, palindrome check, Caesar cipher)
d. Build System
- CMake orchestrates source compilation, linking into `my_program` (or a static library, if refactored).

##### Relationships and interactions
- Within each module, group the ten functions by category, showing internal call flow if any (e.g., Caesar encryption & decryption share helper logic).

##### Design patterns & principles
- Single Responsibility: each function does one text operation.
- Modular implementation: two interchangeable modules demonstrating polymorphism potential (can swap out one implementation).
- Layer separation: CLI layer vs. library layer vs. build layer.

##### Technologies & frameworks
- C++17 (or C++ standard per CMakeLists)
- CMake 3.28
- Standard Library only (no external dependencies)

##### Essential details to capture
- All ten core functions grouped by purpose
- Separation of concerns (CLI vs. processing library vs. build pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User CLI Interface
    U["User / CLI Interface"]:::runtime
    Main["main.cpp"]:::runtime

    U -->|"provides args"| Main

    subgraph "TextUtilityJana Module"
        direction TB
        TJ1["word_count()"]:::library
        TJ2["count_substring()"]:::library
        TJ3["char_count()"]:::library
        TJ4["count_vowels_consonants()"]:::library
        TJ5["to_uppercase()"]:::library
        TJ6["to_lowercase()"]:::library
        TJ7["reverse_string()"]:::library
        TJ8["is_palindrome()"]:::library
        TJ9["caesar_encryption()"]:::library
        TJ10["caesar_decryption()"]:::library
    end

    subgraph "TextUtilityYoussef Module"
        direction TB
        TY1["word_count()"]:::library
        TY2["count_substring()"]:::library
        TY3["char_count()"]:::library
        TY4["count_vowels_consonants()"]:::library
        TY5["to_uppercase()"]:::library
        TY6["to_lowercase()"]:::library
        TY7["reverse_string()"]:::library
        TY8["is_palindrome()"]:::library
        TY9["caesar_encryption()"]:::library
        TY10["caesar_decryption()"]:::library
    end

    Main -->|"calls functions"| TJ1
    Main -->|"calls functions"| TY1

    subgraph "CMake Build System"
        direction TB
        CMake["CMakeLists.txt"]:::build
        src1["text_utility_jana.cpp"]:::build
        src2["text_utility_youssef.cpp"]:::build
        src3["main.cpp"]:::build
        H1["text_utility_jana.h"]:::build
        H2["text_utility_youssef.h"]:::build
        builder["builder/"]:::artifact
        exe["my_program (executable)"]:::artifact

        CMake -->|configure| src1
        CMake -->|configure| src2
        CMake -->|configure| src3
        CMake -->|configure| H1
        CMake -->|configure| H2

        src1 -->|compile| builder
        src2 -->|compile| builder
        src3 -->|compile| builder
        H1 -->|compile| builder
        H2 -->|compile| builder

        builder -->|link| exe
    end

    classDef runtime fill:#cce5ff,stroke:#004085,color:#004085;
    classDef library fill:#fff3cd,stroke:#856404,color:#856404;
    classDef build fill:#d4edda,stroke:#155724,color:#155724;
    classDef artifact fill:#e2e3e5,stroke:#6c757d,color:#6c757d;

    click Main "https://github.com/janayasserfawzi/cs2-textutility-youssef_jana/blob/main/main.cpp"
    click H1 "https://github.com/janayasserfawzi/cs2-textutility-youssef_jana/blob/main/text_utility_jana.h"
    click src1 "https://github.com/janayasserfawzi/cs2-textutility-youssef_jana/blob/main/text_utility_jana.cpp"
    click H2 "https://github.com/janayasserfawzi/cs2-textutility-youssef_jana/blob/main/text_utility_youssef.h"
    click src2 "https://github.com/janayasserfawzi/cs2-textutility-youssef_jana/blob/main/text_utility_youssef.cpp"
    click CMake "https://github.com/janayasserfawzi/cs2-textutility-youssef_jana/blob/main/CMakeLists.txt"
    click builder "https://github.com/janayasserfawzi/cs2-textutility-youssef_jana/tree/main/builder/"
```
