Guest Blog Post: Essential Code
6 June 2024Who am I?
After exiting my software agency in 2023 to continue solo, I founded Essential Code, dedicated to empowering SMEs with efficient No-Code and Low-Code solutions. Despite my transition, some of my existing clients insisted on retaining my services, including SunRocks, a company providing insurance services. The platform I built for them streamlines all their daily operations and customer interactions. This blog post details the work and migration efforts I undertook for SunRocks to move from a complicated and cost-intensive hosting environment to Nhost.
SunRocks primarily deals with the day-to-day operations of an insurance agency processing new insurance policies, handling claims, etc, all with a portfolio of over 60,000 policyholders. What makes it unique is that SunRocks' CEO, Roland Hehle, aims to manage the entire daily operation with just one additional employee. This means the software's automation level is high.
I've had the privilege of managing the SunRocks project for about 9 years, and during my time as the agency's CEO, we continually expanded the software, most recently incorporating an internal OpenShift installation. This works smoothly as long as you have a team and the deep know-how required to operate such a system. As a solopreneur, it was clear that I couldn’t handle this alone. A pragmatic and forward-looking solution was necessary.
Infrastructure and Tech Stack
SunRocks relied on Hasura + PostgreSQL at its core. Authentication and authorization were handled via Keycloak, and a file storage (S3 compatible) via OpenShift. A few external services like Postmark, PDF Monkey, and Mollie (payment) were integrated. To manage the sometimes high number of emails or PDF creations (insurance certificates), we introduced a queue/worker concept. The queue itself was built on PostgreSQL for simplicity. There were three different frontends: a customer portal for policyholders, a portal for sales partners, and an admin center for all back-office activities. The two portals had already migrated to Next.js, while the admin center was still a Webpack/React application with a custom build.
List of Services:
- Hasura + PostgreSQL
- Keycloak + oauth2-proxy
- Node.js workers for email, PDF creation, and payment
- Node.js API for business logic, triggered by Hasura events and actions
- Next.js-based portals for policyholders and sales partners
- Webpack/React Admin Center
Hardcore over-engineered and resource-intensive, of course :). But we had the necessary server capacity at Hetzner and an excellent team of developers. For a team, using the project as a technical playground was fine, but as a solo developer, it presented a massive challenge. How could I operate and develop the software on my own without it becoming a full-time job? After all, I also wanted to pursue other projects with Essential Code. 🙂
The constant
From the beginning, it was clear that I did not want to proceed without Hasura. I would even go so far as to say that I will not build any API without Hasura—it's just a waste of time, considering how effective it is with Hasura. That's when I came across Nhost. My interest in k8s, DevOps, and cloud infrastructure is limited (though I recognize its importance and have at least a good basic knowledge), and it’s simply unprofessional to offer operations for mission-critical software solo. What if I were incapacitated? A reliable PaaS provider was the only option from my perspective.
For completeness, I looked at other alternatives. Operating everything through DigitalOcean was too complex and felt insecure. Rebuilding on Supabase wasn't feasible as it would have been too much work, and without Hasura, my productivity would have halved. It also didn't seem mature enough. I even approached a regional IT company that offers application hosting. They found it too complex :) So, I realized that Nhost had everything I needed. It's open source, which means if things go completely sideways or if Nhost as a company ceases to exist, I could somehow manage on my own and not be totally lost.
The migration
Since SunRocks was already using Hasura + PostgreSQL, the transition was straightforward. Create a project, get the CLI running, study Nhost's directory structure a bit, and add the existing migrations. Up and running in 2 hours. PostgreSQL dump restored. Done.
Replacing Keycloak with Nhost Auth was trickier. I had an export from Keycloak, and creating users with all permissions in Nhost Auth was quickly done. However, replacing oauth2-proxy, which we had relied on to save work in the frontends (if only it had been that simple—if you encounter the proxy at any project, run fast), required a bit more effort to implement things like login, password reset, and page permissions. However, Nhost's tooling and documentation are excellent, and no serious problems arose. The same goes for Nhost's storage.
Services Replacement:
- Direct transfer of Hasura / PostgreSQL
- Central Node.js service with all business logic (triggered by Hasura events) replaced by Nhost Functions
- Worker for the job queues as Nhost Run Services
- Next.js-based frontends run on Vercel.com
- Webpack/React-based Admin Center also as Nhost Run Service with a custom domain
I can't stress enough how awesome it is for a platform like Nhost to offer something like Run. Typical BaaS providers give you a set of services to start with, but usually have no option to run your own custom services in case you need to go beyond what they offer. Nhost Run is one of my favourite features about Nhost, it's really amazing.
Performance Issues
When you're used to having too much hardware, you get used to certain query times. Although we were doing well with Nhost's Pro Plan for customers and partners, the performance for exports and reports in the Admin Center was not good enough. Thanks to the Nhost dashboard, however, you can easily configure every aspect. More CPU? More RAM? No problem. As someone averse to DevOps, this was particularly handy because the complexity is well "hidden". Even the config file is tidy and understandable. The developer experience impressed me from day one. Even my client uses the dashboard to create users.
Duration
Since everything had to be done rather quickly, I probably worked a bit more than usual. Still, from the starting gun (Nhost project created) to the complete migration, it took less than two weeks. Add another 2–3 weeks for bug fixes and data adjustments, and the entire transition was completed in about a month. I was surprised at how smoothly and quickly everything went. The Discord support from Nhost was invaluable, often providing answers to questions within minutes during such a critical phase.
Conclusion
I am convinced that without Nhost, I would not be able to manage a project of this magnitude and complexity as a solopreneur. Even though I've since reduced much of the complexity to make the software more compact, I couldn’t maintain it without the services from Nhost. Especially considering that during this time, I developed two SaaS products and other projects (also with Nhost).