Skip to content

ShivamXD6/P2P_File_Transfer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔗 P2P File Transfer (Hybrid)

Logo Icon
A secure, fast, and browser-based file sharing system built using Python & Django. It supports direct peer-to-peer transfer and a backup Upload & Share mode, so file sharing always works — no matter the network.


📌 What is this project?

P2P File Transfer allows users to share files in two smart ways:

🔁 1. Peer-to-Peer (P2P) Mode

  • Files are sent directly from sender to receiver
  • Works best on same Wi-Fi / local network
  • Extremely fast ⚡
  • No server storage involved
  • End-to-End Encrypted

☁️ 2. Upload & Share Mode

  • Used when P2P is not possible (different networks / offline user)
  • File is encrypted and uploaded temporarily
  • A secure shareable link is generated
  • File is auto-deleted after a short time

This hybrid approach ensures the transfer never fails.


🧠 Why is this useful? (Simple words)

  • 🚫 No need for Google Drive, WhatsApp, or Email
  • ⚡ Much faster than cloud apps on local Wi-Fi
  • 🔐 Files stay private with encryption
  • 🌍 Works on any modern browser (mobile & desktop)
  • 🧪 Great real-world project for learning networking concepts

✨ Features

🔄 Transfer Modes

  • Live P2P Transfer (WebRTC based)
  • Upload & Share fallback mode

🔐 Privacy & Security

  • End-to-End Encryption (E2EE) for P2P transfers
  • Encrypted storage for uploaded files
  • Private rooms using unique Room IDs
  • No account or name required

📁 File Handling

  • Chunk-based transfer (handles large files safely)
  • Real-time progress bar & speed indicator
  • Auto cleanup of uploaded files

🖥️ User Interface

  • Dark mode with modern UI
  • Mobile & desktop responsive
  • Separate tabs for Send / Receive / Settings

🧩 Tech Stack

  • Backend: Django (Python)
  • Realtime: Django Channels + WebSockets
  • P2P: WebRTC
  • Encryption: Web Crypto API / Fernet
  • Frontend: Vanilla JavaScript + CSS

⚙️ Run Locally

1️⃣ Clone the repository

git clone https://github.com/ShivamXD6/P2P_File_Transfer
cd path/to/root/directory
pip install uv

2️⃣ Rename env.example to .env and modify it

SECRET_KEY="example_secret_key"  # https://stackoverflow.com/a/57678930
ENCRYPTION_KEY="example_encryption_key"  # https://cryptography.io/en/latest/fernet/#cryptography.fernet.Fernet
DEBUG=True  # For development

3️⃣ Run database migrations

python -m uv run manage.py migrate

4️⃣ Start the development server

python -m uv run manage.py runserver 0.0.0.0:8000

5️⃣ Open in browser

localhost:8000

🖼️ Screenshots

🔁 Peer-to-Peer Transfer Mode

{6C1B3FF7-6A60-4CEC-B15C-6CF3F4CF6F36} {7FE0E4E5-2C20-452C-8EF2-5D3089B1BC14} {3976A217-B038-489E-BAC1-12B88D696D86}

☁️ Upload & Share Mode

{19546530-5641-4BF2-879E-F04CC7D5E165} {5A1CD1E1-4328-4D3D-8CE5-D99A7D139F6D} {081EA912-86C4-40AB-B901-D18868C4852B}

About

A secure, fast, and browser-based file sharing system built using Python & Django. It supports direct peer-to-peer transfer and a backup Upload & Share mode, so file sharing always works no matter the network.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors