# suppliedorange/valorant-instalocker architecture

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

- Interactive diagram: https://gitdiagram.com/suppliedorange/valorant-instalocker
- Repository: https://github.com/suppliedorange/valorant-instalocker

## Overview

Key Components to Include:

##### Frontend Layer
- Web-based GUI (using Eel framework)
- Components:
- HTML/CSS interface (web/index.html, web/css/)
- Client-side JavaScript (web/js/index.js)
- Assets (images, fonts)
- Agent configuration (web/json/agents.json)

##### Backend Layer
- Python application (main.py)
- Valclient integration for VALORANT API communication
- Eel server for web-GUI communication

##### External Systems
- VALORANT Game Client
- VALORANT API

**[Frontend Layer]**

- (Eel WebSocket)
- v
**[Backend Layer] <-----> [VALORANT API]**

- v
- [VALORANT Client]

Specific Design Elements:

##### Interactions
- WebSocket connection between Frontend and Backend
- Data flow from agents.json to the Frontend
- Agent selection flow from Frontend → Backend → VALORANT API

Important Architectural Notes:

##### Event-driven nature
- Agent selection events
- Pre-game detection
- Instalocking mechanism

##### Error handling flow
- API error detection
- Error propagation to UI

##### Configuration flow
- Agent data loading
- Settings management

Additional Considerations:

- The 3-second refresh cycle
- Instalock sequence
- Error handling sequence

##### A small deployment view showing
- Python runtime environment
- Chrome/Browser requirement
- VALORANT client prerequisite

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        GUI["Web GUI"]:::frontend
        click GUI "https://github.com/SuppliedOrange/VALORANT-Instalocker/blob/main/web/index.html"
        CSS["Styling"]:::frontend
        click CSS "https://github.com/SuppliedOrange/VALORANT-Instalocker/blob/main/web/css/index.css"
        JS["Client Logic"]:::frontend
        click JS "https://github.com/SuppliedOrange/VALORANT-Instalocker/blob/main/web/js/index.js"
        Assets["Assets & Images"]:::frontend
        click Assets "https://github.com/SuppliedOrange/VALORANT-Instalocker/tree/main/web/assets/"
        AgentConfig["Agent Configuration"]:::data
        click AgentConfig "https://github.com/SuppliedOrange/VALORANT-Instalocker/blob/main/web/json/agents.json"
        
        GUI --> CSS
        GUI --> JS
        GUI --> Assets
        JS --> AgentConfig
    end

    subgraph Backend
        PyApp["Python Application"]:::backend
        click PyApp "https://github.com/SuppliedOrange/VALORANT-Instalocker/blob/main/main.py"
        EelIntegration["Eel Integration"]:::backend
        click EelIntegration "https://github.com/SuppliedOrange/VALORANT-Instalocker/blob/main/install_and_build/replace_bottle.py"
        BuildSystem["Build System"]:::backend
        click BuildSystem "https://github.com/SuppliedOrange/VALORANT-Instalocker/blob/main/install_and_build/build.py"
        InstallSystem["Installation System"]:::backend
        click InstallSystem "https://github.com/SuppliedOrange/VALORANT-Instalocker/blob/main/install_and_build/install.py"
        
        PyApp --> EelIntegration
        BuildSystem --> PyApp
        InstallSystem --> PyApp
    end

    subgraph "External Systems"
        ValAPI["VALORANT API"]:::external
        ValClient["VALORANT Client"]:::external
        
        ValAPI --> ValClient
    end

    JS <--->|WebSocket| PyApp
    PyApp <--->|API Requests| ValAPI

    subgraph "Deployment Requirements"
        Python["Python Runtime"]:::requirement
        Browser["Chrome/Browser"]:::requirement
        GameClient["VALORANT Client"]:::requirement
    end

    subgraph "Legend"
        L1["Frontend Component"]:::frontend
        L2["Backend Component"]:::backend
        L3["External System"]:::external
        L4["Data Store"]:::data
        L5["Requirement"]:::requirement
    end

    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef data fill:#f1c40f,stroke:#f39c12,color:black
    classDef requirement fill:#e74c3c,stroke:#c0392b,color:white
```
