Building a Micro-SaaS in 30 Days
Introduction
In late September of 2023, a friend convinced me to turn a personal project into a Micro-SaaS business, InboxGrades . One month after launch, this article shares the options for approaches and tools that I evaluated, and the choices that I ultimately made that led to success in building a Micro-SaaS in 30 days.
I spent about a week researching ways to rapidly build a sustainable Micro-SaaS and my initial instinct was to use a “SaaS in a box” solution. I evaluated and liked PySaaS and GeniePy, both written in Python. I also considered the PHP/Laravel-based Electrik.
I am quite competent in both PHP and Python, but my “front-end” web skills are rusty and date back to the ’90s/’00s web, before SPA and front-end Javascript frameworks took over. For that reason, the “one language” approach taken by PySaaS and GeniePy was attractive to me. However, my preferred and primary muscle memory language is Perl and the existing RPA software that underpins InboxGrades is written in Perl. And so, I wanted to give Perl a fair shake, but I could find nothing like PySaaS or GeniePy to “bootstrap” a Perl-based SaaS business, and so I determined that I would have to do a lot more of the heavy-lifting myself.
I ultimately chose to use Perl and Mojolicious with a few wrinkles that I describe below. Its first line of Perl/Mojo code was written on Oct 7th and InboxGrades went live on Nov 6th – exactly 30 days.
User Management and Authentication
In my evaluations, I came to understand that PySaaS and GeniePy both used third-party services for user management and authentication. That knowledge led me to consider using one of those myself, directly. I chose to use Clerk and have been pleased with it, but Userfront seems to be a worthy competitor and PySaaS uses Firebase . For a self-hosted and zero cost option, Keycloak is also on my radar.
Subscription Management and Payments
PySaaS uses Lemon Squeezy and GeniePy uses Stripe . I evaluated both of those, plus Zoho Billing , and chose to go with the venerable Stripe.
HTML5, CSS3, and the Modern Web
After understanding the relative ease with which Clerk and Stripe could solve my user and subscription management needs, the question of front-end development loomed large. I am a highly competent Javascript programmer, but as I stated earlier, my experience is from the days prior to SPA and Javascript frameworks taking over. Most Micro-SaaS businesses have very low revenue-per-customer and that is certainly true of InboxGrades. And with no guarantee of success, I did not want to invest the time and energy to evaluate, choose, and then learn a Javascript framework, along with a new paradigm of SPA-based web development.
HTML5 and HTML Over the Wire
“HTML over the wire” (Hotwire) has been on my radar for a while as it seemed like a modern twist on AJAX-based, XMLHttpRequest() + eval() + innerHTML, techniques that I used a couple of decades ago. This project was my first opportunity to really dive into Hotwire and I am impressed. In short, the concept is to use Javascript’s fetch() API along with HTML5 attributes to cleanly implement a HTML-centric and server-side rendered approach to SPA-style web page interactivity, with little to no Javascript. I chose to use Hotwire Turbo from 37signals, but there are at least three reasonable choices:
CSS3
I am impressed by the progress that CSS has made since my prior experience. I am stunned by the things that can be accomplished with CSS3 in a modern web browser with little to no Javascript. If you’d like to poke around the InboxGrades HTML source code, note how precious little Javascript is used for things like the hamburger menu and the rotating and fading background images.
Mojolicious
My choice of Mojolicious was driven exclusively by the fact that I am a minority partner in a B2B SaaS company that sales a product built with Perl, Mojolicious, and extJS . I briefly considered Dancer2, and I am sure it is a worthy competitor, but the personal value of increasing my Mojolicious expertise was high. Having said that, I have found Mojolicious to be a real pleasure to use. Honestly, I think that the only complaint that I have is the lack of multi-line comments in Mojolicious templates.
What About Data Storage?
Luckily, InboxGrades is simple enough, at least at this stage, that all stateful data can be stored in encrypted files on disk; there is no need for a SQL- or a NoSQL-style server. Instead, AES256 encrypted JSON files are stored in a filesystem hierarchy that is keyed by username.
Putting It All Together
InboxGrades is hosted within a single Ubuntu Linux VPS at Vultr . Mojo’s Hypnotoad server runs the application and sits behind a nginx reverse proxy. Certbot maintains a Let’s Encrypt SSL certificate for nginx to use with HTTPS. All of those services are managed by systemd.
I hope that this article helps someone. Thanks for reading.