# cnuf791/hotsharefile architecture

> Architecture diagram of the GitHub repository cnuf791/hotsharefile, 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/hotsharefile
- Repository: https://github.com/cnuf791/hotsharefile

## Overview

HotShareFile is an Android app that serves a local-network web interface for bidirectional file transfer. The main workflow is: select files in the app or share them into it, show a reachable address, then let a browser download those files or upload files to Android storage. The excerpts show server lifecycle, HTTP handling, progress collection, and storage operations; the QR-to-UI connection and some web-page behavior are documented but not fully shown in source.

Main entry points: [`app/src/main/java/com/hotsharefile/hotsharefile/SimpleHttpServer.kt`](https://github.com/cnuf791/hotsharefile/blob/main/app/src/main/java/com/hotsharefile/hotsharefile/SimpleHttpServer.kt) (HTTP server), [`app/src/main/java/com/hotsharefile/hotsharefile/MainActivity.kt`](https://github.com/cnuf791/hotsharefile/blob/main/app/src/main/java/com/hotsharefile/hotsharefile/MainActivity.kt) (App UI and setup), [`app/src/main/java/com/hotsharefile/hotsharefile/ProgressUpdate.kt`](https://github.com/cnuf791/hotsharefile/blob/main/app/src/main/java/com/hotsharefile/hotsharefile/ProgressUpdate.kt) (Progress updates), [`app/src/main/java/com/hotsharefile/hotsharefile/QR.kt`](https://github.com/cnuf791/hotsharefile/blob/main/app/src/main/java/com/hotsharefile/hotsharefile/QR.kt) (QR encoder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Android app"]
  node_activity["App UI and setup<br/>[MainActivity.kt]"]
  node_ip["Network address<br/>[MainActivity.kt]"]
  node_qr["QR encoder<br/>[QR.kt]"]
end

subgraph group_transfer["Local transfer"]
  node_progress["Progress updates<br/>[ProgressUpdate.kt]"]
  node_server["HTTP server"]
  node_media[("Android Downloads")]
end

subgraph group_web["Browser interface"]
  node_routes["Web request pages"]
  node_pages["HTML pages"]
end

node_sender(("Android user"))
node_browser(("Receiving device"))

node_sender -->|"selects or shares"| node_activity
node_activity -->|"starts server"| node_server
node_activity -->|"gets address"| node_ip
node_activity -.->|"generates QR"| node_qr
node_activity -->|"collects progress"| node_progress
node_server -->|"emits updates"| node_progress
node_browser -->|"sends requests"| node_server
node_server -->|"serves responses"| node_browser
node_server -->|"dispatches requests"| node_routes
node_server -->|"loads HTML"| node_pages
node_server -->|"writes uploads"| node_media
node_server -->|"reads shared files"| node_media

click node_activity "https://github.com/cnuf791/hotsharefile/blob/main/app/src/main/java/com/hotsharefile/hotsharefile/MainActivity.kt"
click node_ip "https://github.com/cnuf791/hotsharefile/blob/main/app/src/main/java/com/hotsharefile/hotsharefile/MainActivity.kt"
click node_qr "https://github.com/cnuf791/hotsharefile/blob/main/app/src/main/java/com/hotsharefile/hotsharefile/QR.kt"
click node_progress "https://github.com/cnuf791/hotsharefile/blob/main/app/src/main/java/com/hotsharefile/hotsharefile/ProgressUpdate.kt"
click node_server "https://github.com/cnuf791/hotsharefile/blob/main/app/src/main/java/com/hotsharefile/hotsharefile/SimpleHttpServer.kt"
click node_routes "https://github.com/cnuf791/hotsharefile/blob/main/app/src/main/java/com/hotsharefile/hotsharefile/SimpleHttpServer.kt"
click node_pages "https://github.com/cnuf791/hotsharefile/tree/main/app/src/main/assets"

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_activity,node_ip,node_qr,node_sender toneBlue
class node_progress,node_server,node_media toneAmber
class node_routes,node_pages toneMint
class node_browser toneIndigo
```

## Components

### Android app

- [App UI and setup](https://github.com/cnuf791/hotsharefile/blob/main/app/src/main/java/com/hotsharefile/hotsharefile/MainActivity.kt): `app/src/main/java/com/hotsharefile/hotsharefile/MainActivity.kt`
- [Network address](https://github.com/cnuf791/hotsharefile/blob/main/app/src/main/java/com/hotsharefile/hotsharefile/MainActivity.kt): `app/src/main/java/com/hotsharefile/hotsharefile/MainActivity.kt`
- [QR encoder](https://github.com/cnuf791/hotsharefile/blob/main/app/src/main/java/com/hotsharefile/hotsharefile/QR.kt): `app/src/main/java/com/hotsharefile/hotsharefile/QR.kt`

### Local transfer

- [Progress updates](https://github.com/cnuf791/hotsharefile/blob/main/app/src/main/java/com/hotsharefile/hotsharefile/ProgressUpdate.kt): `app/src/main/java/com/hotsharefile/hotsharefile/ProgressUpdate.kt`
- [HTTP server](https://github.com/cnuf791/hotsharefile/blob/main/app/src/main/java/com/hotsharefile/hotsharefile/SimpleHttpServer.kt): `app/src/main/java/com/hotsharefile/hotsharefile/SimpleHttpServer.kt`
- **Android Downloads**

### Browser interface

- [Web request pages](https://github.com/cnuf791/hotsharefile/blob/main/app/src/main/java/com/hotsharefile/hotsharefile/SimpleHttpServer.kt): `app/src/main/java/com/hotsharefile/hotsharefile/SimpleHttpServer.kt`
- [HTML pages](https://github.com/cnuf791/hotsharefile/tree/main/app/src/main/assets): `app/src/main/assets`

### Other components

- **Android user**
- **Receiving device**

## Connections

- Android user → App UI and setup: selects or shares (evidence: `README.md`)
- App UI and setup → HTTP server: starts server (evidence: `app/src/main/java/com/hotsharefile/hotsharefile/MainActivity.kt`)
- App UI and setup → Network address: gets address (evidence: `app/src/main/java/com/hotsharefile/hotsharefile/MainActivity.kt`)
- App UI and setup → QR encoder: generates QR (evidence: `README.md`)
- App UI and setup → Progress updates: collects progress (evidence: `app/src/main/java/com/hotsharefile/hotsharefile/MainActivity.kt`)
- HTTP server → Progress updates: emits updates (evidence: `app/src/main/java/com/hotsharefile/hotsharefile/SimpleHttpServer.kt`)
- Receiving device → HTTP server: sends requests (evidence: `README.md`)
- HTTP server → Receiving device: serves responses (evidence: `app/src/main/java/com/hotsharefile/hotsharefile/SimpleHttpServer.kt`)
- HTTP server → Web request pages: dispatches requests (evidence: `app/src/main/java/com/hotsharefile/hotsharefile/SimpleHttpServer.kt`)
- HTTP server → HTML pages: loads HTML (evidence: `app/src/main/java/com/hotsharefile/hotsharefile/SimpleHttpServer.kt`)
- HTTP server → Android Downloads: writes uploads (evidence: `app/src/main/java/com/hotsharefile/hotsharefile/SimpleHttpServer.kt`)
- HTTP server → Android Downloads: reads shared files (evidence: `app/src/main/java/com/hotsharefile/hotsharefile/SimpleHttpServer.kt`)
