# hmidani-abdelilah/localsendpro architecture

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

- Interactive diagram: https://gitdiagram.com/hmidani-abdelilah/localsendpro
- Repository: https://github.com/hmidani-abdelilah/localsendpro

## Overview

LocalSend Pro is a cross-platform local-network file and text sharing app. The main workflow is: discover peers, select a recipient, send a message or request file approval, transfer content over TCP, and save received files. The README also describes persistent settings, language and theme choices, transfer-speed/status display, and completion audio. The app is concentrated in main.py; source excerpts show portions of its networking and settings behavior, while some documented capabilities are not shown in detail.

Main entry points: [`main.py`](https://github.com/hmidani-abdelilah/localsendpro/blob/main/main.py) (Flet app), [`crypto_utils.py`](https://github.com/hmidani-abdelilah/localsendpro/blob/main/crypto_utils.py) (Encryption)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and settings"]
  node_app["Flet app<br/>[main.py]"]
  node_settings[("Settings store<br/>[main.py]")]
end

subgraph group_network["Peer networking"]
  node_discovery["Peer discovery<br/>[main.py]"]
  node_mdns(("Local network peers"))
  node_tcp["TCP transfer service<br/>[main.py]"]
end

subgraph group_transfer["Transfer and security"]
  node_approval["File approval<br/>[main.py]"]
  node_crypto["Encryption<br/>[crypto_utils.py]"]
  node_received["Received files<br/>[main.py]"]
end

subgraph group_experience["User experience"]
  node_status["Transfer status<br/>[main.py]"]
  node_preferences["Language and theme<br/>[main.py]"]
  node_notification["Completion sound<br/>[main.py]"]
end

node_user(("User"))
node_peer(("Peer device"))

node_user -->|"uses"| node_app
node_app -->|"reads and writes"| node_settings
node_app -->|"starts discovery"| node_discovery
node_discovery -->|"browses and advertises"| node_mdns
node_mdns -->|"announces peers"| node_discovery
node_app -->|"starts service"| node_tcp
node_app -->|"transfers over TCP"| node_peer
node_peer -->|"sends incoming data"| node_tcp
node_tcp -->|"requests approval"| node_approval
node_approval -->|"requests decision"| node_user
node_app -->|"uses encryption"| node_crypto
node_tcp -->|"saves accepted files"| node_received
node_app -->|"shows connection and speed"| node_status
node_user -->|"configures"| node_preferences
node_app -->|"plays on receipt"| node_notification

click node_app "https://github.com/hmidani-abdelilah/localsendpro/blob/main/main.py"
click node_settings "https://github.com/hmidani-abdelilah/localsendpro/blob/main/main.py"
click node_discovery "https://github.com/hmidani-abdelilah/localsendpro/blob/main/main.py"
click node_tcp "https://github.com/hmidani-abdelilah/localsendpro/blob/main/main.py"
click node_approval "https://github.com/hmidani-abdelilah/localsendpro/blob/main/main.py"
click node_crypto "https://github.com/hmidani-abdelilah/localsendpro/blob/main/crypto_utils.py"
click node_received "https://github.com/hmidani-abdelilah/localsendpro/blob/main/main.py"
click node_status "https://github.com/hmidani-abdelilah/localsendpro/blob/main/main.py"
click node_preferences "https://github.com/hmidani-abdelilah/localsendpro/blob/main/main.py"
click node_notification "https://github.com/hmidani-abdelilah/localsendpro/blob/main/main.py"

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_app,node_settings,node_user toneBlue
class node_discovery,node_mdns,node_tcp toneAmber
class node_approval,node_crypto,node_received toneMint
class node_status,node_preferences,node_notification toneRose
class node_peer toneIndigo
```

## Components

### App and settings

- [Flet app](https://github.com/hmidani-abdelilah/localsendpro/blob/main/main.py): `main.py`
- [Settings store](https://github.com/hmidani-abdelilah/localsendpro/blob/main/main.py): `main.py`

### Peer networking

- [Peer discovery](https://github.com/hmidani-abdelilah/localsendpro/blob/main/main.py): `main.py`
- **Local network peers**
- [TCP transfer service](https://github.com/hmidani-abdelilah/localsendpro/blob/main/main.py): `main.py`

### Transfer and security

- [File approval](https://github.com/hmidani-abdelilah/localsendpro/blob/main/main.py): `main.py`
- [Encryption](https://github.com/hmidani-abdelilah/localsendpro/blob/main/crypto_utils.py): `crypto_utils.py`
- [Received files](https://github.com/hmidani-abdelilah/localsendpro/blob/main/main.py): `main.py`

### User experience

- [Transfer status](https://github.com/hmidani-abdelilah/localsendpro/blob/main/main.py): `main.py`
- [Language and theme](https://github.com/hmidani-abdelilah/localsendpro/blob/main/main.py): `main.py`
- [Completion sound](https://github.com/hmidani-abdelilah/localsendpro/blob/main/main.py): `main.py`

### Other components

- **User**
- **Peer device**

## Connections

- User → Flet app: uses (evidence: `README.md`)
- Flet app → Settings store: reads and writes (evidence: `README.md`)
- Flet app → Peer discovery: starts discovery (evidence: `main.py`)
- Peer discovery → Local network peers: browses and advertises (evidence: `main.py`)
- Local network peers → Peer discovery: announces peers (evidence: `main.py`)
- Flet app → TCP transfer service: starts service (evidence: `main.py`)
- Flet app → Peer device: transfers over TCP (evidence: `README.md`)
- Peer device → TCP transfer service: sends incoming data (evidence: `README.md`)
- TCP transfer service → File approval: requests approval (evidence: `main.py`)
- File approval → User: requests decision (evidence: `main.py`)
- Flet app → Encryption: uses encryption (evidence: `README.md`)
- TCP transfer service → Received files: saves accepted files (evidence: `main.py`)
- Flet app → Transfer status: shows connection and speed (evidence: `README.md`)
- User → Language and theme: configures (evidence: `README.md`)
- Flet app → Completion sound: plays on receipt (evidence: `main.py`)
