# nexus-mods/vortex architecture

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

- Interactive diagram: https://gitdiagram.com/nexus-mods/vortex
- Repository: https://github.com/nexus-mods/vortex

## Overview

##### Main Architecture Components

a) Frontend Layer:
- Main Window (src/views/MainWindow.tsx)
- Dashboard (src/extensions/dashboard)
- Various UI Components (src/controls)
- Extension UI Components (src/extensions/*/views)

b) Core Application Layer:
- Extension Manager (src/util/ExtensionManager.ts)
- Game Mode Manager (src/extensions/gamemode_management)
- Mod Management System (src/extensions/mod_management)
- Download Manager (src/extensions/download_management)

c) Data Layer:
- State Management (src/reducers)
- Storage Systems (src/util/LevelPersist.ts)
- File System Operations (src/util/fs.ts)

##### Key Interactions to Highlight

- User Interface → Extension System
- Extension System → Game Management
- Mod Management → File System
- Download Manager → Nexus Mods API
- State Management → Storage Layer

##### Extension Architecture

- Extension Loading System
- Game Support Extensions
- Tool Extensions
- UI Extension Points

##### Specific Implementation Details

Technical elements:
- Electron Main/Renderer Process separation
- Redux State Management Flow
- File Deployment Systems (Hardlink/Symlink/Move)
- Game Detection & Management

##### Component Relationships

Key relationships:
**MainWindow**
- ↓
**Extension System**
- ↓
**Game/Mod Management**
- ↓
**File System Operations**

##### External Integrations

Connections to:
- Nexus Mods API
- Game Platforms (Steam, GOG, etc.)
- File System
- Operating System Services

##### Data Flow

Flow of:
- Mod Installation Process
- Game Detection
- Profile Management
- Extension Loading

Key Technical Considerations:
- Separation between main and renderer processes
- Redux store's central role
- Demonstrate how extensions plug into the core system
- Deployment methods for different mod types

This will create a comprehensive visualization of Vortex's architecture while maintaining clarity about its complex interactions and extensible nature.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and classes
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef external fill:#f1c40f,stroke:#f39c12,color:white
    classDef security fill:#e74c3c,stroke:#c0392b,color:white
    classDef storage fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Main Application Structure
    subgraph Frontend
        MainWindow["Main Window"]:::ui
        Dashboard["Dashboard"]:::ui
        UIComponents["UI Components"]:::ui
        ExtensionUI["Extension UI Components"]:::ui
    end

    subgraph CoreLayer
        ExtManager["Extension Manager"]:::core
        GameManager["Game Mode Manager"]:::core
        ModManager["Mod Management"]:::core
        DownloadMgr["Download Manager"]:::core
        ExtLoader["Extension Loading System"]:::core
        ProfileMgr["Profile Management"]:::core
    end

    subgraph DataLayer
        StateManagement["State Management"]:::storage
        Storage["Storage System"]:::storage
        FileOps["File System Operations"]:::security
    end

    subgraph Extensions
        GameExt["Game Support Extensions"]:::core
        ToolExt["Tool Extensions"]:::core
    end

    subgraph ExternalSystems
        NexusAPI["Nexus Mods API"]:::external
        GamePlatforms["Game Platforms"]:::external
        OS["Operating System"]:::external
    end

    %% Relationships
    MainWindow --> ExtManager
    MainWindow --> Dashboard
    MainWindow --> UIComponents
    ExtManager --> GameManager
    ExtManager --> ModManager
    ExtManager --> DownloadMgr
    ExtManager --> ExtLoader
    ExtLoader --> GameExt
    ExtLoader --> ToolExt
    ModManager --> FileOps
    DownloadMgr --> NexusAPI
    GameManager --> GamePlatforms
    FileOps --> OS
    StateManagement --> Storage
    
    %% Click events
    click MainWindow "https://github.com/Nexus-Mods/Vortex/blob/master/src/views/MainWindow.tsx"
    click Dashboard "https://github.com/Nexus-Mods/Vortex/tree/master/src/extensions/dashboard"
    click UIComponents "https://github.com/Nexus-Mods/Vortex/tree/master/src/controls"
    click ExtManager "https://github.com/Nexus-Mods/Vortex/blob/master/src/util/ExtensionManager.ts"
    click GameManager "https://github.com/Nexus-Mods/Vortex/tree/master/src/extensions/gamemode_management"
    click ModManager "https://github.com/Nexus-Mods/Vortex/tree/master/src/extensions/mod_management"
    click DownloadMgr "https://github.com/Nexus-Mods/Vortex/tree/master/src/extensions/download_management"
    click StateManagement "https://github.com/Nexus-Mods/Vortex/tree/master/src/reducers"
    click Storage "https://github.com/Nexus-Mods/Vortex/blob/master/src/util/LevelPersist.ts"
    click FileOps "https://github.com/Nexus-Mods/Vortex/blob/master/src/util/fs.ts"
    click ExtLoader "https://github.com/Nexus-Mods/Vortex/blob/master/src/util/ExtensionProvider.ts"
    click GameExt "https://github.com/Nexus-Mods/Vortex/tree/master/src/extensions/games"
    click ToolExt "https://github.com/Nexus-Mods/Vortex/tree/master/src/extensions/tool_variables_base"
    click ProfileMgr "https://github.com/Nexus-Mods/Vortex/tree/master/src/extensions/profile_management"
    click NexusAPI "https://github.com/Nexus-Mods/Vortex/tree/master/src/extensions/nexus_integration"

    %% Legend
    subgraph Legend
        UI["UI Component"]:::ui
        Core["Core System"]:::core
        Ext["External System"]:::external
        Sec["Security Component"]:::security
        Store["Storage Component"]:::storage
    end
```
