Copy/Pasta from The Tweeting Photo Booth on the EMC {code} Blog
TL;DR – https://github.com/emccode/photobooth
The months leading up to a big conference is usually when the ideas need to start churning. @gracelyb had an idea for a unique way to keep people entertained while showcasing some technologies from EMC as well as showing how it can integrate with APIs from different companies. That’s where the EMC {code} Photo Booth originated.
The Photo Booth is a MEN (minus the A) stack application using MongoDB, Express.js, and Node.js. This seemed like the perfect architecture because it needed to be a semi-scalable web app that can hold a couple thousand documents/records. In addition, it needed to be built in a way that things happen in the background without breaking the flow. The non-blocking format of Node.js fit the mold perfectly.
This was actually an extremely fun project to tackle because it really allowed me to touch every end of the stack from front to back. To make it all happen there is more than just Node and Express, but there’s jQuery, AJAX, Amazon SES (simple email service) API, Twitter API, Constant Contact API, EMC ECS S3 API, and even more javascript.
In a nutshell, here’s how the architecture looks (minus the Constant Contact API that was added last minute). It’s a two station setup where users register through a Kiosk of sorts. Once registered, they are added to the queue and can go to the Photo Booth. Then a user can go into the Photo Booth, choose his/her name, take a few pictures, and wait for the email and tweets to come from @EMCCodeBot. The real magic happens when a picture is taken. Webcam.js will initiate the webcam of the computer, jQuery will take the picture, then an AJAX POST request is made to Node.js to upload the photo into ECS via S3 API and then that url is appended to an existing MongoDB document. This is done 4x in a row without effecting the user’s front-end experience. Once all the photos are done, a few more AJAX calls are made to Node.js to send a customized email based on a registration information gathered, and a tweet is sent after downloading the 2nd photo taken in the photo booth. I’ve become a real Node.js fan boy. Oh, and the best part… it all runs on top of Pivotal Cloud Foundry using 4x 256MB instances. No infrastructure to worry about.
Cool, so how does it look? Without being to repetitive, check out the GitHub repo. All the screenshots are located there. https://github.com/emccode/photobooth
But here’s some good ones from myself and the team! If you’re out at EMC World, come check us out at the {code} booth and get your own photos taken or keep watching the @EMCCodeBot stream to see them all!