Most file sharing services on the web become really slow when many people start downloading the same file at the same time, so we turned things around and built a file sharing service that speeds up downloads significantly the more people join in.

What it does

Users can quickly and easily share files of any size, for free. Once users selected the file they want to share, the website generates a unique link and as long as users keep the tab open, the file will be shared amongst all recipients peer to peer. The more people download a file at the same time, the better.

How we built it

We sat down and coded for 20h straight. We started with a python backend, which we tried to make as simple as possible to scale in case we needed to, so we used things like Docker, CoreOS and for the database we used Redis. We then moved on to building the web app with HTML, CSS and Javascript to keep things simple. The app uses WebTorrent to send the files peer to peer to its recipients, which in turn seed the files speeding up the process for everyone else. We finished off by adding a neat feature where users sharing or downloading a file can see their peers on a world map in real-time.

Challenges we ran into

We wanted to implement an option for users that don't want to keep the upload tab open by hosting the file on our servers and seeding from there. We actually have all the code already written, but we encountered a strange issue with the WebTorrent library we're using that causes Chrome to take ~2min to fetch metadata, while Firefox takes ~20sec.

Accomplishments that we're proud of

All of our infrastructure is containerised and version controlled, so deployment is as easy as 'git pull && systemctl restart peerpiper' and we can scale up or down in a matter of seconds.

What we learned

Sending files peer to peer wasn't as easy as we initially thought. We learned a lot more about the WebTorrent and BitTorrent protocols, deploying infrastructure in an easy, scalable way, and how to deal with users sharing files from networks that are NAT restricted (like the Disrupt Wi-Fi).

What's next for Peer Piper

We want to integrate micro-payments with Bitcoin to cover the costs of hosting files on our server, when users choose to do so. The difference between our operating costs and the revenue will be donated to the Electronic Frontier Foundation.

Built With

Share this project: