# arandomboiisme/clipshare architecture

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

- Interactive diagram: https://gitdiagram.com/arandomboiisme/clipshare
- Repository: https://github.com/arandomboiisme/clipshare

## Overview

##### Main Components

a) Device Nodes:
- Each device node should contain:
- Python Runtime Environment
- Platform-specific clipboard handlers (xclip for Linux, Termux API for Android)
- Local clipboard storage

b) Network Layer:
- Shared network environment (WiFi/Hotspot)
- Subnet configuration (/24 default)

##### Component Relationships

- Connection lines through the network layer

##### Detailed Component Breakdown

For each device node, show the internal structure:
**Device Node {**
- Clipboard Handler (Platform Specific)
- ↕
- Python Components:
- main.py (Entry Point)
- clip.py (Clipboard Operations)
- connection.py (Network Communications)
- config.py (Configuration Management)
**}**

##### Technical Details

- Network Protocol indicators
- Required dependencies for each platform:
- Windows: Python only
- Linux: Python + xclip
- Android: Termux + Termux:API + Python

##### Data Flow Representation

Clipboard synchronization process:
##### Remote clipboard update

Remember to include a note about the configuration file (config.ini) and its role in network setup, as this is crucial for the system's operation.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Legend
        L1[Device Node]
        L2[/Platform Requirement/]
        L3[(Clipboard Storage)]
        L4{{Network Component}}
        style L1 fill:#f5f5f5,stroke:#333
        style L2 fill:#e1e1e1,stroke:#333
        style L3 fill:#d1d1d1,stroke:#333
        style L4 fill:#c1c1c1,stroke:#333
    end

    subgraph Network["Network Layer (WiFi/Hotspot)"]
        NET{{Shared Network Environment}}
        SUBNET["/24 Subnet Configuration/"]
    end

    subgraph Windows["Windows Device"]
        W_CLIP["Clipboard Handler"]
        W_STORE[(Local Storage)]
        W_REQ[/"Python Runtime"/]
        
        subgraph W_PY["Python Components"]
            W_MAIN["main.py"]
            W_CLIP_PY["clip.py"]
            W_CONN["connection.py"]
            W_CONF["config.py"]
            W_CONF_INI["config.ini"]
        end
    end

    subgraph Linux["Linux Device"]
        L_CLIP["Clipboard Handler"]
        L_STORE[(Local Storage)]
        L_REQ[/"Python + xclip"/]
        
        subgraph L_PY["Python Components"]
            L_MAIN["main.py"]
            L_CLIP_PY["clip.py"]
            L_CONN["connection.py"]
            L_CONF["config.py"]
            L_CONF_INI["config.ini"]
        end
    end

    subgraph Android["Android Device"]
        A_CLIP["Clipboard Handler"]
        A_STORE[(Local Storage)]
        A_REQ[/"Termux + Termux:API + Python"/]
        
        subgraph A_PY["Python Components"]
            A_MAIN["main.py"]
            A_CLIP_PY["clip.py"]
            A_CONN["connection.py"]
            A_CONF["config.py"]
            A_CONF_INI["config.ini"]
        end
    end

    %% Connections
    W_CLIP <--> W_STORE
    L_CLIP <--> L_STORE
    A_CLIP <--> A_STORE

    W_CLIP <--> W_MAIN
    L_CLIP <--> L_MAIN
    A_CLIP <--> A_MAIN

    NET -..- Windows
    NET -..- Linux
    NET -..- Android

    %% Click events
    click W_MAIN "https://github.com/ARandomBoiIsMe/clipshare/blob/main/main.py"
    click W_CLIP_PY "https://github.com/ARandomBoiIsMe/clipshare/blob/main/clip.py"
    click W_CONN "https://github.com/ARandomBoiIsMe/clipshare/blob/main/connection.py"
    click W_CONF "https://github.com/ARandomBoiIsMe/clipshare/blob/main/config.py"
    click W_CONF_INI "https://github.com/ARandomBoiIsMe/clipshare/blob/main/config.ini"
    click L_MAIN "https://github.com/ARandomBoiIsMe/clipshare/blob/main/main.py"
    click L_CLIP_PY "https://github.com/ARandomBoiIsMe/clipshare/blob/main/clip.py"
    click L_CONN "https://github.com/ARandomBoiIsMe/clipshare/blob/main/connection.py"
    click L_CONF "https://github.com/ARandomBoiIsMe/clipshare/blob/main/config.py"
    click L_CONF_INI "https://github.com/ARandomBoiIsMe/clipshare/blob/main/config.ini"
    click A_MAIN "https://github.com/ARandomBoiIsMe/clipshare/blob/main/main.py"
    click A_CLIP_PY "https://github.com/ARandomBoiIsMe/clipshare/blob/main/clip.py"
    click A_CONN "https://github.com/ARandomBoiIsMe/clipshare/blob/main/connection.py"
    click A_CONF "https://github.com/ARandomBoiIsMe/clipshare/blob/main/config.py"
    click A_CONF_INI "https://github.com/ARandomBoiIsMe/clipshare/blob/main/config.ini"

    classDef windows fill:#add8e6,stroke:#333
    classDef linux fill:#ffa500,stroke:#333
    classDef android fill:#90ee90,stroke:#333
    classDef network fill:#f0f0f0,stroke:#333

    class Windows windows
    class Linux linux
    class Android android
    class Network network
```
