# harickshan1234/network_file_sharing architecture

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

- Interactive diagram: https://gitdiagram.com/harickshan1234/network_file_sharing
- Repository: https://github.com/harickshan1234/network_file_sharing

## Overview

File Share is a LAN file-transfer application. The documented workflow starts with a network scan, presents discovered IP/MAC addresses, opens a sender window for a selected device, and transfers a chosen file to a receiver that prompts for acceptance and saves it. The receiver’s socket protocol is visible in the sampled code; scanner-to-sender wiring is visible in near_by_pc.py. The sender excerpt connects to its configured target, but its default target is localhost; the graph does not assume runtime configuration beyond the documented workflow.

Main entry points: [`main.py`](https://github.com/harickshan1234/network_file_sharing/blob/main/main.py) (Sender window), [`near_by_pc.py`](https://github.com/harickshan1234/network_file_sharing/blob/main/near_by_pc.py) (ARP scan), [`receiver.py`](https://github.com/harickshan1234/network_file_sharing/blob/main/receiver.py) (TCP receiver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Device discovery"]
  node_scanner_ui["Scanner UI<br/>[near_by_pc.py]"]
  node_subnet["Subnet lookup<br/>[near_by_pc.py]"]
  node_arp_scan["ARP scan<br/>[near_by_pc.py]"]
  node_device_list["Device list<br/>[near_by_pc.py]"]
  node_device_details["Device details<br/>[near_by_pc.py]"]
end

subgraph group_sending["File sending"]
  node_sender_ui["Sender window<br/>[main.py]"]
  node_file_picker["File picker<br/>[main.py]"]
  node_transfer_thread["Transfer thread<br/>[main.py]"]
end

subgraph group_receiving["File receiving"]
  node_tcp_receiver["TCP receiver<br/>[receiver.py]"]
  node_acceptance["Acceptance prompt<br/>[receiver.py]"]
  node_download_folder[("Download folder<br/>[receiver.py]")]
end

node_user(("User"))
node_lan{{"Local network"}}

node_user -->|"starts scan"| node_scanner_ui
node_scanner_ui -->|"gets range"| node_subnet
node_subnet -->|"provides subnet"| node_arp_scan
node_arp_scan -->|"broadcasts ARP"| node_lan
node_arp_scan -->|"adds responses"| node_device_list
node_user -->|"selects device"| node_device_details
node_device_details -->|"opens for IP"| node_sender_ui
node_user -->|"chooses file"| node_file_picker
node_file_picker -->|"sets file path"| node_sender_ui
node_user -->|"starts sending"| node_sender_ui
node_sender_ui -->|"starts thread"| node_transfer_thread
node_transfer_thread -->|"sends TCP data"| node_tcp_receiver
node_tcp_receiver -->|"asks acceptance"| node_acceptance
node_acceptance -->|"requests decision"| node_user
node_tcp_receiver -->|"writes file"| node_download_folder

click node_scanner_ui "https://github.com/harickshan1234/network_file_sharing/blob/main/near_by_pc.py"
click node_subnet "https://github.com/harickshan1234/network_file_sharing/blob/main/near_by_pc.py"
click node_arp_scan "https://github.com/harickshan1234/network_file_sharing/blob/main/near_by_pc.py"
click node_device_list "https://github.com/harickshan1234/network_file_sharing/blob/main/near_by_pc.py"
click node_device_details "https://github.com/harickshan1234/network_file_sharing/blob/main/near_by_pc.py"
click node_sender_ui "https://github.com/harickshan1234/network_file_sharing/blob/main/main.py"
click node_file_picker "https://github.com/harickshan1234/network_file_sharing/blob/main/main.py"
click node_transfer_thread "https://github.com/harickshan1234/network_file_sharing/blob/main/main.py"
click node_tcp_receiver "https://github.com/harickshan1234/network_file_sharing/blob/main/receiver.py"
click node_acceptance "https://github.com/harickshan1234/network_file_sharing/blob/main/receiver.py"
click node_download_folder "https://github.com/harickshan1234/network_file_sharing/blob/main/receiver.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_scanner_ui,node_subnet,node_arp_scan,node_device_list,node_device_details,node_user toneBlue
class node_sender_ui,node_file_picker,node_transfer_thread toneAmber
class node_tcp_receiver,node_acceptance,node_download_folder toneMint
class node_lan toneIndigo
```

## Components

### Device discovery

- [Scanner UI](https://github.com/harickshan1234/network_file_sharing/blob/main/near_by_pc.py): `near_by_pc.py`
- [Subnet lookup](https://github.com/harickshan1234/network_file_sharing/blob/main/near_by_pc.py): `near_by_pc.py`
- [ARP scan](https://github.com/harickshan1234/network_file_sharing/blob/main/near_by_pc.py): `near_by_pc.py`
- [Device list](https://github.com/harickshan1234/network_file_sharing/blob/main/near_by_pc.py): `near_by_pc.py`
- [Device details](https://github.com/harickshan1234/network_file_sharing/blob/main/near_by_pc.py): `near_by_pc.py`

### File sending

- [Sender window](https://github.com/harickshan1234/network_file_sharing/blob/main/main.py): `main.py`
- [File picker](https://github.com/harickshan1234/network_file_sharing/blob/main/main.py): `main.py`
- [Transfer thread](https://github.com/harickshan1234/network_file_sharing/blob/main/main.py): `main.py`

### File receiving

- [TCP receiver](https://github.com/harickshan1234/network_file_sharing/blob/main/receiver.py): `receiver.py`
- [Acceptance prompt](https://github.com/harickshan1234/network_file_sharing/blob/main/receiver.py): `receiver.py`
- [Download folder](https://github.com/harickshan1234/network_file_sharing/blob/main/receiver.py): `receiver.py`

### Other components

- **User**
- **Local network**

## Connections

- User → Scanner UI: starts scan (evidence: `README.md`)
- Scanner UI → Subnet lookup: gets range (evidence: `near_by_pc.py`)
- Subnet lookup → ARP scan: provides subnet (evidence: `near_by_pc.py`)
- ARP scan → Local network: broadcasts ARP (evidence: `near_by_pc.py`)
- ARP scan → Device list: adds responses (evidence: `near_by_pc.py`)
- User → Device details: selects device (evidence: `README.md`)
- Device details → Sender window: opens for IP (evidence: `near_by_pc.py`)
- User → File picker: chooses file (evidence: `README.md`)
- File picker → Sender window: sets file path (evidence: `main.py`)
- User → Sender window: starts sending (evidence: `README.md`)
- Sender window → Transfer thread: starts thread (evidence: `main.py`)
- Transfer thread → TCP receiver: sends TCP data (evidence: `main.py`)
- TCP receiver → Acceptance prompt: asks acceptance (evidence: `receiver.py`)
- Acceptance prompt → User: requests decision (evidence: `receiver.py`)
- TCP receiver → Download folder: writes file (evidence: `receiver.py`)
