# seemoo-lab/opendrop architecture

> Architecture diagram of the GitHub repository seemoo-lab/opendrop, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/seemoo-lab/opendrop
- Repository: https://github.com/seemoo-lab/opendrop

## Overview

OpenDrop is a command-line AirDrop-compatible file-sharing tool. Users discover nearby receivers, select one from saved discovery results, then send a file or URL; receiving mode advertises an HTTPS service and accepts incoming files. The graph separates discovery, sending, receiving, and configuration/support. The README documents major behaviors such as URL sending and automatic file acceptance; unsampled implementation details are not expanded beyond those documented capabilities.

Main entry points: [`opendrop/cli.py`](https://github.com/seemoo-lab/opendrop/blob/master/opendrop/cli.py) (Command orchestration), [`opendrop/client.py`](https://github.com/seemoo-lab/opendrop/blob/master/opendrop/client.py) (AirDrop client), [`opendrop/server.py`](https://github.com/seemoo-lab/opendrop/blob/master/opendrop/server.py) (HTTPS service), [`opendrop/config.py`](https://github.com/seemoo-lab/opendrop/blob/master/opendrop/config.py) (AirDrop configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["CLI workflow"]
  node_cli["Command orchestration<br/>[cli.py]"]
  node_report["Discovery results<br/>[cli.py]"]
end

subgraph group_sender["Sender protocol"]
  node_discovery["Service discovery<br/>[client.py]"]
  node_sender_client["AirDrop client<br/>[client.py]"]
end

subgraph group_receiver["Receiver protocol"]
  node_receiver_server["HTTPS service<br/>[server.py]"]
  node_request_handler["Request handling<br/>[server.py]"]
end

subgraph group_support["Configuration and support"]
  node_archive["File archiving<br/>[util.py]"]
  node_config["AirDrop configuration<br/>[config.py]"]
  node_helpers["Network and media helpers<br/>[util.py]"]
  node_credentials["Apple credentials<br/>[apple_root_ca.pem]"]
end

node_user(("CLI user"))
node_apple_peers(("Apple devices"))
node_mdns(("mDNS network"))

node_user -->|"runs command"| node_cli
node_cli -->|"creates config"| node_config
node_cli -->|"starts browsing"| node_discovery
node_discovery -->|"browses services"| node_mdns
node_cli -->|"writes and reads"| node_report
node_cli -->|"sends requests"| node_sender_client
node_sender_client -->|"sends HTTPS"| node_apple_peers
node_sender_client -->|"builds archive"| node_archive
node_sender_client -->|"uses utilities"| node_helpers
node_cli -->|"starts receiving"| node_receiver_server
node_receiver_server -->|"announces service"| node_mdns
node_receiver_server -->|"gets TLS context"| node_config
node_apple_peers -->|"posts requests"| node_request_handler
node_request_handler -->|"uses utilities"| node_helpers
node_request_handler -->|"returns responses"| node_apple_peers
node_config -->|"loads root CA"| node_credentials

click node_cli "https://github.com/seemoo-lab/opendrop/blob/master/opendrop/cli.py"
click node_discovery "https://github.com/seemoo-lab/opendrop/blob/master/opendrop/client.py"
click node_report "https://github.com/seemoo-lab/opendrop/blob/master/opendrop/cli.py"
click node_sender_client "https://github.com/seemoo-lab/opendrop/blob/master/opendrop/client.py"
click node_archive "https://github.com/seemoo-lab/opendrop/blob/master/opendrop/util.py"
click node_receiver_server "https://github.com/seemoo-lab/opendrop/blob/master/opendrop/server.py"
click node_request_handler "https://github.com/seemoo-lab/opendrop/blob/master/opendrop/server.py"
click node_config "https://github.com/seemoo-lab/opendrop/blob/master/opendrop/config.py"
click node_helpers "https://github.com/seemoo-lab/opendrop/blob/master/opendrop/util.py"
click node_credentials "https://github.com/seemoo-lab/opendrop/blob/master/opendrop/certs/apple_root_ca.pem"

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_report,node_user toneBlue
class node_discovery,node_sender_client toneAmber
class node_receiver_server,node_request_handler toneMint
class node_archive,node_config,node_helpers,node_credentials toneRose
class node_apple_peers,node_mdns toneIndigo
```

## Components

### CLI workflow

- [Command orchestration](https://github.com/seemoo-lab/opendrop/blob/master/opendrop/cli.py): `opendrop/cli.py`
- [Discovery results](https://github.com/seemoo-lab/opendrop/blob/master/opendrop/cli.py): `opendrop/cli.py`

### Sender protocol

- [Service discovery](https://github.com/seemoo-lab/opendrop/blob/master/opendrop/client.py): `opendrop/client.py`
- [AirDrop client](https://github.com/seemoo-lab/opendrop/blob/master/opendrop/client.py): `opendrop/client.py`

### Receiver protocol

- [HTTPS service](https://github.com/seemoo-lab/opendrop/blob/master/opendrop/server.py): `opendrop/server.py`
- [Request handling](https://github.com/seemoo-lab/opendrop/blob/master/opendrop/server.py): `opendrop/server.py`

### Configuration and support

- [File archiving](https://github.com/seemoo-lab/opendrop/blob/master/opendrop/util.py): `opendrop/util.py`
- [AirDrop configuration](https://github.com/seemoo-lab/opendrop/blob/master/opendrop/config.py): `opendrop/config.py`
- [Network and media helpers](https://github.com/seemoo-lab/opendrop/blob/master/opendrop/util.py): `opendrop/util.py`
- [Apple credentials](https://github.com/seemoo-lab/opendrop/blob/master/opendrop/certs/apple_root_ca.pem): `opendrop/certs/apple_root_ca.pem`

### Other components

- **CLI user**
- **Apple devices**
- **mDNS network**

## Connections

- CLI user → Command orchestration: runs command (evidence: `README.md`)
- Command orchestration → AirDrop configuration: creates config (evidence: `opendrop/cli.py`)
- Command orchestration → Service discovery: starts browsing (evidence: `opendrop/cli.py`)
- Service discovery → mDNS network: browses services (evidence: `opendrop/client.py`)
- Command orchestration → Discovery results: writes and reads (evidence: `opendrop/cli.py`)
- Command orchestration → AirDrop client: sends requests (evidence: `opendrop/cli.py`)
- AirDrop client → Apple devices: sends HTTPS (evidence: `opendrop/client.py`)
- AirDrop client → File archiving: builds archive (evidence: `opendrop/client.py`)
- AirDrop client → Network and media helpers: uses utilities (evidence: `opendrop/client.py`)
- Command orchestration → HTTPS service: starts receiving (evidence: `opendrop/cli.py`)
- HTTPS service → mDNS network: announces service (evidence: `opendrop/server.py`)
- HTTPS service → AirDrop configuration: gets TLS context (evidence: `opendrop/server.py`)
- Apple devices → Request handling: posts requests (evidence: `README.md`)
- Request handling → Network and media helpers: uses utilities (evidence: `opendrop/server.py`)
- Request handling → Apple devices: returns responses (evidence: `opendrop/server.py`)
- AirDrop configuration → Apple credentials: loads root CA (evidence: `opendrop/config.py`)
