# rsyncosx/rsyncui architecture

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

- Interactive diagram: https://gitdiagram.com/rsyncosx/rsyncui
- Repository: https://github.com/rsyncosx/rsyncui

## Overview

##### Project Type and Purpose
- RsyncUI is a native macOS application written in SwiftUI. Its main purpose is to serve as a graphical interface to the command-line tool rsync.
- The app organizes tasks, sets up parameters, and executes external rsync commands while monitoring progress and allowing aborts.
- In addition, the repository contains widget targets (WidgetEstimate and WidgetVerify) and an XPC service, which hints at components for background processing or sandboxed interaction with system-level resources.

##### Analysis of the File Structure
- Top-Level Project Setup:
- The main Xcode project (RsyncUI.xcodeproj) and configuration files (e.g., swiftlint.yml, Makefile, .gitignore) show standard macOS/Swift project conventions.
- Core Application Directory (RsyncUI):
- Subdirectories like “Main”, “Model”, “Views”, “Assets”, and localization files indicate a clear separation of app logic.
- The “Model” subdirectory is extensive. It covers application components such as:
- Data handling (Configurations, FilesAndCatalogs, Global settings, Storage in JSON, etc.)
- Task execution (Execution, Process handling, Execution states, estimation, progress, etc.)
- Utilities (helpers for file paths, resources, network communications like the yudpsocket tools).
- UI Layer:
- The “Views” directory contains folders for different screens (Add, Configurations, Detailsview, ExportImport, LogRecords, Quicktask, Restore, RsyncParameters, Settings, Sidebar, Snapshots, Tasks, Tools, VerifyRemote). This signals a comprehensive, component-based SwiftUI UI.
- Widget Targets:
- Separate directories “WidgetEstimate” and “WidgetVerify” indicate extension points for widget functionality.
- XPC Service:
- The XPC folder includes its own code (XPC.swift, XPCProtocol.swift, etc.) which is used for interprocess communication or dedicated background tasks.
- Versioning and distribution files:
- Files like Licence.MD, Credits.rtf, and versionRsyncUI confirm the project’s maturity and distribution channels.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend Layer"
        UI_Views("SwiftUI Views"):::frontend
        subgraph "Widget Extensions"
            Widget_Estimate("WidgetEstimate"):::widget
            Widget_Verify("WidgetVerify"):::widget
        end
    end

    subgraph "Backend Layer"
        Model("Business Logic / Model"):::backend
        subgraph "External Task Executor"
            Process("Process Handling"):::external
            Execution("Execution Management"):::external
        end
        subgraph "Data Persistence"
            Storage("Storage (JSON)"):::database
            ExportImport("Export/Import"):::database
        end
        XPC("XPC Service"):::service
    end

    UI_Views -->|"triggers"| Model
    Widget_Estimate -->|"syncs"| Model
    Widget_Verify -->|"syncs"| Model
    Model -->|"executes"| Process
    Model -->|"monitors"| Execution
    Process -->|"progress"| Model
    Execution -->|"updates"| Model
    Model -->|"read/write"| Storage
    Model -->|"import/export"| ExportImport
    Model -->|"delegates"| XPC

    classDef frontend fill:#B3E5FC,stroke:#0277BD,stroke-width:2px;
    classDef backend fill:#C8E6C9,stroke:#388E3C,stroke-width:2px;
    classDef external fill:#FFE082,stroke:#FF6F00,stroke-width:2px;
    classDef database fill:#F8BBD0,stroke:#C2185B,stroke-width:2px;
    classDef service fill:#D1C4E9,stroke:#512DA8,stroke-width:2px;
    classDef widget fill:#FFCCBC,stroke:#D84315,stroke-width:2px;

    click UI_Views "https://github.com/rsyncosx/rsyncui/tree/main/RsyncUI/Views"
    click Widget_Estimate "https://github.com/rsyncosx/rsyncui/tree/main/WidgetEstimate"
    click Widget_Verify "https://github.com/rsyncosx/rsyncui/tree/main/WidgetVerify"
    click Model "https://github.com/rsyncosx/rsyncui/tree/main/RsyncUI/Model"
    click Process "https://github.com/rsyncosx/rsyncui/tree/main/RsyncUI/Model/Process"
    click Execution "https://github.com/rsyncosx/rsyncui/tree/main/RsyncUI/Model/Execution"
    click Storage "https://github.com/rsyncosx/rsyncui/tree/main/RsyncUI/Model/Storage"
    click ExportImport "https://github.com/rsyncosx/rsyncui/tree/main/RsyncUI/Model/Storage/ExportImport"
    click XPC "https://github.com/rsyncosx/rsyncui/tree/main/XPC"
```
