Skip to content

0Shree005/PeerDrop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PeerDrop 🚀

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.


🏗️ System 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

Loading

✨ Features

  • 📡 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.

📸 Screenshots

image image

🛠️ Technical Implementation Highlights

  • Reverse Proxy Orchestration: Uses Nginx to handle Upgrade and Connection headers, ensuring stable WebSocket handshakes within a containerized network.
  • Dynamic Protocol Detection: The frontend automatically detects the environment to initiate ws:// or wss:// connections, allowing for seamless SSL termination.
  • Optimized Footprint: Implements a slim-build strategy for the FastAPI backend, significantly reducing the Docker image size.

🚀 Quick Start (Local)

Prerequisites

  • Docker and Docker Compose

Deployment

  1. Clone and Enter:
git clone https://github.com/0Shree005/PeerDrop.git
cd PeerDrop
  1. Spin up Services:
docker-compose up --build
  1. Access: Open http://localhost on your machine. To access from other devices, use your host's local IP (e.g., http://192.168.1.XX).

📂 Project Structure

.
├── backend/          # FastAPI (HTTP + WebSocket + Token Logic)
├── frontend/         # React + Vite (Tailwind CSS)
├── nginx.conf        # Reverse proxy & WebSocket routing configuration
├── docker-compose.yml
└── README.md


📄 License

Distributed under the MIT License. See LICENSE for more information.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors