# victorml11/lol-cheat-poc architecture

> Architecture diagram of the GitHub repository victorml11/lol-cheat-poc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/victorml11/lol-cheat-poc
- Repository: https://github.com/victorml11/lol-cheat-poc

## Overview

##### Project Type and Purpose
- This is a full-stack, event-driven proof-of-concept system that reads League of Legends process memory in C++, publishes that data via Apache Kafka, and consumes it in a Java Spring Boot service with LibGDX to render cheat overlays at real time.
- Key concerns: high-throughput, low-latency messaging; tuning producers and consumers to avoid missed frames and lag.

##### File Structure Analysis
- Top‐level:
- CMakeLists.txt, conanfile.txt → C++ build with Conan/CMake
- com/vmaster → C++ source (Hero, Offsets, ScreenData, LeagueMemoryReader, Utils, main.cpp)
- libs/modern-cpp-kafka → vendored Kafka C++ client library and its build/test hierarchy
- build/ cmake-build-debug/ → build artifacts, dependency snapshots, generated executables
- No Java code is present in this tree, but the README describes a Java Spring + LibGDX component; assume it lives in a sibling module or separate repo.

##### README Insights
- Describes a C++ Kafka producer (using modern-cpp-kafka + nlohmann_json) reading game memory.
- A Java Spring service consumes topics “prueba” & “heroes” and uses LibGDX for rendering.
- Uses Kafka monitoring stack via Docker Compose for KPIs (Prometheus, Grafana).

##### Main Components
a. C++ Kafka Producer
- Modules: LeagueMemoryReader, ScreenData, Hero extraction, Utils
- Libraries: modern-cpp-kafka, nlohmann_json
- Built with CMake+Conan → vmaster.exe
b. Kafka Cluster
- Brokers, zookeeper (if applicable), topic partitions for “prueba”, “heroes”
- Monitoring stack (Prometheus, Grafana) deployed via Docker Compose
c. Java Spring Boot Consumer Service
- Spring Kafka consumer listening to the topics
- Business logic layer
d. LibGDX Rendering Engine
- Integrated into Spring Boot or running as standalone UI client
- Renders overlays at ~144 FPS using incoming game data
e. External Dependencies
- Docker Compose for Kafka + monitoring
- Client machines running League of Legends

##### Interactions and Data Flow
1. C++ component attaches to LoL process → reads memory snapshots
2. Serializes data → JSON messages → publishes to Kafka topics via modern-cpp-kafka
3. Kafka brokers enqueue messages; monitoring stack collects metrics
4. Java Spring service consumes messages → applies cheat logic
5. Passes data to LibGDX layer → renders cheat overlays on screen
6. Optional feedback loop: metrics flow to Grafana for tuning

##### Architectural Patterns and Design Principles
- Asynchronous, event-driven pub/sub via Kafka
- Clear separation of concerns: data acquisition (C++), messaging (Kafka), business logic + UI (Java/LibGDX)
- Use of externalized configuration and monitoring for throughput tuning
- Modular C++ build (Conan dependencies, CMake targets)

##### Detail Level
- Important libraries (modern-cpp-kafka, nlohmann_json, Spring Kafka) next to their components
- Configuration files/build scripts (CMakeLists.txt, conanfile.txt, pom.xml or build.gradle) as small documents attached to their runtime
- Monitoring flow: Kafka → Prometheus exporter → Grafana dashboards

## Diagram (Mermaid)

