Learn how to integrate a photo booth to IPFS and make your selfie go interplanetary with web3.storage.
During Web Summit 2022, the Filecoin events and creative team set up an amazing exhibition stand at the convention that attracted more than 3500 visitors wanting to learn more about Web3, the InterPlanetary File System (IPFS), and the Filecoin network’s distributed storage solutions.
Filecoin offers a wide range of solutions for storing and persisting files on Web3 via IPFS Protocol. One of the most popular and easy to use is web3.Storage, a “one API call to IPFS and Filecoin” solution for developers.
IPFS is a web protocol that allows sharing files in a peer-to-peer network and sharing data in a distributed computer network. Filecoin created an open-source protocol that enables a storage market to persist files on IPFS for a long time and with little cost. This solution solves the storage problem in Web3 and upgrades the internet as we know it to handle challenges like interplanetary communication.
Interplanetary communication has to include selfies! Learn how to use a lightweight node.js application to make a photo booth software called Sparkbooth to connect to web3.storage and upload your selfie to IPFS.
The main parts of the photo booths are: a digital camera, some lights, a computer with touch screen, some software that controls the camera to take photos and the ability to upload them to IPFS and Filecoin network.
Touch screen receives commands from user to take a photo
Photo Booth software (called Sparkbooth) will talk to the camera to take action
Sparkbooth stores the photo locally on the computer
Sparkbooth asks user if they want to send to a server (via web3.storage)
Sparkbooth sends the photo, username, password, and success message in an API call to *
fil-photobooth-uploader app will:
validate the username and password
change the format of the photo to what
retrieves API token/key from system and send to __web3.__Storage
w__eb3.storage__ sends the photo to the IPFS network and back up on Filecoin
w__eb3.storage__ will return the IPFS Content ID (CID) back to the
fil-photo-booth-uploader returns a success message back to Sparkbooth 7
Sparkbooth receives a success message: “Your photo is sent to IPFS via
Sparkbooth displays the QR code generated on the screen
An example of the IPFS CID url:
https://bafybeiei7zadrztflc6krunhvqr3umzre7xjxfzvmyjs2ob2w7yykq63ea.ipfs.w3s.link/20221104172648.jpg |
---|
To learn more about IPFS and CIDs, please visit
There are few things you might need to run through this tutorial:
For Sparkbooth 7 and web3.storage to talk nicely, we will need a little help to translate their languages. The nodejs app will help us achieve this. It will need to be hosted on a server, and we are using Heroku for it (If you know a Web3 native way to host it, please DM me. I would love to try).
The final step is to prepare the software on the photo booth laptop to talk to our custom nodejs app to complete the setup flow. \
This app was built in 2022 and uses the existing web3.storage APIs. At the time of this writing, there are new beta w3up APIs available from web3.storage, which
The app is not perfect! There are a few areas that could be improved:
Even though this is just a gimmick to show ground, the security of the nodejs app is not ideal. Validating the passwords and username in application logic is not preferred. I believe we should put the application behind a firewall or API gateway that validates the authorization in the header before passing the call to our app.
The Sparkbooth 7 is great, but the UI does seem quite limiting. It would be good if we could customize this a bit more. Perhaps an open-source photo booth software could help us achieve this?
Potentially, we could use a separate computer to show the latest photos to visitors. They could select the photo they would like to choose to email to themselves, display QR code again, or share it on social media. This will involve building a frontend for the fil-photo-booth-uploader, which could be a very cool project for a front-end developer.
During the three-day Web Summit, the Filecoin photo booth had an uptime of 99% and a1% outage due to the internet connectivity issues at the convention. In total, the photo booth published 934 photos to the Filecoin Network. That’s almost one thousand selfies that are ready to go interplanetary all thanks to the very handy service of web3.storage!
The photo booth is also famous. On the third day, a reporter from CNN also interviewed the booth, (yes, the booth is getting famous… not me).
CNN reporter interviewing the Filecoin Photo Booth at Web Summit, Lisbon, Portugal
Please feel free to use this guide to build your own interplanetary photo booth for your events, gatherings, meetups, parties or just for fun.
The Filecoin network now has 16EiB of storage capacity and over 300PiB of data has been stored on it. There are many ways to contribute or use this project. Learn more about getting involved