How I Live-Blogged Laracon, Twice!
Update: The code repository for the live-blogging platform is now live on GitLab! https://gitlab.com/chrisforrence/laracon-live-blogging-platform-2019
Greetings from back-in-Atlanta, fresh from my experience in New York at Laracon US! This was the third Laravel conference I've attended, and as the other times, it was an absolutely wonderful time. The speakers were great, the venue was hoppin', the sponsors were generous (and I'm looking forward to enjoying my bath bomb from Sentry), and it was such an enjoyable trip!
I knew that I wanted to live-blog the experience again, especially since it sounded like a good number of folks got a lot of value out of it last year. Last year, I built out my plan and platform fifteen minutes before leaving for the conference venue, but since I thought about it earlier this year, I knew I wanted to start early!
Fast forward to a week before Laracon...
In the time since last year, I had started live-streaming myself coding and working on some projects; while I didn't do it on a consistent basis (or even on a consistent project most the time), I still had accumulated a little bit of a following on Twitch. A week before, I did start building out a new live-blogging platform to handle this.
One of the things that I did enjoy about last year's platform was its simplicity; Jigsaw to build, cronjob to commit and push, Netlify to deploy. There were a few things that I did want to do this year, though, including get a sense of how many folks actually used the live-blog and to be able to push updates more frequently to the page without needing the user to manually refresh the page.
Based on that, I decided to begin building out a Laravel application that kept track of talks and presenters. Presenter information was pretty basic (essentially just their name and Twitter handle), and the talk model just kept track of its title, when the talk was to start/end, the talk contents, an optional presenter and an optional slides URL. Unlike last year's conference, I didn't know what the talks were going to be about this year (just who was presenting).
So because all of this information was going to be updating either infrequently (talk title, slides) or rather frequently (the talk text), I decided to use AJAX calls when building out my admin console so that I would either update the database when the appropriate input field lost focus (e.g. title, slides, start/end times) or when a few hundred milliseconds passed without activity (e.g. talk text). From there, I decided to broadcast a websocket event with the updated contents to let folks' browsers show the new content.
So, cool, I'm typing stuff in one browser and it's appearing in another. What if the next talk starts up?
I decided to handle that by setting up a cronjob to run every minute. If I detected that the previous current talk (held in cache) differed from the new current talk, I would broadcast an event that caused users' browsers to refresh to pick up the new talk.
So cool, I've got that coded, and everything's working in my development environment! But by this point, it was the day before the conference started. I've gotta get something online soon so that I can do some testing. Enter Laravel Forge; that made it easy to spin up a small DigitalOcean droplet and deploy to it!
As with last year, here are the things that stood out to me:
- I do want to give special thanks to Brian Logan for donating the laracon.live domain to me; he had given me a good number of ideas for this year's live-blog, including the ability to automatically post updates. Thanks again, Brian!
- I may have made a mistake and forgotten to add my Pusher credentials to my Forge server...then when it still didn't work, I realized that I forgot to update my broadcast driver. Getting those two things knocked out within the first two talks, and past that was smooth sailing! Thank you, Lance, for letting me know of the issues!
- I ended up camping out in the house right balcony (stage left, as it were); it was nice having tables and access to power outlets. Unfortunately, my spot did end up shifting a bit as tables got claimed and things moved, which did make things more difficult, as I no longer had a good view of the slides. For the final few talks of Day 1, I ended up heading into the main audience so that I could get a view of the presented slides.
- As with last year, I ended up using my phone as a hotspot so that I could guarantee Internet access. Unlike last year, I just left it plugged into my computer! It turned out being a great idea, since I could turn Wi-Fi off on my laptop and conserve battery while not burning through phone battery. Cell service was a bit iffy down in the main audience area, but it was much more reliable in the balcony.
- On Day 2, I was called down for Tighten's typing competition finals! While I placed 3rd out of the 3 finalists, it was still a blast!
Technologies
So here are the different technologies that I used, and how I used them:
- Laravel is...well, it's a PHP framework! It's pretty darn good; so good, there's a conference for it!
- Pusher handles websocket connections; I did have to bump my plan from the free one (max 100 concurrent connections) to the $49/mo plan for Taylor's talk, which peaked at 125 connections. Breeze to set up though!
- Laravel Forge got my server provisioned and configured properly.
Aftermath
Last year, I could share my progress as a series of commits; this year, while I can't, I do have other metrics available.
- There were 114 concurrent Pusher connections and a total of 142,135 messages broadcast. That's a lot of folks!
- According to Fathom, I had roughly 3,400 visitors and 18,600 page views across all pages, including the individual talk pages (Freek Van der Herten's talk was the most popular individual page)
I honestly enjoyed the experience; it was rewarding to me that so many people got value out of it. Next year, I plan on building out this platform a little bit more and make it easier to have multiple contributors so that different folks can be responsible for different talks. It could also be an interesting side-project for me, and I'll be making the project public on GitLab.