image.png

There has been… much to do about CI/CD and hosting platforms over the last week on Twitter. Some proponents of Vercel had some great points and explained their position very well. As with most things, Web Dev Cody had some great nuanced points, most of which were explained well here

https://www.youtube.com/watch?v=a52MMobkuhU

Some influencers got nasty and just plain weird about Vercel and their religion hosting platform of choice. I’m not going to post their takes here because it’s not worth stoking that fire again.

Right around this time, I had gotten fed up with the JavaScript development ecosystem. I got tired of wrestling with NextJS configs and the nonsense that comes with the React ecosystem. Some of it is skill issue, some of it is just the ridiculous complexity that comes with JS dev. Regardless, I’d had enough, and decided to start writing web apps in Rust using the Leptos framework.

Leptos is an awesome framework for developing reactive CSR and SSR web applications in Rust. It’s certainly… quirky.

https://x.com/valhalla_dev/status/1828637479278084269

A lot of this is because the Rust syntax is quirky, to be fair. I mean, look at any function that has 1,000 traits and lifetimes and you’ll go running back to Python in a hurry. It’s not for the weak.

I’ll probably write another blog about Leptos, WASM rendering for the web, etc. but honestly I want to spend more time with Leptos before I give educated opinions. Instead, I’m going to document my descent into insanity just trying to deploy a Rust web application.

The Coolify Attempt

image.png

I skipped over Vercel because I do tend to agree with the folks who are wary of their predatory pricing, and there was an open source, self-hosted alternative I could deploy that I fell in love with.

Coolify is an awesome platform. I’m going to talk about how frustrated I got with it here in a second, but I want to preface that with saying Coolify is awesome, allows for a lot of extensibility and is honestly a great replacement for Vercel. Regardless of what you’re about to read, if you’re doing NextJS dev, I would recommend doing it with Coolify on a DigitalOcean or Hetzner VPS.

What I was (attempting to) do is deploying a Rust Leptos CSR (client-side rendered) application to a VPS using Coolify. This works similarly to Vercel: it runs in docker containers, can deploy via GitHub integrations on branch pushes, etc. If you’ve used Vercel, there is very little difference between using Coolify and Vercel… except you get far more visibility into what’s going on, you can tweak and improve it at will, and you’re not subject to the whims of Vercel’s billing department when your app goes viral.

With a Rust Leptos CSR solution, one of the options for deploying to production is to output three types of files: an index.html file that contains a link to a JavaScript file, which loads a WASM file that contains the beef of your application.

Here is the first time we get into the skill issues portion. Let’s highlight my shortcomings, both to clarify where we’re coming from, and to keep me humble. The internet is good at that.