# varadanikhil0-commits/iphone- architecture

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

- Interactive diagram: https://gitdiagram.com/varadanikhil0-commits/iphone-
- Repository: https://github.com/varadanikhil0-commits/iphone-

## Overview

Bridge is a local iPhone-to-computer transfer product: users pair a device, select files, upload them in resumable chunks, and manage verified transfers and media. The web interface also exposes device status, companion pairing, backups/exports, and settings. The server routes coordinate persistence and filesystem operations. The tree includes a Flutter mobile client, but its runtime wiring was not sampled, so it is represented as a distinct client with no asserted connections. Relationships below are limited to excerpted code and SOURCE INDEX references.

Main entry points: [`src/App.tsx`](https://github.com/varadanikhil0-commits/iphone-/blob/main/src/App.tsx) (Web application), [`src/lib/api.ts`](https://github.com/varadanikhil0-commits/iphone-/blob/main/src/lib/api.ts) (HTTP client), [`server/routes.ts`](https://github.com/varadanikhil0-commits/iphone-/blob/main/server/routes.ts) (API routes), [`server.ts`](https://github.com/varadanikhil0-commits/iphone-/blob/main/server.ts) (Server entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["Web application<br/>[App.tsx]"]
  node_dashboard["Dashboard<br/>[DashboardView.tsx]"]
  node_connect["Device connection"]
  node_transfers["Transfer manager<br/>[TransfersView.tsx]"]
  node_library["Media library"]
  node_backup["Backup and export"]
  node_settings["Settings and audit"]
end

subgraph group_transfer["Pairing and transfer"]
  node_companion["iPhone companion"]
  node_protocol["Transfer protocol<br/>[protocol.ts]"]
  node_uploader["Chunked uploader<br/>[uploader.ts]"]
  node_api["HTTP client<br/>[api.ts]"]
  node_battery["Battery status<br/>[battery.ts]"]
end

subgraph group_server["Receiver services"]
  node_receiver["Server entry<br/>[server.ts]"]
  node_routes["API routes<br/>[routes.ts]"]
  node_db[("SQLite persistence<br/>[db.ts]")]
  node_storage["File storage<br/>[storage.ts]"]
end

subgraph group_mobile["Mobile client"]
  node_mobileapp["Mobile application<br/>[app.dart]"]
  node_mobileclient["Mobile API client"]
  node_mobilequeue["Mobile transfer queue"]
end

node_user(("User"))
node_phone(("iPhone user"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_connect
node_app -->|"renders"| node_transfers
node_app -->|"renders"| node_library
node_app -->|"renders"| node_backup
node_app -->|"renders"| node_settings
node_app -->|"renders"| node_companion
node_app -->|"starts upload"| node_uploader
node_app -->|"loads data"| node_api
node_connect -->|"calls"| node_api
node_dashboard -->|"loads data"| node_api
node_dashboard -->|"formats status"| node_battery
node_transfers -->|"calls"| node_api
node_library -->|"calls"| node_api
node_backup -->|"calls"| node_api
node_settings -->|"calls"| node_api
node_companion -->|"calls"| node_api
node_companion -->|"parses pairing"| node_protocol
node_uploader -->|"uploads chunks"| node_api
node_receiver -->|"registers routes"| node_routes
node_receiver -->|"configures"| node_db
node_receiver -->|"configures"| node_storage
node_routes -->|"reads and writes"| node_db
node_routes -->|"uses"| node_storage
node_routes -->|"validates transfers"| node_protocol
node_storage -->|"checks archive paths"| node_protocol
node_phone -->|"uses"| node_mobileapp
node_mobileapp -->|"calls"| node_mobileclient
node_mobileapp -->|"manages queue"| node_mobilequeue

click node_app "https://github.com/varadanikhil0-commits/iphone-/blob/main/src/App.tsx"
click node_dashboard "https://github.com/varadanikhil0-commits/iphone-/blob/main/src/components/DashboardView.tsx"
click node_connect "https://github.com/varadanikhil0-commits/iphone-/blob/main/src/components/ConnectDeviceView.tsx"
click node_transfers "https://github.com/varadanikhil0-commits/iphone-/blob/main/src/components/TransfersView.tsx"
click node_library "https://github.com/varadanikhil0-commits/iphone-/blob/main/src/components/MediaLibraryView.tsx"
click node_backup "https://github.com/varadanikhil0-commits/iphone-/blob/main/src/components/BackupsExportView.tsx"
click node_settings "https://github.com/varadanikhil0-commits/iphone-/blob/main/src/components/SettingsAuditView.tsx"
click node_companion "https://github.com/varadanikhil0-commits/iphone-/blob/main/src/components/IPhoneCompanionView.tsx"
click node_protocol "https://github.com/varadanikhil0-commits/iphone-/blob/main/src/shared/protocol.ts"
click node_uploader "https://github.com/varadanikhil0-commits/iphone-/blob/main/src/lib/uploader.ts"
click node_api "https://github.com/varadanikhil0-commits/iphone-/blob/main/src/lib/api.ts"
click node_battery "https://github.com/varadanikhil0-commits/iphone-/blob/main/src/lib/battery.ts"
click node_receiver "https://github.com/varadanikhil0-commits/iphone-/blob/main/server.ts"
click node_routes "https://github.com/varadanikhil0-commits/iphone-/blob/main/server/routes.ts"
click node_db "https://github.com/varadanikhil0-commits/iphone-/blob/main/server/db.ts"
click node_storage "https://github.com/varadanikhil0-commits/iphone-/blob/main/server/storage.ts"
click node_mobileapp "https://github.com/varadanikhil0-commits/iphone-/blob/main/mobile/lib/src/app.dart"
click node_mobileclient "https://github.com/varadanikhil0-commits/iphone-/blob/main/mobile/lib/src/services/bridge_api_client.dart"
click node_mobilequeue "https://github.com/varadanikhil0-commits/iphone-/blob/main/mobile/lib/src/services/transfer_queue_controller.dart"

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_app,node_dashboard,node_connect,node_transfers,node_library,node_backup,node_settings,node_user,node_phone toneBlue
class node_companion,node_protocol,node_uploader,node_api,node_battery toneAmber
class node_receiver,node_routes,node_db,node_storage toneMint
class node_mobileapp,node_mobileclient,node_mobilequeue toneRose
```

## Components

### Web experience

- [Web application](https://github.com/varadanikhil0-commits/iphone-/blob/main/src/App.tsx): `src/App.tsx`
- [Dashboard](https://github.com/varadanikhil0-commits/iphone-/blob/main/src/components/DashboardView.tsx): `src/components/DashboardView.tsx`
- [Device connection](https://github.com/varadanikhil0-commits/iphone-/blob/main/src/components/ConnectDeviceView.tsx): `src/components/ConnectDeviceView.tsx`
- [Transfer manager](https://github.com/varadanikhil0-commits/iphone-/blob/main/src/components/TransfersView.tsx): `src/components/TransfersView.tsx`
- [Media library](https://github.com/varadanikhil0-commits/iphone-/blob/main/src/components/MediaLibraryView.tsx): `src/components/MediaLibraryView.tsx`
- [Backup and export](https://github.com/varadanikhil0-commits/iphone-/blob/main/src/components/BackupsExportView.tsx): `src/components/BackupsExportView.tsx`
- [Settings and audit](https://github.com/varadanikhil0-commits/iphone-/blob/main/src/components/SettingsAuditView.tsx): `src/components/SettingsAuditView.tsx`

### Pairing and transfer

- [iPhone companion](https://github.com/varadanikhil0-commits/iphone-/blob/main/src/components/IPhoneCompanionView.tsx): `src/components/IPhoneCompanionView.tsx`
- [Transfer protocol](https://github.com/varadanikhil0-commits/iphone-/blob/main/src/shared/protocol.ts): `src/shared/protocol.ts`
- [Chunked uploader](https://github.com/varadanikhil0-commits/iphone-/blob/main/src/lib/uploader.ts): `src/lib/uploader.ts`
- [HTTP client](https://github.com/varadanikhil0-commits/iphone-/blob/main/src/lib/api.ts): `src/lib/api.ts`
- [Battery status](https://github.com/varadanikhil0-commits/iphone-/blob/main/src/lib/battery.ts): `src/lib/battery.ts`

### Receiver services

- [Server entry](https://github.com/varadanikhil0-commits/iphone-/blob/main/server.ts): `server.ts`
- [API routes](https://github.com/varadanikhil0-commits/iphone-/blob/main/server/routes.ts): `server/routes.ts`
- [SQLite persistence](https://github.com/varadanikhil0-commits/iphone-/blob/main/server/db.ts): `server/db.ts`
- [File storage](https://github.com/varadanikhil0-commits/iphone-/blob/main/server/storage.ts): `server/storage.ts`

### Mobile client

- [Mobile application](https://github.com/varadanikhil0-commits/iphone-/blob/main/mobile/lib/src/app.dart): `mobile/lib/src/app.dart`
- [Mobile API client](https://github.com/varadanikhil0-commits/iphone-/blob/main/mobile/lib/src/services/bridge_api_client.dart): `mobile/lib/src/services/bridge_api_client.dart`
- [Mobile transfer queue](https://github.com/varadanikhil0-commits/iphone-/blob/main/mobile/lib/src/services/transfer_queue_controller.dart): `mobile/lib/src/services/transfer_queue_controller.dart`

### Other components

- **User**
- **iPhone user**

## Connections

- User → Web application: uses (evidence: `src/App.tsx`)
- Web application → Dashboard: renders (evidence: `src/App.tsx`)
- Web application → Device connection: renders (evidence: `src/App.tsx`)
- Web application → Transfer manager: renders (evidence: `src/App.tsx`)
- Web application → Media library: renders (evidence: `src/App.tsx`)
- Web application → Backup and export: renders (evidence: `src/App.tsx`)
- Web application → Settings and audit: renders (evidence: `src/App.tsx`)
- Web application → iPhone companion: renders (evidence: `src/App.tsx`)
- Web application → Chunked uploader: starts upload (evidence: `src/App.tsx`)
- Web application → HTTP client: loads data (evidence: `src/App.tsx`)
- Device connection → HTTP client: calls (evidence: `src/components/ConnectDeviceView.tsx`)
- Dashboard → HTTP client: loads data (evidence: `src/components/DashboardView.tsx`)
- Dashboard → Battery status: formats status (evidence: `src/components/DashboardView.tsx`)
- Transfer manager → HTTP client: calls (evidence: `src/components/TransfersView.tsx`)
- Media library → HTTP client: calls (evidence: `src/components/MediaLibraryView.tsx`)
- Backup and export → HTTP client: calls (evidence: `src/components/BackupsExportView.tsx`)
- Settings and audit → HTTP client: calls (evidence: `src/components/SettingsAuditView.tsx`)
- iPhone companion → HTTP client: calls (evidence: `src/components/IPhoneCompanionView.tsx`)
- iPhone companion → Transfer protocol: parses pairing (evidence: `src/components/IPhoneCompanionView.tsx`)
- Chunked uploader → HTTP client: uploads chunks (evidence: `src/lib/uploader.ts`)
- Server entry → API routes: registers routes (evidence: `server.ts`)
- Server entry → SQLite persistence: configures (evidence: `server.ts`)
- Server entry → File storage: configures (evidence: `server.ts`)
- API routes → SQLite persistence: reads and writes (evidence: `server/routes.ts`)
- API routes → File storage: uses (evidence: `server/routes.ts`)
- API routes → Transfer protocol: validates transfers (evidence: `server/routes.ts`)
- File storage → Transfer protocol: checks archive paths (evidence: `server/storage.ts`)
- iPhone user → Mobile application: uses
- Mobile application → Mobile API client: calls
- Mobile application → Mobile transfer queue: manages queue
