# zaykenyon/valorant-rank-yoinker architecture

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

- Interactive diagram: https://gitdiagram.com/zaykenyon/valorant-rank-yoinker
- Repository: https://github.com/zaykenyon/valorant-rank-yoinker

## Overview

##### Main Components Identification

The system should be represented with these key components:

a) Core Application Layer:
- Main Application Controller (main.py)
- Configuration Manager (src/config.py, src/configurator.py)
- Account Management System (src/account_manager/)

b) Game Integration Layer:
- WebSocket Client (src/websocket.py)
- Request Handler (src/requestsV.py)
- State Management (src/states/)

c) Data Processing Layer:
- Player Statistics (src/player_stats.py)
- Loadout Management (src/Loadouts.py)
- Rank System (src/rank.py)

d) External Interfaces:
- VALORANT Game Client
- Discord RPC (src/rpc.py)
- Web Interface (docs/)

- Blue: Core Application Components
- Green: Game Integration Components
- Yellow: Data Processing Components
- Gray: External Systems
- Red: Security/Authentication Components

**[Component Relationships]**

##### Key Architectural Patterns to Highlight

a) State Management Pattern:
- How the states/ directory manages different game states (menu, pregame, coregame)
- State flow between these components

b) Authentication Flow:
- Demonstrate the account_manager's interaction with VALORANT client
- Security boundaries and authentication checkpoints

##### Specific Implementation Details

**VALORANT Client ⇄ WebSocket Client → State Manager → Data Processors → UI Display**
- ↘ Account Manager → Authentication → Config

##### External Services Integration

Connections to:
- Discord Rich Presence
- VALORANT API endpoints
- Local game client connection

Key Flows to Emphasize:

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Core["Core Application Layer"]
        Main["Main Application Controller"]
        Config["Configuration Manager"]
        AccMgr["Account Management System"]
        ErrorH["Error Handler"]
        Logs["Logging System"]
    end

    subgraph GameInt["Game Integration Layer"]
        WS["WebSocket Client"]
        ReqH["Request Handler"]
        direction TB
        subgraph States["State Management"]
            Menu["Menu State"]
            PreGame["Pregame State"]
            CoreGame["CoreGame State"]
        end
    end

    subgraph DataProc["Data Processing Layer"]
        PlayerStats["Player Statistics"]
        Loadouts["Loadout Management"]
        RankSys["Rank System"]
        Content["Content Manager"]
        Presences["Presence Manager"]
    end

    subgraph External["External Systems"]
        VClient["VALORANT Client"]
        Discord["Discord RPC"]
        WebUI["Web Interface"]
    end

    %% Core Layer Relationships
    Main --> Config
    Main --> AccMgr
    Main --> ErrorH
    Main --> Logs

    %% Game Integration Relationships
    Main --> WS
    WS <--> VClient
    WS --> ReqH
    ReqH --> States
    States --> DataProc

    %% Data Processing Relationships
    PlayerStats --> WebUI
    Loadouts --> WebUI
    RankSys --> WebUI
    Content --> DataProc
    Presences --> DataProc

    %% External System Relationships
    Main --> Discord
    AccMgr <--> VClient

    %% Click Events
    click Main "https://github.com/zayKenyon/VALORANT-rank-yoinker/blob/main/main.py"
    click Config "https://github.com/zayKenyon/VALORANT-rank-yoinker/blob/main/src/config.py"
    click AccMgr "https://github.com/zayKenyon/VALORANT-rank-yoinker/tree/main/src/account_manager"
    click ErrorH "https://github.com/zayKenyon/VALORANT-rank-yoinker/blob/main/src/errors.py"
    click Logs "https://github.com/zayKenyon/VALORANT-rank-yoinker/blob/main/src/logs.py"
    click WS "https://github.com/zayKenyon/VALORANT-rank-yoinker/blob/main/src/websocket.py"
    click ReqH "https://github.com/zayKenyon/VALORANT-rank-yoinker/blob/main/src/requestsV.py"
    click Menu "https://github.com/zayKenyon/VALORANT-rank-yoinker/blob/main/src/states/menu.py"
    click PreGame "https://github.com/zayKenyon/VALORANT-rank-yoinker/blob/main/src/states/pregame.py"
    click CoreGame "https://github.com/zayKenyon/VALORANT-rank-yoinker/blob/main/src/states/coregame.py"
    click PlayerStats "https://github.com/zayKenyon/VALORANT-rank-yoinker/blob/main/src/player_stats.py"
    click Loadouts "https://github.com/zayKenyon/VALORANT-rank-yoinker/blob/main/src/Loadouts.py"
    click RankSys "https://github.com/zayKenyon/VALORANT-rank-yoinker/blob/main/src/rank.py"
    click Content "https://github.com/zayKenyon/VALORANT-rank-yoinker/blob/main/src/content.py"
    click Presences "https://github.com/zayKenyon/VALORANT-rank-yoinker/blob/main/src/presences.py"
    click Discord "https://github.com/zayKenyon/VALORANT-rank-yoinker/blob/main/src/rpc.py"
    click WebUI "https://github.com/zayKenyon/VALORANT-rank-yoinker/tree/main/docs"

    %% Styling
    classDef core fill:#a2d2ff,stroke:#333,stroke-width:2px
    classDef game fill:#bde0fe,stroke:#333,stroke-width:2px
    classDef data fill:#ffafcc,stroke:#333,stroke-width:2px
    classDef external fill:#ffc8dd,stroke:#333,stroke-width:2px
    classDef state fill:#cdb4db,stroke:#333,stroke-width:2px

    class Main,Config,AccMgr,ErrorH,Logs core
    class WS,ReqH game
    class Menu,PreGame,CoreGame state
    class PlayerStats,Loadouts,RankSys,Content,Presences data
    class VClient,Discord,WebUI external
```
