How I Survived a Viral App, Almost Losing My Mind - Shajid Hasan Naim

sh4jid.me

7 min read Original article ↗

Going viral is fun. But it also comes with a lot of anxiety.

The accidental beginning

I was going through my level 3, term 2 finals. The way exams are scheduled at my university, there's one exam per week, so after each one we'd relax for a couple of days before getting back to studying. During one of these breaks, I thought I'd build an app. Just for fun.

The idea wasn't anything new. You sign up, you get a link, you share it with your followers, and they can send you anonymous messages. Wait, not messages. Letters. There are plenty of anonymous messaging apps out there (NGL, Kubool, and so on), but my twist was making the messages look and feel like actual letters. The beautiful, hand-written kind. People would then reply to them on their Instagram or Facebook stories. More on that later.

I called the app Chithi.me. "Chithi" means letter or mail in Bengali and some other Indian languages, so it felt like the perfect name. I asked my brother to buy the domain for me since the primary audience would be Bangladeshi people.

Building it fast

The development part was easy for me. Since I was juggling exams, I needed something I could work with quickly. I went with web technologies, mainly Svelte, which is my go-to framework for most web projects.

The first challenge was making the anonymous messages look like actual hand-written letters. I have this weird fascination with making things look realistic on the web, so this was the fun part. I gathered some fitting fonts in both English and Bengali, then used some SVG effects (mainly feTurbulence). The things you can do with SVG are incredible.

I ended up creating four themes. Some looked vintage, others modern, and all of them had that paper-like texture.

The Four Themes

The technical setup

I actually needed two different fronts. One was the app users would install to receive anonymous letters. I built it with svelte-spa-router (though if I had to do it again, I'd go with SvelteKit and @sveltejs/adapter-static), then packaged the whole thing into an APK using CapacitorJS. CapacitorJS has its quirks, but it's mostly great and was a perfect fit for my project.

The other front was for the followers to send letters: a public link like chithi.me/sh4jid that I could share for people to send me letters. This part was relatively quick to build.

For the database, authentication, and storage, I went with PocketBase. To this day, PocketBase blows my mind. On the surface it's incredibly simple, but there's a surprising amount of depth once you dig in. I say this despite having tons of experience with Supabase, Appwrite, and Firebase. To host my PocketBase instance, I chose PocketHost. I didn't even have an international payment method back then, and PocketHost was free, so it was a no-brainer. Their cheapest plan is still very generous, so if you want to tinker with PocketBase, give it a try.

Mind you, this was just another fun project for me at the time. I didn't put a lot of strategic thought into it. I wanted to build something cool, and that's what I did.

Launch and the feedback loop

When everything came together, I submitted the app to the Play Store. It was accepted relatively quickly. I texted a couple of my university seniors and asked them to try it out, share their links on Instagram, and see if their friends would send letters. And they did! They received letters and replied to them in their Instagram stories.

Story Reply Example

This turned out to be the engine of the whole thing. The replies looked great: a themed letter on a colorful story background, with the user's response underneath. People kept seeing them in stories and wanted a link of their own. I had a viral loop on my hands and didn't know it yet.

The explosion

The first day was relatively calm. A few people signed up and started using it. I was happy. Some friends reached out saying it was a great app.

Then, in a couple of days, my chithi table grew to 5,000 rows. Another day later? 5,000 more. And it kept going, faster every day.

By the end of the week, the app had delivered around one million letters.

One. Million.

At some point I worked out that about a hundred chithis were being sent every second. I was thrilled and slightly sick at the same time. It also cost me more than a few nights of sleep.

Crisis mode

Problem #1: bandwidth bills

The first issue hit fast. I blew through Vercel's bandwidth allowance almost immediately. They wanted $20 USD per month, and I really didn't have any way to pay it. I had to ask my brother for help again.

Before that, I moved my front-end to DigitalOcean App Platform. It didn't have a free tier, but at $5 USD per month it was cheaper. But guess what? I exceeded the bandwidth limits there too and had to pay quite a bit more.

Eventually I settled on Cloudflare Pages. Global edge network, good caching, and at most $5 USD per month no matter how much bandwidth I burned. Problem solved.

Problem #2: the database

Within the second week, I faced a bigger problem. With thousands of users hammering the database, my PocketBase instance on PocketHost was getting painfully slow. The app started lagging, negative reviews started arriving on the Play Store, and my anxiety kept climbing.

I thought I'd have to migrate to a dedicated server since I was still on the free tier. So I reached out to Ben Allfree, the creator of PocketHost, asking for help moving my instance to a dedicated DigitalOcean droplet.

As it turned out, mine was the first high-traffic app on his platform, and he didn't want to see it leave. Instead of just helping me migrate, he started investigating the performance issues himself. He found two problems:

  1. I didn't have ANY indexes on my database. Zero. Zilch. If you know databases, you know what kind of nightmare that causes at scale.
  2. I was using the real-time functionality incorrectly, which was also slowing down the server significantly.

Ben helped me create the necessary indexes, and using PocketBase's hooks, he turned off the problematic real-time features without me needing to push an update to the Play Store. That's the sort of thing I love about PocketBase: when you need to reach under the hood, you can.

Steady state and beyond

I haven't had any major hiccups since then. The initial viral wave has calmed down, but the app has kept a steady, healthy user base.

Last September 1st was International Letter Day, and the app saw another usage spike. That day I realized I needed a few more indexes to keep things fast. Many, many thanks again to Ben from PocketHost for his continued support.

The aftermath

So... that's the story of Chithi.me!

The app made me somewhat famous in my country. I gave interviews, so many interviews, even on TV. It was surreal.

Chithi.me is now a successful side project of mine. I've introduced some premium features and an advertisement program. I don't make a ton of money from it, but it's passive income from something I built that people genuinely love and use. I still get beautiful messages from users almost every day.

Lessons learned

If you're building something similar, here's what I learned the hard way:

  • Add database indexes from day one. Even if you're sure you'll never scale, do it anyway.
  • Pick hosting with bandwidth pricing in mind. Cloudflare Pages saved me thousands.
  • PocketBase is a great fit for indie projects, and I say that as someone who has used Supabase, Appwrite, and Firebase plenty.
  • You might think you're building just another fun project, but if it strikes a chord, be ready to scale fast.
  • Good people matter more than good infrastructure. Ben could have let me churn; instead he spent his own time debugging my mistakes.

If you've read this far, thank you! Building Chithi.me was one of the most stressful and most rewarding things I've ever done. If you're thinking about building something, build it. You never know what might happen.

And hey, if you want to send me an anonymous letter about this post, you know where to find me. 😉