# llwill/syncclipboard architecture

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

- Interactive diagram: https://gitdiagram.com/llwill/syncclipboard
- Repository: https://github.com/llwill/syncclipboard

## Overview

##### Main Components

a. Client Applications:
- Windows Client (WinUI3-based)
- Linux/macOS Client (Avalonia-based)
- Mobile Clients (iOS/Android through various automation tools)

b. Server Components:
- Standalone Server (ASP.NET Core-based)
- Built-in Server (in desktop clients)
- WebDAV Server Support

c. Core Components:
- Clipboard Management System
- Synchronization Service
- Authentication System
- File/Image Processing System

**[Client Layer]**

**[Communication Layer]**

**[Server Layer]**

**[Storage Layer]**

##### Key Relationships to Highlight

- Client-Server Communication
- Authentication Flow
- Clipboard Data Synchronization
- File/Image Processing Pipeline
- Configuration Management

##### Implementation Details

- Core Libraries:
- Avalonia for Linux/macOS UI
- WinUI3 for Windows UI
- ASP.NET Core for Server
- ImageMagick for Image Processing

- Key Features:
- Text Synchronization
- Image/File Synchronization
- Automatic Background Sync
- Cross-Platform Support

##### Data Flow Indicators

- Clipboard Change Detection → Local Processing → Server Upload
- Server Update → Client Polling → Local Clipboard Update
- File/Image Upload → Processing → Storage → Distribution

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style Definitions
    classDef client fill:#b3e0ff,stroke:#333,stroke-width:2px
    classDef server fill:#ffcccc,stroke:#333,stroke-width:2px
    classDef core fill:#d9f2d9,stroke:#333,stroke-width:2px
    classDef storage fill:#ffe6cc,stroke:#333,stroke-width:2px
    classDef communication fill:#e6e6ff,stroke:#333,stroke-width:2px
    
    %% Client Layer
    subgraph Clients
        WinClient["Windows Client (WinUI3)"]
        LinuxMacClient["Linux/MacOS Client (Avalonia)"]
        MobileClient["Mobile Clients (iOS/Android)"]
        
        subgraph ClientComponents
            UIComponents["UI Components"]
            ClipboardMonitor["Clipboard Monitor"]
            LocalStorage["Local Storage"]
        end
    end
    
    %% Core Components
    subgraph CoreServices
        ClipboardMgmt["Clipboard Management"]
        SyncService["Synchronization Service"]
        FileProcessor["File/Image Processing"]
        ConfigMgmt["Configuration Management"]
        NotificationSys["Notification System"]
        CoreInterfaces["Core Abstract Interfaces"]
    end
    
    %% Server Layer
    subgraph Servers
        StandaloneServer["Standalone Server"]
        BuiltInServer["Built-in Server"]
        WebDAVServer["WebDAV Server"]
        AuthSystem["Authentication System"]
    end
    
    %% Relationships
    WinClient --> UIComponents
    LinuxMacClient --> UIComponents
    UIComponents --> ClipboardMonitor
    ClipboardMonitor --> LocalStorage
    
    ClipboardMonitor --> ClipboardMgmt
    ClipboardMgmt --> SyncService
    SyncService --> FileProcessor
    
    SyncService --> StandaloneServer
    SyncService --> BuiltInServer
    SyncService --> WebDAVServer
    
    StandaloneServer --> AuthSystem
    BuiltInServer --> AuthSystem
    WebDAVServer --> AuthSystem
    
    ConfigMgmt --> CoreInterfaces
    NotificationSys --> CoreInterfaces
    
    %% Click Events
    click WinClient "https://github.com/LLwill/SyncClipboard/tree/master/src/SyncClipboard.WinUI3/"
    click LinuxMacClient "https://github.com/LLwill/SyncClipboard/tree/master/src/SyncClipboard.Desktop/"
    click MobileClient "https://github.com/LLwill/SyncClipboard/tree/master/script/"
    click StandaloneServer "https://github.com/LLwill/SyncClipboard/tree/master/src/SyncClipboard.Server/"
    click AuthSystem "https://github.com/LLwill/SyncClipboard/tree/master/src/SyncClipboard.Server.Core/CredentialChecker/"
    click ClipboardMgmt "https://github.com/LLwill/SyncClipboard/tree/master/src/SyncClipboard.Core/Clipboard/"
    click SyncService "https://github.com/LLwill/SyncClipboard/tree/master/src/SyncClipboard.Core/UserServices/SyncService/"
    click FileProcessor "https://github.com/LLwill/SyncClipboard/tree/master/src/SyncClipboard.Core/Utilities/Image/"
    click CoreInterfaces "https://github.com/LLwill/SyncClipboard/tree/master/src/SyncClipboard.Abstract/"
    click WebDAVServer "https://github.com/LLwill/SyncClipboard/blob/master/src/SyncClipboard.Core/Utilities/Web/WebDav.cs"
    click NotificationSys "https://github.com/LLwill/SyncClipboard/tree/master/src/SyncClipboard.Abstract/Notification/"
    click ConfigMgmt "https://github.com/LLwill/SyncClipboard/tree/master/src/SyncClipboard.Core/Models/UserConfigs/"
    click UIComponents "https://github.com/LLwill/SyncClipboard/tree/master/src/SyncClipboard.Desktop/Views/"
    
    %% Style Applications
    class WinClient,LinuxMacClient,MobileClient client
    class StandaloneServer,BuiltInServer,WebDAVServer,AuthSystem server
    class ClipboardMgmt,SyncService,FileProcessor,ConfigMgmt,NotificationSys,CoreInterfaces core
    class LocalStorage storage
    class UIComponents,ClipboardMonitor communication
```
