# project-path-of-exile-wiki/pypoe architecture

> Architecture diagram of the GitHub repository project-path-of-exile-wiki/pypoe, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/project-path-of-exile-wiki/pypoe
- Repository: https://github.com/project-path-of-exile-wiki/pypoe

## Overview

##### Main Components

a. Core Components:
- File Processing System (PyPoE/poe/file/)
- Command Line Interface (PyPoE/cli/)
- Wiki Export System (PyPoE/cli/exporter/)
- Simulation System (PyPoE/poe/sim/)
- UI System (PyPoE/ui/) [Note: Currently non-functional]

b. External Integrations:
- Path of Exile Game Files
- PoE Wiki (poewiki.net)
- Path of Exile Patch Server

##### Component Relationships

**[Game Data Layer]**
- ↑
**[Core Processing Layer]**
- ↑
**[Feature Layer]**
- ↑
**[Interface Layer]**

##### Specific Implementation Details

a. Game Data Layer:
- GGPK File Reader
- DAT File Parser
- Bundle File Handler
- File System Interface

b. Core Processing Layer:
- Specification System
- Translation System
- Cache Management
- Data Validators

c. Feature Layer:
- Wiki Exporters
- Data Parsers
- Simulation Tools
- File Processors

d. Interface Layer:
- CLI Interface
- Config Management
- Export Handlers
- UI Components (marked as deprecated)

##### Important Flows to Highlight

- Game File Processing Flow:
GGPK Files → File Processors → Data Parsers → Export Handlers

- Wiki Export Flow:
Data Parsers → Wiki Formatters → Export Handlers → Wiki API

##### Additional Elements

Supporting components:
- Configuration Management
- Test Framework
- Documentation System
- Build System (Poetry)

##### Key Design Patterns to Emphasize

- Parser-Handler Pattern in exporters
- Specification-based data processing
- Plugin-style parser system
- Caching mechanisms

##### Technical Details to Note

- Python 3.11 requirement
- External library dependencies
- Docker container support
- Multi-threading capability

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Interface Layer"
        CLI["CLI Interface"]:::interface
        UI["UI Components (Deprecated)"]:::deprecated
        ConfigMgmt["Configuration Management"]:::interface
        ExportHandlers["Export Handlers"]:::interface
    end

    subgraph "Feature Layer"
        WikiExp["Wiki Exporters"]:::feature
        DataParsers["Data Parsers"]:::feature
        SimTools["Simulation Tools"]:::feature
        FileProc["File Processors"]:::feature
    end

    subgraph "Core Processing Layer"
        SpecSys["Specification System"]:::core
        TransSys["Translation System"]:::core
        CacheMgmt["Cache Management"]:::core
        DataVal["Data Validators"]:::core
    end

    subgraph "Game Data Layer"
        GGPK["GGPK File Reader"]:::data
        DAT["DAT File Parser"]:::data
        Bundle["Bundle File Handler"]:::data
        FSInterface["File System Interface"]:::data
    end

    subgraph "External Systems"
        GameFiles["Path of Exile Game Files"]:::external
        Wiki["PoE Wiki"]:::external
        PatchServer["Path of Exile Patch Server"]:::external
    end

    %% Connections
    GameFiles --> GGPK
    GameFiles --> DAT
    GameFiles --> Bundle
    PatchServer --> FSInterface

    GGPK --> FileProc
    DAT --> FileProc
    Bundle --> FileProc
    FSInterface --> FileProc

    FileProc --> DataParsers
    DataParsers --> WikiExp
    DataParsers --> SimTools

    SpecSys --> DataParsers
    TransSys --> DataParsers
    CacheMgmt --> FileProc
    DataVal --> DataParsers

    WikiExp --> ExportHandlers
    ExportHandlers --> Wiki
    
    CLI --> ConfigMgmt
    ConfigMgmt --> ExportHandlers
    ConfigMgmt --> FileProc

    %% Click Events
    click GGPK "https://github.com/Project-Path-of-Exile-Wiki/PyPoE/blob/dev/PyPoE/poe/file/ggpk.py"
    click DAT "https://github.com/Project-Path-of-Exile-Wiki/PyPoE/blob/dev/PyPoE/poe/file/dat.py"
    click Bundle "https://github.com/Project-Path-of-Exile-Wiki/PyPoE/blob/dev/PyPoE/poe/file/bundle.py"
    click FSInterface "https://github.com/Project-Path-of-Exile-Wiki/PyPoE/blob/dev/PyPoE/poe/file/file_system.py"
    click CLI "https://github.com/Project-Path-of-Exile-Wiki/PyPoE/blob/dev/PyPoE/cli/core.py"
    click ConfigMgmt "https://github.com/Project-Path-of-Exile-Wiki/PyPoE/blob/dev/PyPoE/cli/config.py"
    click ExportHandlers "https://github.com/Project-Path-of-Exile-Wiki/PyPoE/blob/dev/PyPoE/cli/handler.py"
    click WikiExp "https://github.com/Project-Path-of-Exile-Wiki/PyPoE/blob/dev/PyPoE/cli/exporter/wiki/handler.py"
    click SimTools "https://github.com/Project-Path-of-Exile-Wiki/PyPoE/tree/dev/PyPoE/poe/sim/"
    click UI "https://github.com/Project-Path-of-Exile-Wiki/PyPoE/tree/dev/PyPoE/ui/"
    click SpecSys "https://github.com/Project-Path-of-Exile-Wiki/PyPoE/tree/dev/PyPoE/poe/file/specification/"
    click TransSys "https://github.com/Project-Path-of-Exile-Wiki/PyPoE/blob/dev/PyPoE/poe/file/translations.py"
    click CacheMgmt "https://github.com/Project-Path-of-Exile-Wiki/PyPoE/blob/dev/PyPoE/poe/file/shared/cache.py"
    click DataVal "https://github.com/Project-Path-of-Exile-Wiki/PyPoE/blob/dev/PyPoE/shared/config/validator.py"

    %% Styles
    classDef interface fill:#FFA500,stroke:#333,stroke-width:2px
    classDef feature fill:#98FB98,stroke:#333,stroke-width:2px
    classDef core fill:#87CEEB,stroke:#333,stroke-width:2px
    classDef data fill:#4169E1,stroke:#333,stroke-width:2px
    classDef external fill:#FF6B6B,stroke:#333,stroke-width:2px
    classDef deprecated fill:#808080,stroke:#333,stroke-width:2px
```
