# dev07060/macos_file_manager architecture

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

- Interactive diagram: https://gitdiagram.com/dev07060/macos_file_manager
- Repository: https://github.com/dev07060/macos_file_manager

## Overview

##### Project type and purpose
- This is a desktop application: a macOS file manager built with Flutter.
- It provides an interactive UI for browsing, manipulating, and previewing files/folders on the user’s machine, with features like drag-and-drop, image preview/editing, search, favorites, and shell-script execution.

##### File structure
- Top-level folders:
- lib/ – the entire Flutter/Dart codebase
– constants/ – static values (paths, file types, UI constants)
– model/ – data classes (DirectoryNodeData, FileSystemItem, FavoriteDirectory)
– providers/ – Riverpod providers and generated code for state management
– services/ – file system and directory services, selection logic
– src/ – UI events, states, widgets
· widgets/ – all reusable UI components (tree view, file details, toolbar, image preview, etc.)
· drag_drop_items_event.dart, home.dart, etc. – event/state handling for core pages
- macos/ – the native macOS host project, Swift/Objective-C glue, Xcode project files
- test/ – widget tests
- pubspec.yaml – dependencies including flutter_riverpod, extended_image, archive

##### README for additional insights
- Confirms a clean architecture inspired structure: UI ←→ providers (state) ←→ services (business logic) ←→ OS file system.
- Notes key tech: Flutter, Riverpod, hooks_riverpod, super_drag_and_drop, archive, extended_image, intl, uuid, path.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% UI Layer
    subgraph "UI Layer"
        direction TB
        HomePage["Home Page"]:::ui
        DirectoryTreeView["DirectoryTreeView Widget"]:::ui
        DirectoryNode["DirectoryNode Widget"]:::ui
        TreeLinePainter["TreeLinePainter"]:::ui
        ImagePreview["ImagePreview Widget"]:::ui
        ImageControls["ImageControls Widget"]:::ui
        FileDetails["FileDetails Widget"]:::ui
        Toolbar["Toolbar Widget"]:::ui
        SearchBar["SearchBar Widget"]:::ui
        SearchResultList["SearchResultList Widget"]:::ui
        FavoritesSection["FavoritesSection Widget"]:::ui
        FileItem["FileItem Widget"]:::ui
        FileHeader["FileHeader Widget"]:::ui
        HoverBuilder["HoverBuilder Widget"]:::ui
    end

    %% State Management Layer
    subgraph "State Management Layer"
        direction TB
        FileSystemProviders["FileSystemProviders"]:::state
        TreeViewProvider["TreeViewProvider"]:::state
        TreeViewProviderGen["TreeViewProvider.g.dart"]:::state
        FavoritesProvider["FavoritesProvider"]:::state
        ThemeProvider["ThemeProvider"]:::state
    end

    %% Service Layer
    subgraph "Service Layer"
        direction TB
        DirectoryService["DirectoryService"]:::service
        FileSystemService["FileSystemService"]:::service
        SelectionService["SelectionService"]:::service
    end

    %% Data Models
    subgraph "Data Models"
        direction TB
        DirectoryNodeData["DirectoryNodeData"]:::model
        FileSystemItem["FileSystemItem"]:::model
        FavoriteDirectory["FavoriteDirectory"]:::model
    end

    %% Utility Functions
    subgraph "Utility Functions"
        direction TB
        FileUtils["FileUtils"]:::util
        DialogUtils["DialogUtils"]:::util
        ImageUtils["ImageUtils"]:::util
        ImageRotationStorage["ImageRotationStorage"]:::util
    end

    %% Constants & Configuration
    subgraph "Constants & Configuration"
        direction TB
        Main["lib/main.dart"]:::config
        FileConstants["FileConstants"]:::config
        AppTheme["AppTheme"]:::config
    end

    %% Platform Integration
    subgraph "Platform Integration"
        direction TB
        AppDelegate["AppDelegate.swift"]:::platform
        MainFlutterWindow["MainFlutterWindow.swift"]:::platform
        XcodeProject["Runner.xcodeproj"]:::platform
    end

    %% External Libraries/OS
    subgraph "External Libraries/OS"
        direction TB
        super_drag_and_drop["super_drag_and_drop"]:::external
        archive_lib["archive"]:::external
        extended_image_lib["extended_image"]:::external
        path_lib["path"]:::external
        intl_lib["intl"]:::external
        uuid_lib["uuid"]:::external
        Shell["macOS Shell"]:::external
        FileSystemOS["macOS FileSystem"]:::external
    end

    %% Connections: UI -> State
    HomePage -->|"reads/writes"| FileSystemProviders
    DirectoryTreeView -->|triggers| TreeViewProvider
    FavoritesSection -->|reads/writes| FavoritesProvider
    SearchBar -->|updates| TreeViewProvider
    SearchResultList -->|reads| TreeViewProvider
    Toolbar -->|reads/writes| ThemeProvider
    FileDetails -->|reads| FileSystemProviders

    %% State -> Service
    FileSystemProviders -->|invoke| DirectoryService
    TreeViewProvider -->|invoke| FileSystemService
    FavoritesProvider -->|invoke| SelectionService

    %% Service -> Models
    DirectoryService -->|returns| DirectoryNodeData
    FileSystemService -->|returns| FileSystemItem
    SelectionService -->|returns| FavoriteDirectory

    %% Service -> External & Platform
    DirectoryService -->|fs access| FileSystemOS
    DirectoryService -->|exec| Shell
    FileSystemService -->|compression| archive_lib
    SelectionService -->|drag/drop| super_drag_and_drop
    ImageUtils -->|uses| extended_image_lib

    %% Services use Utilities
    DirectoryService --> FileUtils
    FileSystemService --> FileUtils
    SelectionService --> DialogUtils
    SelectionService --> ImageRotationStorage
    DirectoryService --> ImageUtils

    %% Platform
    DirectoryService --> AppDelegate
    SelectionService --> MainFlutterWindow

    %% Constants & Config usage
    Main --> HomePage
    FileConstants --> DirectoryService
    AppTheme --> HomePage

    %% Click Events
    click HomePage "https://github.com/dev07060/macos_file_manager/blob/main/lib/src/home.dart"
    click DirectoryTreeView "https://github.com/dev07060/macos_file_manager/blob/main/lib/src/widgets/directory_tree/node/directory_tree_view.dart"
    click DirectoryNode "https://github.com/dev07060/macos_file_manager/blob/main/lib/src/widgets/directory_tree/node/directory_node.dart"
    click TreeLinePainter "https://github.com/dev07060/macos_file_manager/blob/main/lib/src/widgets/directory_tree/custom_painter/tree_line_painter.dart"
    click ImagePreview "https://github.com/dev07060/macos_file_manager/blob/main/lib/src/widgets/image_preview.dart"
    click ImageControls "https://github.com/dev07060/macos_file_manager/blob/main/lib/src/widgets/image_controls.dart"
    click FileDetails "https://github.com/dev07060/macos_file_manager/blob/main/lib/src/widgets/file_details.dart"
    click Toolbar "https://github.com/dev07060/macos_file_manager/blob/main/lib/src/widgets/toolbar.dart"
    click SearchBar "https://github.com/dev07060/macos_file_manager/blob/main/lib/src/widgets/search_bar.dart"
    click SearchResultList "https://github.com/dev07060/macos_file_manager/blob/main/lib/src/widgets/search_file/search_result_list.dart"
    click FavoritesSection "https://github.com/dev07060/macos_file_manager/blob/main/lib/src/widgets/favorites_section.dart"
    click FileItem "https://github.com/dev07060/macos_file_manager/blob/main/lib/src/widgets/file_item.dart"
    click FileHeader "https://github.com/dev07060/macos_file_manager/blob/main/lib/src/widgets/file_header.dart"
    click HoverBuilder "https://github.com/dev07060/macos_file_manager/blob/main/lib/src/widgets/hover_builder.dart"
    click FileSystemProviders "https://github.com/dev07060/macos_file_manager/blob/main/lib/providers/file_system_providers.dart"
    click TreeViewProvider "https://github.com/dev07060/macos_file_manager/blob/main/lib/providers/tree_view_provider.dart"
    click TreeViewProviderGen "https://github.com/dev07060/macos_file_manager/blob/main/lib/providers/tree_view_provider.g.dart"
    click FavoritesProvider "https://github.com/dev07060/macos_file_manager/blob/main/lib/providers/favorites_provider.dart"
    click ThemeProvider "https://github.com/dev07060/macos_file_manager/blob/main/lib/providers/theme_provider.dart"
    click DirectoryService "https://github.com/dev07060/macos_file_manager/blob/main/lib/services/directory_service.dart"
    click FileSystemService "https://github.com/dev07060/macos_file_manager/blob/main/lib/services/file_system_service.dart"
    click SelectionService "https://github.com/dev07060/macos_file_manager/blob/main/lib/services/selection_service.dart"
    click DirectoryNodeData "https://github.com/dev07060/macos_file_manager/blob/main/lib/model/directory_node_data.dart"
    click FileSystemItem "https://github.com/dev07060/macos_file_manager/blob/main/lib/model/file_system_item.dart"
    click FavoriteDirectory "https://github.com/dev07060/macos_file_manager/blob/main/lib/model/favorite_directory.dart"
    click FileUtils "https://github.com/dev07060/macos_file_manager/blob/main/lib/utils/file_utils.dart"
    click DialogUtils "https://github.com/dev07060/macos_file_manager/blob/main/lib/utils/dialog_utils.dart"
    click ImageUtils "https://github.com/dev07060/macos_file_manager/blob/main/lib/utils/image_utils.dart"
    click ImageRotationStorage "https://github.com/dev07060/macos_file_manager/blob/main/lib/utils/image_rotation_storage.dart"
    click FileConstants "https://github.com/dev07060/macos_file_manager/blob/main/lib/constants/file_constants.dart"
    click Main "https://github.com/dev07060/macos_file_manager/blob/main/lib/main.dart"
    click AppTheme "https://github.com/dev07060/macos_file_manager/blob/main/lib/theme/app_theme.dart"
    click AppDelegate "https://github.com/dev07060/macos_file_manager/blob/main/macos/Runner/AppDelegate.swift"
    click MainFlutterWindow "https://github.com/dev07060/macos_file_manager/blob/main/macos/Runner/MainFlutterWindow.swift"
    click XcodeProject "https://github.com/dev07060/macos_file_manager/tree/main/macos/Runner.xcodeproj/"

    %% Styles
    classDef ui fill:#cce5ff,stroke:#004085,color:#004085
    classDef state fill:#d4edda,stroke:#155724,color:#155724
    classDef service fill:#fff3cd,stroke:#856404,color:#856404
    classDef model fill:#e2e3e5,stroke:#6c757d,color:#6c757d
    classDef util fill:#f8d7da,stroke:#721c24,color:#721c24
    classDef config fill:#d1ecf1,stroke:#0c5460,color:#0c5460
    classDef platform fill:#f5c6cb,stroke:#721c24,color:#721c24
    classDef external fill:#ffeeba,stroke:#856404,color:#856404
```