```mermaid
graph TD
    %% C++ Producer Layer
    subgraph "C++ Kafka Producer"
        direction TB
        CMake["CMakeLists.txt"]:::blue
        Conan["conanfile.txt"]:::blue
        Exe["vmaster.exe"]:::blue
        MainCpp["main.cpp"]:::blue
        subgraph "Modules"
            direction TB
            LMReader_h["LeagueMemoryReader.h"]:::blue
            LMReader_cpp["LeagueMemoryReader.cpp"]:::blue
            SD_h["ScreenData.h"]:::blue
            SD_cpp["ScreenData.cpp"]:::blue
            Hero_h["Hero.h"]:::blue
            Hero_cpp["Hero.cpp"]:::blue
            Offsets_h["Offsets.h"]:::blue
            Offsets_cpp["Offsets.cpp"]:::blue
            Utils_h["Utils.h"]:::blue
            Utils_cpp["Utils.cpp"]:::blue
            MemSnap["MemSnapshot.h"]:::blue
            Vec["Vector.h"]:::blue
        end
        subgraph "Libraries"
            direction TB
            KafkaCppLib["modern-cpp-kafka"]:::blue
            JsonLib["nlohmann_json"]:::blue
        end
        CMake -->|builds| Exe
        CMake -->|configures| Modules
        Conan -->|manages| KafkaCppLib
        Conan -->|manages| JsonLib
        Exe -->|entry| MainCpp
        Exe -->|uses| LMReader_h
        Exe -->|uses| LMReader_cpp
        Exe -->|uses| SD_h
        Exe -->|uses| SD_cpp
        Exe -->|uses| Hero_h
        Exe -->|uses| Hero_cpp
        Exe -->|uses| Offsets_h
        Exe -->|uses| Offsets_cpp
        Exe -->|uses| Utils_h
        Exe -->|uses| Utils_cpp
        Exe -->|uses| MemSnap
        Exe -->|uses| Vec
        Exe -->|links| KafkaCppLib
        Exe -->|links| JsonLib
    end

    %% Kafka Infrastructure
    subgraph "Kafka Infrastructure"
        direction TB
        docker["Docker Compose"]:::gray
        cluster["Kafka Broker Cluster"]:::orange
        prueba["prueba topic"]:::orange
        heroes["heroes topic"]:::orange
        prometheus["Prometheus"]:::gray
        grafana["Grafana"]:::gray
        docker --> cluster
        docker --> prometheus
        docker --> grafana
        cluster --> prueba
        cluster --> heroes
        prometheus -.-> cluster
        grafana --> prometheus
    end

    %% Java Consumer Layer
    subgraph "Java Spring + LibGDX Consumer"
        direction TB
        Spring["Spring Boot Consumer"]:::green
        LibGDX["LibGDX Renderer"]:::green
        Spring -->|consumes| prueba
        Spring -->|consumes| heroes
        Spring -->|forwards data| LibGDX
    end

    %% Data Flow
    Exe -->|"publishes JSON"| prueba
    Exe -->|"publishes JSON"| heroes

    %% Click Events
    click CMake "https://github.com/victorml11/lol-cheat-poc/blob/C++/CMakeLists.txt"
    click Conan "https://github.com/victorml11/lol-cheat-poc/blob/C++/conanfile.txt"
    click MainCpp "https://github.com/victorml11/lol-cheat-poc/blob/C++/com/vmaster/main.cpp"
    click LMReader_h "https://github.com/victorml11/lol-cheat-poc/blob/C++/com/vmaster/LeagueMemoryReader.h"
    click LMReader_cpp "https://github.com/victorml11/lol-cheat-poc/blob/C++/com/vmaster/LeagueMemoryReader.cpp"
    click SD_h "https://github.com/victorml11/lol-cheat-poc/blob/C++/com/vmaster/ScreenData.h"
    click SD_cpp "https://github.com/victorml11/lol-cheat-poc/blob/C++/com/vmaster/ScreenData.cpp"
    click Hero_h "https://github.com/victorml11/lol-cheat-poc/blob/C++/com/vmaster/Hero.h"
    click Hero_cpp "https://github.com/victorml11/lol-cheat-poc/blob/C++/com/vmaster/Hero.cpp"
    click Offsets_h "https://github.com/victorml11/lol-cheat-poc/blob/C++/com/vmaster/Offsets.h"
    click Offsets_cpp "https://github.com/victorml11/lol-cheat-poc/blob/C++/com/vmaster/Offsets.cpp"
    click Utils_h "https://github.com/victorml11/lol-cheat-poc/blob/C++/com/vmaster/Utils.h"
    click Utils_cpp "https://github.com/victorml11/lol-cheat-poc/blob/C++/com/vmaster/Utils.cpp"
    click MemSnap "https://github.com/victorml11/lol-cheat-poc/blob/C++/com/vmaster/MemSnapshot.h"
    click Vec "https://github.com/victorml11/lol-cheat-poc/blob/C++/com/vmaster/Vector.h"
    click KafkaCppLib "https://github.com/victorml11/lol-cheat-poc/tree/C++/libs/modern-cpp-kafka/"
    click KafkaCppLib "https://github.com/victorml11/lol-cheat-poc/tree/C++/cmake-build-debug/_deps/modern-cpp-kafka-src/"
    click JsonLib "https://github.com/victorml11/lol-cheat-poc/blob/C++/cmake-build-debug/_deps/json-src/include/nlohmann/json.hpp"

    %% Styles
    classDef blue fill:#cce5ff,stroke:#2b6cb0,stroke-width:1px
    classDef orange fill:#ffe5b4,stroke:#d97706,stroke-width:1px
    classDef green fill:#d4f5d4,stroke:#2f855a,stroke-width:1px
    classDef gray fill:#e2e8f0,stroke:#4a5568,stroke-width:1px
```
