How 05sanjaykumar/peer-drop works
Project Type and Purpose
• From the file tree and README, PeerDrop is a full-stack, real-time P2P file-sharing and chat application.
• The frontend is a SvelteKit app running in a container; the backend is a Go-based WebSocket signaling server.
• Purpose: negotiate WebRTC peer connections, exchange encrypted chat and file data over RTCDataChannels, all end-to-end encrypted.
File Structure
• Top-level:
• client/ – SvelteKit UI and WebRTC logic
• server/ – Go signaling server (client.go, handler.go, main.go)
• docker-compose.yml – orchestrates both containers
• client/src/lib – encryption utilities (AES-GCM, PBKDF2), WebRTC and WebSocket wrappers
• client/src/hooks/useWebRTC.ts – encapsulates connection-lifecycle logic
• server/handler.go – WebSocket handshake & message routing for offer/answer/ICE
• Dockerfiles at client/ and server/ define container environments
• No external database; ephemeral state lives in memory or on the peers.
README for Additional Insights
• Architecture notes:
• WebSocket signaling over ws://localhost:8080/ws
• WebRTC data exchange peer-to-peer after handshake
• AES-GCM encryption and optional ECC identity on top of RTCDataChannel
• DevOps: built and run via docker-compose up –build
• Roadmap indicates drag-and-drop UI, identity fingerprinting, TURN support (future).
Detail
• Library’s role (e.g., useWebRTC hook wraps RTCPeerConnection, lib/webrtc.ts abstracts signaling).
• Where encryption sits: at the RTCDataChannel layer (AES-GCM encryption wrapper).