# binary-shadowmonarch/clippy-share architecture

> Architecture diagram of the GitHub repository binary-shadowmonarch/clippy-share, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/binary-shadowmonarch/clippy-share
- Repository: https://github.com/binary-shadowmonarch/clippy-share

## Overview

Clippy-share is a local-network clipboard-sharing application: clipboard text is broadcast to peers and targeted incoming text may be applied locally. The main runtime is the core daemon, with platform clipboard adapters, peer discovery and messaging, and policy checks. Android enters through a JNI bridge; the CLI configures and starts the daemon. The README mentions sharing files, but the sampled daemon ignores raw clipboard payloads, and the crypto engine is a stub with no demonstrated runtime wiring. Some Android and network details are inferred only from names or documentation.

Main entry points: [`core-daemon/src/lib.rs`](https://github.com/binary-shadowmonarch/clippy-share/blob/main/core-daemon/src/lib.rs) (Core daemon), [`platform-adapters/src/lib.rs`](https://github.com/binary-shadowmonarch/clippy-share/blob/main/platform-adapters/src/lib.rs) (Adapter selection), [`mobile-bridge/src/lib.rs`](https://github.com/binary-shadowmonarch/clippy-share/blob/main/mobile-bridge/src/lib.rs) (JNI bridge), [`net/src/lib.rs`](https://github.com/binary-shadowmonarch/clippy-share/blob/main/net/src/lib.rs) (Network service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Application entry points"]
  node_cli["CLI<br/>[main.rs]"]
  node_android_app["Android app<br/>[MainActivity.kt]"]
  node_jni["JNI bridge<br/>[lib.rs]"]
end

subgraph group_daemon["Clipboard orchestration"]
  node_daemon["Core daemon<br/>[lib.rs]"]
  node_policy["Peer policy<br/>[policy.rs]"]
end

subgraph group_platform["Platform clipboard"]
  node_adapter["Adapter selection<br/>[lib.rs]"]
  node_android_clip["Android clipboard<br/>[mod.rs]"]
  node_wayland["Wayland clipboard<br/>[mod.rs]"]
  node_x11["X11 clipboard<br/>[mod.rs]"]
  node_windows["Windows clipboard<br/>[mod.rs]"]
  node_portal["Portal adapter<br/>[portal.rs]"]
  node_wlroots["wlroots adapter<br/>[wlroots.rs]"]
end

subgraph group_network["Peer networking"]
  node_net["Network service<br/>[lib.rs]"]
end

node_user(("Device user"))
node_peers(("LAN peers"))

node_user -->|"uses"| node_android_app
node_android_app -->|"starts daemon"| node_jni
node_jni -->|"starts"| node_daemon
node_jni -->|"forwards clipboard"| node_android_clip
node_daemon -->|"selects adapter"| node_adapter
node_daemon -->|"starts network"| node_net
node_daemon -->|"checks targets"| node_policy
node_adapter -->|"selects on Android"| node_android_clip
node_adapter -->|"selects on Wayland"| node_wayland
node_adapter -->|"selects on X11"| node_x11
node_adapter -->|"selects on Windows"| node_windows
node_wayland -->|"delegates to"| node_wlroots
node_wayland -.->|"potential backend"| node_portal
node_android_clip -->|"applies remote text"| node_jni
node_cli -->|"configures and starts"| node_daemon
node_daemon -->|"broadcasts text"| node_net
node_net -->|"delivers events"| node_daemon
node_net -->|"exchanges messages"| node_peers

click node_cli "https://github.com/binary-shadowmonarch/clippy-share/blob/main/cli/src/main.rs"
click node_android_app "https://github.com/binary-shadowmonarch/clippy-share/blob/main/android/app/src/main/java/com/example/clippyshare/MainActivity.kt"
click node_jni "https://github.com/binary-shadowmonarch/clippy-share/blob/main/mobile-bridge/src/lib.rs"
click node_daemon "https://github.com/binary-shadowmonarch/clippy-share/blob/main/core-daemon/src/lib.rs"
click node_policy "https://github.com/binary-shadowmonarch/clippy-share/blob/main/core-daemon/src/policy.rs"
click node_adapter "https://github.com/binary-shadowmonarch/clippy-share/blob/main/platform-adapters/src/lib.rs"
click node_android_clip "https://github.com/binary-shadowmonarch/clippy-share/blob/main/platform-adapters/src/android/mod.rs"
click node_wayland "https://github.com/binary-shadowmonarch/clippy-share/blob/main/platform-adapters/src/wayland/mod.rs"
click node_x11 "https://github.com/binary-shadowmonarch/clippy-share/blob/main/platform-adapters/src/x11/mod.rs"
click node_windows "https://github.com/binary-shadowmonarch/clippy-share/blob/main/platform-adapters/src/windows/mod.rs"
click node_portal "https://github.com/binary-shadowmonarch/clippy-share/blob/main/platform-adapters/src/wayland/portal.rs"
click node_wlroots "https://github.com/binary-shadowmonarch/clippy-share/blob/main/platform-adapters/src/wayland/wlroots.rs"
click node_net "https://github.com/binary-shadowmonarch/clippy-share/blob/main/net/src/lib.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_android_app,node_jni,node_user toneBlue
class node_daemon,node_policy toneAmber
class node_adapter,node_android_clip,node_wayland,node_x11,node_windows,node_portal,node_wlroots toneMint
class node_net toneRose
class node_peers toneIndigo
```

## Components

### Application entry points

- [CLI](https://github.com/binary-shadowmonarch/clippy-share/blob/main/cli/src/main.rs): `cli/src/main.rs`
- [Android app](https://github.com/binary-shadowmonarch/clippy-share/blob/main/android/app/src/main/java/com/example/clippyshare/MainActivity.kt): `android/app/src/main/java/com/example/clippyshare/MainActivity.kt`
- [JNI bridge](https://github.com/binary-shadowmonarch/clippy-share/blob/main/mobile-bridge/src/lib.rs): `mobile-bridge/src/lib.rs`

### Clipboard orchestration

- [Core daemon](https://github.com/binary-shadowmonarch/clippy-share/blob/main/core-daemon/src/lib.rs): `core-daemon/src/lib.rs`
- [Peer policy](https://github.com/binary-shadowmonarch/clippy-share/blob/main/core-daemon/src/policy.rs): `core-daemon/src/policy.rs`

### Platform clipboard

- [Adapter selection](https://github.com/binary-shadowmonarch/clippy-share/blob/main/platform-adapters/src/lib.rs): `platform-adapters/src/lib.rs`
- [Android clipboard](https://github.com/binary-shadowmonarch/clippy-share/blob/main/platform-adapters/src/android/mod.rs): `platform-adapters/src/android/mod.rs`
- [Wayland clipboard](https://github.com/binary-shadowmonarch/clippy-share/blob/main/platform-adapters/src/wayland/mod.rs): `platform-adapters/src/wayland/mod.rs`
- [X11 clipboard](https://github.com/binary-shadowmonarch/clippy-share/blob/main/platform-adapters/src/x11/mod.rs): `platform-adapters/src/x11/mod.rs`
- [Windows clipboard](https://github.com/binary-shadowmonarch/clippy-share/blob/main/platform-adapters/src/windows/mod.rs): `platform-adapters/src/windows/mod.rs`
- [Portal adapter](https://github.com/binary-shadowmonarch/clippy-share/blob/main/platform-adapters/src/wayland/portal.rs): `platform-adapters/src/wayland/portal.rs`
- [wlroots adapter](https://github.com/binary-shadowmonarch/clippy-share/blob/main/platform-adapters/src/wayland/wlroots.rs): `platform-adapters/src/wayland/wlroots.rs`

### Peer networking

- [Network service](https://github.com/binary-shadowmonarch/clippy-share/blob/main/net/src/lib.rs): `net/src/lib.rs`

### Other components

- **Device user**
- **LAN peers**

## Connections

- Device user → Android app: uses
- Android app → JNI bridge: starts daemon
- JNI bridge → Core daemon: starts
- JNI bridge → Android clipboard: forwards clipboard
- Core daemon → Adapter selection: selects adapter
- Core daemon → Network service: starts network
- Core daemon → Peer policy: checks targets
- Adapter selection → Android clipboard: selects on Android
- Adapter selection → Wayland clipboard: selects on Wayland
- Adapter selection → X11 clipboard: selects on X11
- Adapter selection → Windows clipboard: selects on Windows
- Wayland clipboard → wlroots adapter: delegates to
- Wayland clipboard → Portal adapter: potential backend
- Android clipboard → JNI bridge: applies remote text
- CLI → Core daemon: configures and starts
- Core daemon → Network service: broadcasts text
- Network service → Core daemon: delivers events
- Network service → LAN peers: exchanges messages
