# kvan7/exiled-exchange-2 architecture

> Architecture diagram of the GitHub repository kvan7/exiled-exchange-2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kvan7/exiled-exchange-2
- Repository: https://github.com/kvan7/exiled-exchange-2

## Overview

##### Main Components Identification

The project is an Electron-based desktop application with the following main components:

a) Main Process (./main/)
- Core application logic
- System tray integration
- Window management
- Game interaction
- OCR/Vision processing

b) Renderer Process (./renderer/)
- User interface
- Price checking logic
- Item parsing
- Trade integration

c) Data Parser (./dataParser/)
- Game data processing
- Multi-language support
- Item and stats processing

##### Key Architectural Elements

a) Core Application Layer:
- Main Process (Electron)
- IPC Communication
- Window Management
- System Tray
- Auto Updater

b) Game Integration Layer:
- Game Window Detection
- Log File Watcher
- Overlay System
- Hotkey System
- OCR/Vision Processing

c) Data Processing Layer:
- Item Parser
- Stats Parser
- Price Prediction
- Trade API Integration
- Cache System

d) User Interface Layer:
- Price Check Window
- Settings Window
- Overlay Widgets
- Search Interfaces

- Blue: Core application components
- Green: Game integration features
- Orange: Data processing systems
- Purple: User interface elements
- Gray: External services/APIs

**Component Relationships:**
**→ Data flow direction**
**⟷ Two-way communication**
- > External API calls

**□ Process/Service**
**○ Data Store**
**◇ External Service**

##### Key Interactions to Highlight

- IPC communication between main and renderer processes
- Game window detection and overlay positioning
- Data flow from game client to price check system
- Integration with external trade APIs
- Multi-language support system
- Cache and rate limiting mechanisms

##### External Services Integration

- poe.ninja API
- poeprices.info API
- pathofexile.com Trade API
- Game client interaction

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Core["Core Application Layer"]
        Main["Main Process"]:::core
        IPC["IPC Communication"]:::core
        WinMgr["Window Management"]:::core
        SysTray["System Tray"]:::core
        AutoUpd["Auto Updater"]:::core
    end

    subgraph Game["Game Integration Layer"]
        GameWin["Game Window Detection"]:::game
        LogWatch["Log File Watcher"]:::game
        Overlay["Overlay System"]:::game
        Hotkeys["Hotkey System"]:::game
        Vision["OCR/Vision Processing"]:::game
    end

    subgraph Data["Data Processing Layer"]
        ItemParser["Item Parser"]:::data
        StatsParser["Stats Parser"]:::data
        PricePred["Price Prediction"]:::data
        TradeInt["Trade API Integration"]:::data
        Cache["Cache System"]:::data
    end

    subgraph UI["User Interface Layer"]
        PriceWin["Price Check Window"]:::ui
        SettingsWin["Settings Window"]:::ui
        Widgets["Overlay Widgets"]:::ui
        Search["Search Interfaces"]:::ui
    end

    subgraph External["External Services"]
        PoeNinja["poe.ninja API"]:::ext
        PoePrices["poeprices.info API"]:::ext
        PoeTradeAPI["pathofexile.com Trade API"]:::ext
        GameClient["Game Client"]:::ext
    end

    Main --> IPC
    Main --> WinMgr
    Main --> SysTray
    Main --> AutoUpd

    GameWin --> Overlay
    LogWatch --> ItemParser
    Vision --> ItemParser

    ItemParser --> PricePred
    StatsParser --> PricePred
    PricePred --> TradeInt
    TradeInt --> Cache

    IPC <--> UI
    Overlay --> Widgets
    Widgets --> PriceWin
    Widgets --> SettingsWin

    TradeInt --> PoeNinja
    TradeInt --> PoePrices
    TradeInt --> PoeTradeAPI
    GameWin --> GameClient

    %% Click Events
    click Main "https://github.com/Kvan7/Exiled-Exchange-2/blob/master/main/src/main.ts"
    click SysTray "https://github.com/Kvan7/Exiled-Exchange-2/blob/master/main/src/AppTray.ts"
    click AutoUpd "https://github.com/Kvan7/Exiled-Exchange-2/blob/master/main/src/AppUpdater.ts"
    click GameWin "https://github.com/Kvan7/Exiled-Exchange-2/blob/master/main/src/windowing/GameWindow.ts"
    click Overlay "https://github.com/Kvan7/Exiled-Exchange-2/blob/master/main/src/windowing/OverlayWindow.ts"
    click Vision "https://github.com/Kvan7/Exiled-Exchange-2/tree/master/main/src/vision"
    click LogWatch "https://github.com/Kvan7/Exiled-Exchange-2/blob/master/main/src/host-files/GameLogWatcher.ts"
    click ItemParser "https://github.com/Kvan7/Exiled-Exchange-2/blob/master/renderer/src/parser/ParsedItem.ts"
    click TradeInt "https://github.com/Kvan7/Exiled-Exchange-2/blob/master/renderer/src/web/price-check/trade/pathofexile-trade.ts"
    click Cache "https://github.com/Kvan7/Exiled-Exchange-2/blob/master/renderer/src/web/price-check/trade/Cache.ts"
    click PriceWin "https://github.com/Kvan7/Exiled-Exchange-2/blob/master/renderer/src/web/price-check/PriceCheckWindow.vue"
    click SettingsWin "https://github.com/Kvan7/Exiled-Exchange-2/blob/master/renderer/src/web/settings/SettingsWindow.vue"
    click IPC "https://github.com/Kvan7/Exiled-Exchange-2/blob/master/ipc/types.ts"
    click Hotkeys "https://github.com/Kvan7/Exiled-Exchange-2/blob/master/main/src/shortcuts/Shortcuts.ts"

    %% Styles
    classDef core fill:#2196F3,color:white
    classDef game fill:#4CAF50,color:white
    classDef data fill:#FF9800,color:white
    classDef ui fill:#9C27B0,color:white
    classDef ext fill:#757575,color:white

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Game Integration"]:::game
        L3["Data Processing"]:::data
        L4["User Interface"]:::ui
        L5["External Services"]:::ext
    end
```
