# meaneye/sunflower architecture

> Architecture diagram of the GitHub repository meaneye/sunflower, 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/meaneye/sunflower
- Repository: https://github.com/meaneye/sunflower

## Overview

##### Main Components

a. Core Application Layer:
- Main Window Manager (sunflower/gui/main_window.py)
- Configuration Manager (sunflower/config.py)
- Plugin System (sunflower/plugin_base/)
- Operation Manager (sunflower/operation.py)

b. Plugin Architecture:
- Plugin Base System
- Core Plugins (file_list, archive_support, etc.)
- User Plugins (~/.config/sunflower/user_plugins/)

c. GUI Components:
- Twin Panel Interface
- Toolbar System
- Widgets Layer
- Preferences System

**┌─ User Interface Layer ─────────────────────┐**
- Main Window                                │
- ┌─────────────┐ ┌─────────────┐ ┌───────┐ │
- Left Panel  │ │ Right Panel │ │Toolbar│ │
- ┘ └─────────────┘ └───────┘ │
- Core Services Layer ────────────────────┐ │
- ┌──────────┐ ┌─────────┐ ┌───────────┐ │ │
- Operations│ │Config   │ │Accelerator│ │ │
- ┘ └─────────┘ └───────────┘ │ │
- Plugin System ───────────────────────────┤
- ┌─────────────┐ ┌──────────┐ ┌────────┐  │
- Plugin Base  │ │Extension │ │Provider│  │
- ┘ └──────────┘ └────────┘  │
- ┘

##### Important Relationships

a. Plugin System Integration:
- How plugins extend core functionality
- Plugin loading mechanism
- Extension points for:
- File operations
- Column management
- Viewer extensions
- Rename operations

b. File System Integration:
- Local file system access
- Archive handling
- Remote file system support (GIO)

##### Key Architectural Patterns to Highlight

- Plugin-based architecture
- MVC pattern in GUI components
- Event-driven system for file operations
- Provider pattern for file system access

##### Implementation Details

Use these symbols and conventions:
- Double lines: Plugin extension points
- Diamonds: Component aggregation

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and classes
    classDef core fill:#a8d1f0,stroke:#333
    classDef gui fill:#ffd7a8,stroke:#333
    classDef plugin fill:#b8e6b8,stroke:#333
    classDef provider fill:#e6b8e6,stroke:#333
    classDef tools fill:#d1d1d1,stroke:#333
    classDef i18n fill:#ffe4b5,stroke:#333

    %% Main Application Layer
    subgraph MainApp["Main Application"]
        MW["Main Window Manager"]:::core
        CM["Configuration Manager"]:::core
        OM["Operation Manager"]:::core
        AM["Accelerator Manager"]:::core
    end

    %% GUI Layer
    subgraph GUI["GUI Components"]
        TP["Twin Panel Interface"]:::gui
        TB["Toolbar System"]:::gui
        WG["Widgets"]:::gui
        PF["Preferences System"]:::gui
    end

    %% Plugin System
    subgraph PluginSystem["Plugin Architecture"]
        PB["Plugin Base System"]:::plugin
        PC["Plugin Base Core"]:::plugin
        PI["Provider Interface"]:::plugin
        CP["Core Plugins"]:::plugin
    end

    %% File System Integration
    subgraph FSI["File System Integration"]
        FLP["File List Plugin"]:::provider
        AS["Archive Support"]:::provider
        LP["Local Provider"]:::provider
        GP["GIO Provider"]:::provider
    end

    %% Tools
    subgraph Tools["Tools & Utilities"]
        AT["Advanced Tools"]:::tools
        FV["File Viewer"]:::tools
        FF["Find Files"]:::tools
        DU["Disk Usage"]:::tools
    end

    %% Extensions
    subgraph Extensions["Plugin Extensions"]
        CE["Column Extensions"]:::plugin
        RE["Rename Extensions"]:::plugin
        FE["Find Extensions"]:::plugin
        VE["Viewer Extensions"]:::plugin
    end

    %% Internationalization
    I18N["Translations"]:::i18n

    %% Relationships
    MW --> TP
    MW --> TB
    MW --> WG
    MW --> PF
    CM --> PB
    OM --> FSI
    PB --> CP
    PB --> PI
    PI --> LP
    PI --> GP
    CP --> FLP
    CP --> AS
    PB --> Extensions
    TP --> FSI
    Tools --> FSI

    %% Click events
    click MW "https://github.com/MeanEYE/Sunflower/blob/develop/sunflower/gui/main_window.py"
    click CM "https://github.com/MeanEYE/Sunflower/blob/develop/sunflower/config.py"
    click OM "https://github.com/MeanEYE/Sunflower/blob/develop/sunflower/operation.py"
    click AM "https://github.com/MeanEYE/Sunflower/blob/develop/sunflower/accelerator_manager.py"
    click PB "https://github.com/MeanEYE/Sunflower/tree/develop/sunflower/plugin_base/"
    click PC "https://github.com/MeanEYE/Sunflower/blob/develop/sunflower/plugin_base/plugin.py"
    click PI "https://github.com/MeanEYE/Sunflower/blob/develop/sunflower/plugin_base/provider.py"
    click CP "https://github.com/MeanEYE/Sunflower/tree/develop/sunflower/plugins/"
    click WG "https://github.com/MeanEYE/Sunflower/tree/develop/sunflower/widgets/"
    click TB "https://github.com/MeanEYE/Sunflower/blob/develop/sunflower/toolbar.py"
    click PF "https://github.com/MeanEYE/Sunflower/tree/develop/sunflower/gui/preferences/"
    click FLP "https://github.com/MeanEYE/Sunflower/tree/develop/sunflower/plugins/file_list/"
    click AS "https://github.com/MeanEYE/Sunflower/tree/develop/sunflower/plugins/archive_support/"
    click LP "https://github.com/MeanEYE/Sunflower/blob/develop/sunflower/plugins/file_list/local_provider.py"
    click GP "https://github.com/MeanEYE/Sunflower/blob/develop/sunflower/plugins/file_list/gio_provider.py"
    click AT "https://github.com/MeanEYE/Sunflower/tree/develop/sunflower/tools/"
    click FV "https://github.com/MeanEYE/Sunflower/blob/develop/sunflower/tools/viewer.py"
    click FF "https://github.com/MeanEYE/Sunflower/blob/develop/sunflower/tools/find_files.py"
    click DU "https://github.com/MeanEYE/Sunflower/blob/develop/sunflower/tools/disk_usage.py"
    click I18N "https://github.com/MeanEYE/Sunflower/tree/develop/translations/"
    click CE "https://github.com/MeanEYE/Sunflower/blob/develop/sunflower/plugin_base/column_extension.py"
    click RE "https://github.com/MeanEYE/Sunflower/tree/develop/sunflower/plugins/rename_extensions/"
    click FE "https://github.com/MeanEYE/Sunflower/tree/develop/sunflower/plugins/find_file_extensions/"
    click VE "https://github.com/MeanEYE/Sunflower/blob/develop/sunflower/plugin_base/viewer_extension.py"
```
