# mimi83982/dropspace architecture

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

- Interactive diagram: https://gitdiagram.com/mimi83982/dropspace
- Repository: https://github.com/mimi83982/dropspace

## Overview

This is a browser-based peer-to-peer file-sharing app. A sender creates a room link, selects or drops a file, and sends metadata plus buffered chunks over a peer connection; a receiver joins using the room ID, rebuilds the file, and downloads it. The single runtime file contains both roles and the transfer logic. The README provides no additional capability details, and the tree has no separate implementation modules.

Main entry points: [`app.js`](https://github.com/mimi83982/dropspace/blob/main/app.js) (Peer connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sharing["File sharing"]
  node_peer_connection["Peer connection<br/>[app.js]"]
  node_chunk_transfer["Chunk transfer<br/>[app.js]"]
  node_download["Rebuild and download<br/>[app.js]"]
end

subgraph group_interface["Browser interface"]
  node_sender_ui["Select and share<br/>[app.js]"]
end

node_sender(("Sender"))
node_receiver(("Receiver"))
node_peerjs["PeerJS network"]
node_qrcode["QR code generator"]

node_sender -->|"selects file"| node_sender_ui
node_sender_ui -.->|"generates link QR"| node_qrcode
node_sender_ui -->|"shares room link"| node_peer_connection
node_peer_connection -->|"opens peer connection"| node_peerjs
node_peerjs -->|"dispatches connection"| node_peer_connection
node_peer_connection -->|"opens transfer"| node_chunk_transfer
node_chunk_transfer -->|"sends metadata and chunks"| node_peer_connection
node_peer_connection -->|"dispatches received data"| node_download
node_receiver -->|"joins room"| node_peer_connection
node_download -->|"triggers file download"| node_receiver

click node_sender_ui "https://github.com/mimi83982/dropspace/blob/main/app.js"
click node_peer_connection "https://github.com/mimi83982/dropspace/blob/main/app.js"
click node_chunk_transfer "https://github.com/mimi83982/dropspace/blob/main/app.js"
click node_download "https://github.com/mimi83982/dropspace/blob/main/app.js"

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_peer_connection,node_chunk_transfer,node_download toneBlue
class node_sender_ui toneAmber
class node_sender,node_receiver,node_peerjs,node_qrcode toneIndigo
```

## Components

### File sharing

- [Peer connection](https://github.com/mimi83982/dropspace/blob/main/app.js): `app.js`
- [Chunk transfer](https://github.com/mimi83982/dropspace/blob/main/app.js): `app.js`
- [Rebuild and download](https://github.com/mimi83982/dropspace/blob/main/app.js): `app.js`

### Browser interface

- [Select and share](https://github.com/mimi83982/dropspace/blob/main/app.js): `app.js`

### Other components

- **Sender**
- **Receiver**
- **PeerJS network**
- **QR code generator**

## Connections

- Sender → Select and share: selects file (evidence: `app.js`)
- Select and share → QR code generator: generates link QR (evidence: `app.js`)
- Select and share → Peer connection: shares room link (evidence: `app.js`)
- Peer connection → PeerJS network: opens peer connection (evidence: `app.js`)
- PeerJS network → Peer connection: dispatches connection (evidence: `app.js`)
- Peer connection → Chunk transfer: opens transfer (evidence: `app.js`)
- Chunk transfer → Peer connection: sends metadata and chunks (evidence: `app.js`)
- Peer connection → Rebuild and download: dispatches received data (evidence: `app.js`)
- Receiver → Peer connection: joins room (evidence: `app.js`)
- Rebuild and download → Receiver: triggers file download (evidence: `app.js`)
