Our CEO Gino has been getting tired of asking developers to publish his blog posts for him, so we decided that we should build a way for him to publish them himself. Cozy has always been a bicycle-focused company - Gino has a long history of bike racing, his wife Starla is a professional racer, and we regularly have a dozen or more bicycles in the Cozy office.
Last month, on the last day before we left the office for the holidays, the engineering team at Cozy held our first Hack Day. The Hack Day was intended to be an opportunity for our team to put aside our everyday work for a day and collaborate on a quick, fun project. We thought it would be fitting to make a bicycle-powered website publishing tool. And so the Velopsipede was born!
This website and blog is the public face of Cozy, and we want it to always be online and looking great. So when we want to make changes such as a new page or blog post, we first publish those changes to a private, internal version of this website. It’s really simple for anyone in the company to add a new blog post or edit existing content - even our CEO Gino makes regular site updates. After someone makes a change, we review it on our private version of the site, and then a developer performs a little technical magic and publishes the changes to the public-facing website that you’re reading right now.
The goal of the Velopsipede is to enable anyone to take content from our internal version of this site and publish it to the public site without having to do any technical/engineering magic.
Gino loaned us a bicycle and a training stand, and we brought our personal electronics and tool collections to the office. A brainstorming session ensued: how best to connect a bicycle to a computer? We investigated a few options and took a field trip to our local electronics store to see what solutions we could find. We decided to try a magnetic proximity switch, like the ones used by alarm systems to detect when doors and windows open. A magnet attached to a wheel spoke passes by a switch attached to the bike frame, and we can count wheel revolutions.
Our team divided and conquered - we wrote code to track a bicycle ride, to publish this marketing site, to take and upload pictures with a webcam, and to interface with connected lights and the wheel sensor. We broke out the soldering iron and modified some blinky lights so that they could be connected to a Raspberry Pi computer. After a full day of building, testing and debugging, we made some edits to the blog, hopped on the bike for a ride, and watched a successful deploy of our website!
A rider can choose a ride of varying length from 1/10th of a km, through 10km (aka Gino distance) all the way up to 100km (aka Starla distance). A progress bar and some blinky lights encourage them during their ride. If they complete the ride, the computer will publish the content from our internal website to the public website. A camera snaps a picture of the rider after their ride, and we post that picture and a summary of their changes to our company Slack.
Now that we have the Velopsipede, anyone can publish their own content to the public version of this website, without having to ask a developer to do anything. We met our goal of solving a business problem, and with an added bonus of encouraging the best kind of exercise - a fine bike ride!
We’ve open-sourced the code behind the Velopsipede, check it out!