ErikrafT Drop Architecture Diagram
This diagram shows the internal architecture and system flow of ErikrafT Drop, a WebRTC-based peer-to-peer file transfer system inspired by PairDrop. The architecture is divided into logical layers that work together to enable secure and fast P2P file transfers.Layer 1 — HTTP + Configuration
The Express server provides static files and configuration data.Responsibilities:
- Serve HTML, CSS, and JavaScript files
- Provide
/configendpoint - Deliver application settings
- Initialize client configuration
Components:
- Express Server (
server/index.js) - Static Files
- Configuration API
Layer 2 — WebSocket Signaling
The WebSocket server handles peer discovery and signaling required for WebRTC connections.Responsibilities:
- Peer discovery
- Room management
- Signaling message exchange
- Session coordination
Components:
- WebSocket Signaling Server (
server/ws-server.js) - Rooms Manager
- Peer Manager
Layer 3 — WebRTC P2P Transfer
File transfers occur directly between browsers using WebRTC DataChannels.Responsibilities:
- Direct peer-to-peer communication
- Encrypted file transfer
- Chunked file streaming
- Transfer reliability
Components:
- RTCPeer connections
- RTCDataChannel
- FileChunker
- FileDigester
NAT Traversal
STUN and TURN servers enable connectivity across different networks.Components:
- STUN Server (NAT discovery)
- TURN Server (Relay fallback)
System Flow
- Browser loads configuration from the Express server
- Browser connects to WebSocket signaling server
- Peers discover each other
- WebRTC handshake is performed
- Secure P2P connection is established
- Files transfer directly between devices

