PeerDrop is a lightweight, containerized local-first file transfer application designed for high-speed sharing between devices on the same network. It eliminates the need for cloud intermediaries by enabling direct device-to-device communication through a single-entry point architecture.
PeerDrop utilizes a Single-Origin Deployment Model. By using Nginx as a reverse proxy, the application multiplexes frontend assets, API requests, and WebSocket streams through a single port, making the deployment "environment-agnostic."
graph LR
subgraph UserSpace [Client Side]
Browser[User Browser]
end
subgraph Docker [Docker Compose Network]
Nginx[Nginx Reverse Proxy <br/> Port 80]
subgraph Services
Frontend[React Frontend <br/> Static Files]
Backend[FastAPI Backend <br/> Python]
end
end
%% Traffic Flow
Browser -->|HTTP/HTTPS| Nginx
Nginx -->|/ | Frontend
Nginx -->|/api| Backend
Nginx -->|/ws - WebSocket| Backend
%% Styling
style Docker fill:#f9f9f9,stroke:#333,stroke-width:2px
style Nginx fill:#009639,color:#fff,font-weight:bold
style Backend fill:#05998b,color:#fff
style Frontend fill:#61dbfb,color:#000
- 📡 Automatic Discovery: Real-time device presence detection via persistent WebSocket connections.
- 📁 Direct Transfers: Optimized HTTP file streaming with drag-and-drop support.
- 🔐 One-Time Tokens: Backend-enforced secure download tokens to prevent unauthorized file access.
- 📊 Live Feedback: Real-time upload progress and transfer state synchronization.
- 📱 Cross-Platform: Responsive UI tested across Linux, Windows, and mobile (Android/iOS) browsers.
- Reverse Proxy Orchestration: Uses Nginx to handle
UpgradeandConnectionheaders, ensuring stable WebSocket handshakes within a containerized network. - Dynamic Protocol Detection: The frontend automatically detects the environment to initiate
ws://orwss://connections, allowing for seamless SSL termination. - Optimized Footprint: Implements a slim-build strategy for the FastAPI backend, significantly reducing the Docker image size.
- Docker and Docker Compose
- Clone and Enter:
git clone https://github.com/0Shree005/PeerDrop.git
cd PeerDrop
- Spin up Services:
docker-compose up --build
- Access:
Open
http://localhoston your machine. To access from other devices, use your host's local IP (e.g.,http://192.168.1.XX).
.
├── backend/ # FastAPI (HTTP + WebSocket + Token Logic)
├── frontend/ # React + Vite (Tailwind CSS)
├── nginx.conf # Reverse proxy & WebSocket routing configuration
├── docker-compose.yml
└── README.md
Distributed under the MIT License. See LICENSE for more information.