Case study
file-drop
Overview
Share files across your home or office network. Upload in the browser, hand someone a link or a 6-digit code, and they download on any device. No sign-up, no cloud.
Problem
Getting a file from one device to another on the same network usually means a cloud upload, a USB stick, or wrestling with SMB shares. There wasn't a simple tool that just worked on the LAN with short-lived links and no account.
Approach
I built a self-hosted Next.js app that runs on any machine on the network. Drop a file in the browser and you get a 6-digit code, a QR code, and a direct link. The other person enters the code, scans, or clicks, and downloads. Everything stays local: SQLite holds the metadata, the disk holds the files. No cloud, no sign-up, no internet needed.
Architecture
Next.js App Router with API routes handling upload (multipart with XMLHttpRequest for progress tracking), download (streaming via fs.createReadStream → Web ReadableStream), code lookup, password verify, and periodic cleanup. SQLite with WAL mode stores file metadata, hashed passwords, and access codes. Uploaded files are zipped with archiver (preserving drag-order). QR decoding is fully client-side via jsQR from uploaded screenshots.
Challenges
Multipart uploads past the 2 GB mark needed careful handling. The 6-digit codes have about 900k combinations, with a retry on collision (up to 100 tries). Streaming meant bridging Node streams to the Web ReadableStream type. Cross-browser clipboard needed a fallback chain. Passwords use SHA-256 rather than bcrypt, fine for a LAN threat model. The production server scans for a free port on startup.
Results
A LAN file-sharing tool that needs no setup. Upload in the browser, share by code, QR, or link, and download on any device. No cloud, no sign-up, nothing leaves the network. It self-hosts with SQLite and cleans up after itself.