Thank You, Bolsonaro - Part 2
As you probably guessed by the title, this is part 2 of the story of how I created the Medo e Delírio iOS app. You can find part 1 here.
The middle
Ok, let's now focus on the good stuff. Below is a showcase of the key features I developed for the app. I hope I can express the joy coding this has brought me.
I'll cover: Folders, Share as Video, Trends, Content Syncing, Reactions and some notable mentions.
Folders
I first talked to Marco Bonito in June 2022, a little over a month after starting the project. Marco is a Communication Studies college teacher from my home state and an avid listener of the Medo e Delírio podcast. He's also the source of some great ideas, as you'll see below. We got in touch through Twitter and among our first chats he suggested I add a way of tagging sounds in the app. I had delivered favoriting sounds in the first release, but Marco argued his favorites were getting too large to find what he wanted.
I considered some sort of tagging with the nice classic tag icon we see in many places but settled on folders as a "grouping" concept because I figured most of the user base would grok it better than tags.
Users can hold on sounds, choose Add to Folder and then create a new folder or pick an existing one to put the sound in. I shipped Folders on June 29th, 2022 on version 2.0 of the app.
Share as Video
Share as Video is arguably one of the early highlights of the app – one that set it apart from the Android version for a good amount of time.
Marco came to me asking why TikTok didn't figure between the share sheet options for sharing an Alexandre de Moraes sound. I posited TikTok probably did not have MP3s among its supported file formats. He later asked if I could support the then new Audio Tweet feature. I tried it out and found that Audio Tweets were something you had to record live, it didn't allow you to attach an audio file to a tweet like you would to an e-mail. At that moment I said: but videos work. We could stitch the sound to a random image and post that.
We went back and forth a little bit more and in August 2022 version 3.0 of the app shipped with Share as Video, a way to extend the reach of each sound bite to other social media. Its primary use was Twitter.
Trends
In my mind I thought this one shipped much earlier than it actually did. It's one of the ideas I took from the Twitter thread that started all of this. What if you could know what are the most popular sounds being shared at the moment among the app's audience? Simple right? Yeah, not quite.
In modern days information seems like something that is just around us, effortlessly available. But if you're a software engineer you know that takes some effort, planning and also servers.
I started my career as a Delphi developer working on ERP software. (Yep, old Delphi is still around.) There I got to create many screens, some SQL queries and, of course, had my first encounter with servers. The company I worked for at the time ran a janky old SOAP server. I never had to do anything too complex to that server, but that experience taught me how stuff worked. I can find my way around a Linux server, install and run some stuff. Problem is I didn't know any of the modern languages and frameworks used to build servers, but I knew that if I had to learn PHP or Node.js this feature would never ship.
So I starter digging on Vapor. Vapor is the most prominent Swift on the server framework out there and it's honestly magic ✨. You use the same tools and resources you would use to develop iOS apps but instead you get to build your own server!
And best of all, since Swift is open source and compiles to Linux, you don't need an expensive Mac in the cloud to host your server. You can do it for as cheap as 5 US Dollars through Linode or any other cloud provider, AWS be damned. And this was oh so important to me because $5 already translates to something like 30 Brazilian Reais – depending on the exchange rate – and keeping costs low was a priority.
My first commit on the medo-delirio-api repo is dated June 1st 2022, showing I was thinking of this pretty early on. As I said, I was set on out-featuring the Android app pretty seriously. Sidronio, look out.
Plans started big. I would show top shared sounds, top apps users were sharing to, top shared songs, so much stuff! But since October 2022 when Trends shipped in version 5.o, users mostly check what sounds are trending on the right most tab of the app, and that has been enough for now. Later I added personal trends (and also a year-end Spotify Wrapped of sorts) but not much else regarding this feature.
Content Syncing
One thing Sidronio beat me to was content delivery. From the start the Android app had new sounds delivered through Firebase. I'm not a fan of using third-party libraries/frameworks/services if their value is not abundantly clear to me. I really didn't want to add Firebase to the app. Also weighing on this is the fact that, to this day, I haven't had to implement Google's service into any app.
Early in 2023 I had to come up with a subject for my college degree's final project. That's when my now ex husband suggested I work with Vapor and Swift, since I had already dabbled on it before. While I was doubtful at first, he convinced me using Swift on the backend was something novel enough that it could result in a good research paper. That's how the Swift sync system Medo e Delírio now has started. Thank you, Vitor.
From March to September 2023 I spent many nights and weekends devising a purely Swift contraption. Here's the breakdown of what the whole system looks like, taken directly from the paper I wrote:
The same server that handles Trends, user analytics and other stuff got fitted with content awareness. It stores tables with authors, sounds, metadata, all that stuff and provides it to the app.
Updates are handled on the app side as small packets of data, each describing what type of change is being made and to which content. It's all very hand made but that was part of the appeal. I always liked understanding how things work, and building a sync system from scratch was enticing. What is an update after all? How do you keep things the same between client and server? What different strategies exist? Those are all questions that interest me.
And so Medo e Delírio's sync system was born. Through purely Swift and Apple tech (Foundation, Vapor, URLSession), new content is delivered to the app automatically. I presented this as my final graduation project on November 28th 2023 and got approved with distinction by the grading teacher. 🥳
But why does it matter? Until this point all new sounds in my app were added through shipping new versions to the store. This was tedious and inefficient for me. Also, every App Store release must pass through a review process where a human reviews the update on a real device, and that can sometimes take multiple days. Perhaps because I went after every suggestion from his users, Sidronio knew this and teased me with this drawback of my app. He would sometimes add "no need to update" to tweets promoting new versions of the Android app.
This ended on September 2023 when version 7.0 of the iOS app finally shipped, after a month or so of beta testing and 6 of coding. 🤠
Reactions
The Reactions feature has existed in some form since very early on in the project. First called Collections, I wanted a way to editorially highlight sounds from the Sounds tab. This would help with content discovery, a problem for every platform or service once content gets to a big enough quantity.
The thing is, I could never finish Collections, always putting it off to work on other shiny, easier things. There were just too many changes that needed to happen as I wanted it to be server-driven so I could quickly respond to political news and events. Bolsonaro jailed on a random Friday? We've gotta have a group of related sounds ready!
But I kept putting it off. That was until this year in April when I set down and decided Reactions was going to be the main feature of version 8, to be released on the app's second anniversary (May 20th 2024).
That's when the yarn ball started to unravel. That's a dramatic way of me saying there was more work hidden underneath the need for this feature. In the two and a half years since creating the app, I've been honing my programming skills both on and off work. If you were to look at the old main view of Medo e Delírio, you would see a good example of spaghetti code 🍝. I just didn't want to Cmd+C Cmd+V the same sound list code for a 5th time.
I opened Figma and laid out what places inside the app used the list. There were 4, 5 with Reactions, and each had different context menu requirements. Context menus are used throughout the app for showing sharing, favoriting and other options when a user holds for a few seconds on a sound.
The sound list needed a big refactor so I could avoid having its code repeated for a 5th time. I needed to turn it into an independent component. That refactor did happen and it was great. It only took 5 months. 🤡
I missed my own deadline by 4. All was good, this is a personal project after all, and my free time can't be eaten up by it alone (is what I tell myself). There were also other things going on near home.
Different from its initial form, Reactions gained its new name because I started thinking of it a bit differently. As an avid Twitter user since my early teens, I heavily relied on the GIF option when composing a tweet. If you used that you'll recognize the similarity between what the GIF picker sheet looks like and the final version of Reactions.
Instead of just grouping sounds, this new tab focuses on helping users find a sound that makes for a good reply, a common use case for the app. You could be taunting a friend, commenting on a current topic or just using the same sound from the same comedic group for the 100th time, Reactions should help you find it faster.
Reactions was the highlight feature of version 8.0, released on November 11th, 2024.
Notable mentions
In November 2022 the iOS app got to 9,000 downloads. That felt awesome!
Before that I worked on Lock Screen widgets, something new to iOS at that time. Late in 2022 we were living through a Bolsonaro vs. Lula election. My dream was getting Live Activities working but I didn't have the chops to do it then. That might change soon. Lock Screen widgets were a good middle ground. I still got to play with a new API and deliver something nice to users without all the complexity Live Activities have.
Year-end Retrospectives and the audience's donations to the Rio Grande do Sul May 2024 floods are also notable. I might write about those in the future.
What it means
These posts are personal because creating this app also felt personal. My persistent memory when I think of Bolsonaro and COVID-19 will forever be the doom and fear I felt in 2021 while we were still in the height of the pandemic. Remember, we did not know if we were going to get through this alive. 700,000 Brazilians didn't, thanks to Bolsonaro's sadistic inaptness. His Health Minister used an entire city in the middle of the Amazon as a fucking test ground for herd immunity for fucks sake!!!
I know Brasil is not alone in this. The world has seen a fascist science-denying deadly wave in the last couple of years. "The old world is dying, and the new world struggles to be born: now is the time of monsters." goes the Antonio Gramsci quote Sociology doctor Sabrina Fernandes opens her book with.
I would love to tie in how my mom's faith in education is what got me here. That definitely played a part. But upon further reflection I cannot deny reality's part in all of this. Reality imposes itself no matter how hard you try denying it. We saw it with COVID, we see it everyday in our work lives. The crucial detail, though, is we're all prey to the narrative and there are piles of money thrown to try and disinform us. I thank Cristiano and Pedro for all the time and sweat spent putting the podcast together. Knowledge is a powerful weapon and you two know how to weaponize it with humor. Your contribution to Brasil is invaluable.
If it isn't clear yet, making this app helped me push through some hard moments in my life, be it a flood, a breakup, or a terrible job. It continues to serve me when times are hard, motivating me to keep coding, which is something I love, but also serving as proof that software, like the podcast, can be both fun and politically engaging. You could say it is my new favorite book to keep close while the world sucks.
You can download the Medo e Delírio app on the App Store. It's available for iPhone, iPad and Apple Silicon Macs. You can also listen to the podcast on many different places and you should buy the amazing book I featured on the first post's cover, coauthored by Medo e Delírio, Gabriela Biló, Pedro Inoue and Daniel Lameira.