$ show subins2000/WebDrop
WebDrop is a peer-to-peer file and message sharing web application built with Vue.js that enables direct device-to-device transfers without installation. It uses WebRTC via the P2PT library for peer discovery and communication, simple-peer-files for file transfers, and Vuex for state management. The application features automatic LAN device discovery, internet sharing via room codes, resume capability for interrupted transfers, and a responsive UI with multiple views for managing files, messages, and connected devices. The architecture follows Vue.js best practices with clear separation between components, state management, and routing.
The LLM identified 4 files worth highlighting for reuse:
A self-contained utility that accurately detects browser and operating system information from the user agent string. It has zero external dependencies and returns a simple object with OS and browser details, making it easily reusable in any web project needing client environment detection.
Contains the formatBytes function that converts byte counts to human-readable units (B, KB, MB, etc.) with proper precision handling. This utility is completely independent of the Vue framework and could be extracted into a standalone module for any application dealing with file sizes or data transfer metrics.
Implements a robust drag-and-drop handler for files and directories with visual feedback. It properly handles both file and directory traversal through the DataTransfer API, prevents default browser behaviors, and provides user feedback during drag operations. This pattern solves a common web development challenge with a cross-browser compatible solution.
Demonstrates a pattern for calculating real-time transfer speeds by measuring bytes transferred over time intervals, combined with nosleep.js integration to prevent device sleep during active transfers. It properly manages interval timers and cleans up resources when transfers complete, showing good resource management practices.