# cnuf791/hotshare architecture

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

- Interactive diagram: https://gitdiagram.com/cnuf791/hotshare
- Repository: https://github.com/cnuf791/hotshare

## Overview

HotShare is a desktop-and-browser file-sharing app for devices on the same local network. A desktop user selects files to share; the app displays a dynamically detected address and QR code, while a browser can download shared files or upload files to the computer. The server updates desktop progress displays during transfers. The source excerpt shows the server, UI, and QR implementation; web progress and browser interactions are documented in the README, but the HTML contents were not provided.

Main entry points: [`serv.py`](https://github.com/cnuf791/hotshare/blob/main/serv.py) (HTTP server), [`QR.py`](https://github.com/cnuf791/hotshare/blob/main/QR.py) (QR generator), [`index.html`](https://github.com/cnuf791/hotshare/blob/main/index.html) (Web home), [`down.html`](https://github.com/cnuf791/hotshare/blob/main/down.html) (Download page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop app"]
  node_desktop_ui["Desktop UI<br/>[serv.py]"]
  node_ip_detection["IP detection<br/>[serv.py]"]
  node_qr_generator["QR generator<br/>[QR.py]"]
  node_file_selection["File selection<br/>[serv.py]"]
  node_progress_display["Progress display<br/>[serv.py]"]
end

subgraph group_server["HTTP sharing"]
  node_http_server["HTTP server<br/>[serv.py]"]
  node_shared_files["Shared files<br/>[serv.py]"]
  node_uploaded_files["Uploaded files<br/>[serv.py]"]
end

subgraph group_web["Browser pages"]
  node_web_home["Web home<br/>[index.html]"]
  node_download_page["Download page<br/>[down.html]"]
end

node_desktop_user(("Desktop user"))
node_browser(("Browser user"))

node_desktop_user -->|"uses"| node_desktop_ui
node_desktop_ui -->|"gets address"| node_ip_detection
node_desktop_ui -->|"generates QR"| node_qr_generator
node_desktop_ui -->|"selects files"| node_file_selection
node_desktop_ui -->|"starts server"| node_http_server
node_browser -->|"requests transfers"| node_http_server
node_http_server -->|"serves home"| node_web_home
node_http_server -->|"serves listing"| node_download_page
node_http_server -->|"reads for download"| node_shared_files
node_http_server -->|"writes uploads"| node_uploaded_files
node_http_server -->|"updates progress"| node_progress_display

click node_desktop_ui "https://github.com/cnuf791/hotshare/blob/main/serv.py"
click node_ip_detection "https://github.com/cnuf791/hotshare/blob/main/serv.py"
click node_qr_generator "https://github.com/cnuf791/hotshare/blob/main/QR.py"
click node_file_selection "https://github.com/cnuf791/hotshare/blob/main/serv.py"
click node_progress_display "https://github.com/cnuf791/hotshare/blob/main/serv.py"
click node_http_server "https://github.com/cnuf791/hotshare/blob/main/serv.py"
click node_shared_files "https://github.com/cnuf791/hotshare/blob/main/serv.py"
click node_uploaded_files "https://github.com/cnuf791/hotshare/blob/main/serv.py"
click node_web_home "https://github.com/cnuf791/hotshare/blob/main/index.html"
click node_download_page "https://github.com/cnuf791/hotshare/blob/main/down.html"

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_desktop_ui,node_ip_detection,node_qr_generator,node_file_selection,node_progress_display,node_desktop_user,node_browser toneBlue
class node_http_server,node_shared_files,node_uploaded_files toneAmber
class node_web_home,node_download_page toneMint
```

## Components

### Desktop app

- [Desktop UI](https://github.com/cnuf791/hotshare/blob/main/serv.py): `serv.py`
- [IP detection](https://github.com/cnuf791/hotshare/blob/main/serv.py): `serv.py`
- [QR generator](https://github.com/cnuf791/hotshare/blob/main/QR.py): `QR.py`
- [File selection](https://github.com/cnuf791/hotshare/blob/main/serv.py): `serv.py`
- [Progress display](https://github.com/cnuf791/hotshare/blob/main/serv.py): `serv.py`

### HTTP sharing

- [HTTP server](https://github.com/cnuf791/hotshare/blob/main/serv.py): `serv.py`
- [Shared files](https://github.com/cnuf791/hotshare/blob/main/serv.py): `serv.py`
- [Uploaded files](https://github.com/cnuf791/hotshare/blob/main/serv.py): `serv.py`

### Browser pages

- [Web home](https://github.com/cnuf791/hotshare/blob/main/index.html): `index.html`
- [Download page](https://github.com/cnuf791/hotshare/blob/main/down.html): `down.html`

### Other components

- **Desktop user**
- **Browser user**

## Connections

- Desktop user → Desktop UI: uses (evidence: `README.md`)
- Desktop UI → IP detection: gets address (evidence: `serv.py`)
- Desktop UI → QR generator: generates QR (evidence: `serv.py`)
- Desktop UI → File selection: selects files (evidence: `serv.py`)
- Desktop UI → HTTP server: starts server (evidence: `serv.py`)
- Browser user → HTTP server: requests transfers (evidence: `README.md`)
- HTTP server → Web home: serves home (evidence: `serv.py`)
- HTTP server → Download page: serves listing (evidence: `serv.py`)
- HTTP server → Shared files: reads for download (evidence: `serv.py`)
- HTTP server → Uploaded files: writes uploads (evidence: `serv.py`)
- HTTP server → Progress display: updates progress (evidence: `serv.py`)
