# shivamyadav25/fast-transfer architecture

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

- Interactive diagram: https://gitdiagram.com/shivamyadav25/fast-transfer
- Repository: https://github.com/shivamyadav25/fast-transfer

## Overview

Kimo pairs users with a short code, negotiates WebRTC through a signaling-only service, then transfers files directly between devices. Its main workflow covers pairing, peer connection setup, chunked transfer, progress and integrity verification, and saving the received file; reconnect/resume and configurable relay support extend that path. A separate stored-transfer path encrypts files locally and stores ciphertext for later retrieval. The README documents desktop and mobile shells around the web app. Some subsystems are represented by their exact enclosing paths because their source was not sampled.

Main entry points: [`apps/web/app/page.tsx`](https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/app/page.tsx) (Transfer interface), [`apps/signaling/src/index.ts`](https://github.com/shivamyadav25/fast-transfer/blob/main/apps/signaling/src/index.ts) (Signaling worker), [`apps/web/lib/webrtc/peer.ts`](https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/webrtc/peer.ts) (Peer connection), [`apps/web/lib/webrtc/transfer.ts`](https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/webrtc/transfer.ts) (Chunk transfer engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webapp["Transfer interface<br/>[page.tsx]"]
  node_webrtc_ui["Transfer status UI"]
  node_native_save["Native file saving<br/>[save.ts]"]
end

subgraph group_realtime["Live transfer"]
  node_signal_client["Signaling client<br/>[client.ts]"]
  node_peer["Peer connection<br/>[peer.ts]"]
  node_parallel["Parallel connections<br/>[multi-peer.ts]"]
  node_ice["ICE configuration<br/>[ice-config.ts]"]
  node_transfer["Chunk transfer engine<br/>[transfer.ts]"]
  node_adaptive["Adaptive send window<br/>[adaptive.ts]"]
  node_hash["Integrity hashing<br/>[hash-worker.ts]"]
  node_stats["Connection benchmarks<br/>[stats.ts]"]
  node_protocol["Shared wire protocol<br/>[index.ts]"]
end

subgraph group_stored["Stored transfer"]
  node_store_client["Stored transfer client<br/>[storeclient.ts]"]
  node_store_crypto["Local encryption<br/>[storecrypto.ts]"]
end

subgraph group_backend["Signaling backend"]
  node_signal_worker["Signaling worker<br/>[index.ts]"]
  node_room["Live room relay<br/>[room.ts]"]
  node_room_state[("Room state<br/>[store.ts]")]
  node_stored_state[("Stored transfer state")]
  node_bucket[("Ciphertext bucket")]
end

subgraph group_platforms["Native shells"]
  node_desktop["Desktop shell<br/>[lib.rs]"]
  node_mobile["Mobile shell<br/>[App.tsx]"]
end

node_user(("Sender or receiver"))
node_signaling_service(("Cloudflare service"))
node_peer_device(("Other browser or device"))
node_turn(("Optional TURN relay"))

node_user -->|"selects or receives"| node_webapp
node_webapp -->|"creates or joins room"| node_signal_client
node_signal_client -->|"HTTP and WebSocket"| node_signal_worker
node_signal_worker -->|"dispatches room requests"| node_room
node_room -->|"reads and writes"| node_room_state
node_room -->|"relays offer and ICE"| node_peer_device
node_signal_worker -->|"uses message shapes"| node_protocol
node_peer_device -->|"exchanges signaling"| node_signal_client
node_webapp -->|"negotiates connection"| node_peer
node_webapp -->|"opens parallel peers"| node_parallel
node_peer -->|"sends and receives signaling"| node_signal_client
node_peer -->|"configures ICE"| node_ice
node_peer -->|"establishes WebRTC"| node_peer_device
node_peer -.->|"may relay media"| node_turn
node_webapp -->|"starts and resumes transfer"| node_transfer
node_transfer -->|"adjusts send window"| node_adaptive
node_transfer -->|"hashes file data"| node_hash
node_transfer -->|"sends chunks and control"| node_peer_device
node_webapp -->|"monitors connection"| node_stats
node_stats -->|"reports metrics"| node_webrtc_ui
node_webapp -->|"renders transfer state"| node_webrtc_ui
node_webapp -->|"saves received files"| node_native_save
node_webapp -->|"uploads or retrieves"| node_store_client
node_store_client -->|"encrypts and decrypts"| node_store_crypto
node_store_client -->|"requests stored transfer"| node_signal_worker
node_signal_worker -->|"checks lifecycle and access"| node_stored_state
node_signal_worker -->|"reads and writes ciphertext"| node_bucket
node_desktop -->|"hosts web app"| node_webapp
node_mobile -->|"hosts web app"| node_webapp

click node_webapp "https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/app/page.tsx"
click node_webrtc_ui "https://github.com/shivamyadav25/fast-transfer/tree/main/apps/web/components"
click node_native_save "https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/native/save.ts"
click node_signal_client "https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/signaling/client.ts"
click node_peer "https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/webrtc/peer.ts"
click node_parallel "https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/webrtc/multi-peer.ts"
click node_ice "https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/webrtc/ice-config.ts"
click node_transfer "https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/webrtc/transfer.ts"
click node_adaptive "https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/webrtc/adaptive.ts"
click node_hash "https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/webrtc/hash-worker.ts"
click node_stats "https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/webrtc/stats.ts"
click node_protocol "https://github.com/shivamyadav25/fast-transfer/blob/main/packages/protocol/src/index.ts"
click node_store_client "https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/store/storeclient.ts"
click node_store_crypto "https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/store/storecrypto.ts"
click node_signal_worker "https://github.com/shivamyadav25/fast-transfer/blob/main/apps/signaling/src/index.ts"
click node_room "https://github.com/shivamyadav25/fast-transfer/blob/main/apps/signaling/src/room.ts"
click node_room_state "https://github.com/shivamyadav25/fast-transfer/blob/main/apps/signaling/src/store.ts"
click node_stored_state "https://github.com/shivamyadav25/fast-transfer/tree/main/apps/signaling/src"
click node_desktop "https://github.com/shivamyadav25/fast-transfer/blob/main/apps/desktop/src-tauri/src/lib.rs"
click node_mobile "https://github.com/shivamyadav25/fast-transfer/blob/main/apps/mobile/App.tsx"

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_webapp,node_webrtc_ui,node_native_save,node_peer_device toneBlue
class node_signal_client,node_peer,node_parallel,node_ice,node_transfer,node_adaptive,node_hash,node_stats,node_protocol toneAmber
class node_store_client,node_store_crypto toneMint
class node_signal_worker,node_room,node_room_state,node_stored_state,node_bucket toneRose
class node_desktop,node_mobile,node_user,node_signaling_service,node_turn toneIndigo
```

## Components

### Web experience

- [Transfer interface](https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/app/page.tsx): `apps/web/app/page.tsx`
- [Transfer status UI](https://github.com/shivamyadav25/fast-transfer/tree/main/apps/web/components): `apps/web/components`
- [Native file saving](https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/native/save.ts): `apps/web/lib/native/save.ts`

### Live transfer

- [Signaling client](https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/signaling/client.ts): `apps/web/lib/signaling/client.ts`
- [Peer connection](https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/webrtc/peer.ts): `apps/web/lib/webrtc/peer.ts`
- [Parallel connections](https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/webrtc/multi-peer.ts): `apps/web/lib/webrtc/multi-peer.ts`
- [ICE configuration](https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/webrtc/ice-config.ts): `apps/web/lib/webrtc/ice-config.ts`
- [Chunk transfer engine](https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/webrtc/transfer.ts): `apps/web/lib/webrtc/transfer.ts`
- [Adaptive send window](https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/webrtc/adaptive.ts): `apps/web/lib/webrtc/adaptive.ts`
- [Integrity hashing](https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/webrtc/hash-worker.ts): `apps/web/lib/webrtc/hash-worker.ts`
- [Connection benchmarks](https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/webrtc/stats.ts): `apps/web/lib/webrtc/stats.ts`
- [Shared wire protocol](https://github.com/shivamyadav25/fast-transfer/blob/main/packages/protocol/src/index.ts): `packages/protocol/src/index.ts`

### Stored transfer

- [Stored transfer client](https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/store/storeclient.ts): `apps/web/lib/store/storeclient.ts`
- [Local encryption](https://github.com/shivamyadav25/fast-transfer/blob/main/apps/web/lib/store/storecrypto.ts): `apps/web/lib/store/storecrypto.ts`

### Signaling backend

- [Signaling worker](https://github.com/shivamyadav25/fast-transfer/blob/main/apps/signaling/src/index.ts): `apps/signaling/src/index.ts`
- [Live room relay](https://github.com/shivamyadav25/fast-transfer/blob/main/apps/signaling/src/room.ts): `apps/signaling/src/room.ts`
- [Room state](https://github.com/shivamyadav25/fast-transfer/blob/main/apps/signaling/src/store.ts): `apps/signaling/src/store.ts`
- [Stored transfer state](https://github.com/shivamyadav25/fast-transfer/tree/main/apps/signaling/src): `apps/signaling/src`
- **Ciphertext bucket**

### Native shells

- [Desktop shell](https://github.com/shivamyadav25/fast-transfer/blob/main/apps/desktop/src-tauri/src/lib.rs): `apps/desktop/src-tauri/src/lib.rs`
- [Mobile shell](https://github.com/shivamyadav25/fast-transfer/blob/main/apps/mobile/App.tsx): `apps/mobile/App.tsx`

### Other components

- **Sender or receiver**
- **Cloudflare service**
- **Other browser or device**
- **Optional TURN relay**

## Connections

- Sender or receiver → Transfer interface: selects or receives
- Transfer interface → Signaling client: creates or joins room
- Signaling client → Signaling worker: HTTP and WebSocket
- Signaling worker → Live room relay: dispatches room requests
- Live room relay → Room state: reads and writes
- Live room relay → Other browser or device: relays offer and ICE
- Signaling worker → Shared wire protocol: uses message shapes
- Other browser or device → Signaling client: exchanges signaling
- Transfer interface → Peer connection: negotiates connection
- Transfer interface → Parallel connections: opens parallel peers
- Peer connection → Signaling client: sends and receives signaling
- Peer connection → ICE configuration: configures ICE
- Peer connection → Other browser or device: establishes WebRTC
- Peer connection → Optional TURN relay: may relay media
- Transfer interface → Chunk transfer engine: starts and resumes transfer
- Chunk transfer engine → Adaptive send window: adjusts send window
- Chunk transfer engine → Integrity hashing: hashes file data
- Chunk transfer engine → Other browser or device: sends chunks and control
- Transfer interface → Connection benchmarks: monitors connection
- Connection benchmarks → Transfer status UI: reports metrics
- Transfer interface → Transfer status UI: renders transfer state
- Transfer interface → Native file saving: saves received files
- Transfer interface → Stored transfer client: uploads or retrieves
- Stored transfer client → Local encryption: encrypts and decrypts
- Stored transfer client → Signaling worker: requests stored transfer
- Signaling worker → Stored transfer state: checks lifecycle and access
- Signaling worker → Ciphertext bucket: reads and writes ciphertext
- Desktop shell → Transfer interface: hosts web app
- Mobile shell → Transfer interface: hosts web app
