Skip to main content

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 /config endpoint
  • 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
Signaling is only used during connection setup. No files pass through the signaling server.

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
All transfers are encrypted using DTLS. The server is not involved during file transfer.

NAT Traversal

STUN and TURN servers enable connectivity across different networks.

Components:

  • STUN Server (NAT discovery)
  • TURN Server (Relay fallback)
STUN is used to discover public network addresses. TURN is used only if direct P2P connection fails.

System Flow

  1. Browser loads configuration from the Express server
  2. Browser connects to WebSocket signaling server
  3. Peers discover each other
  4. WebRTC handshake is performed
  5. Secure P2P connection is established
  6. Files transfer directly between devices

System Architecture (Technical View)

This diagram represents the full signaling and peer-to-peer transfer workflow used by ErikrafT Drop.