So! Hopefully my tech decision didn't upset you. Let me try to guide you how it went.

The failed attempts.

At first I thought I wanted to build a project that could eventually turn into a phone app. That, apparently, It's a whooole other thing.

Angular, React and Flutter are the three tools that were suggested to me the most. Flutter was build for multiplatform, but apparently the desktop versions suffer a bit, and I'm mostly a desktop guy. React could be turned into React Native and ported to a phone app, but the internet didn't seem completely sold on that being a good thing. Angular was strongly oppinioned (whatever that means), used TypeScript (which I find really attractive, the thing I miss the most from C++ is having strongly typed objects) and seemed just as powerful, while streamlined.

I went with Angular. I purchased the highly recommended McMillian course on Udemy (which was really good, and I will probably go back to it at some point) and got started. But I ran into that "Who knows where the language ends and the library begins" issue I described in another post. I don't vibe with JavaScript yet, so It is not clear to me if I'm learning Javascript, TypeScript or Angular.

Halfway through the course I started to watch Jeremy Howard's talks and courses for an unrelated reason, and I stumbled into this new project of his called FASTHTML. In summary it allows you to write everything in python, essentially never leaving the backend. Cool project, but it clearly still needed me to know what was going on under the hood anyway (to my untrained eye it's CSS and HTML syntax in a Python file), and at this point I don't know what the heck a div is, no matter the language I'm writing on. He also featured MonsterUI, a project build on top of FastHTML (and HTMX) that abstracted everything even more, and I got a website running with it in 20 minutes using a single file, but then I was again back to where I started! Relying on a tool like streamlit to run away from learning the fundamentals.

It was around this time that I wrote by previous blog entry, and realized that my requirements are not as complex as those of a bank, or facebook, or anyone else. So, I readjusted my goals: My proof of concept was going to be this very blog, a basic website where I could publish some notes written in markdown. Then, to consider this trip down web development lane completed I wanted to fully replace my streamlit applications. For those unaware, that would mean:

  • Good feeling user inputs, including the ability to upload files
  • Embedding plotly (or python based) charts
  • Rudimentary user authentication
  • Have it not suck

The new approach

Refocused, I went back to reading a bit more. The main conclusions I took from my googling and youtubing were: (disclaimer: all may be wrong)

  • There is no escaping HTML. Everything is HTML. It is the very building block of the web, and whatever fancy framework you are using it all compiles down to HTML in the end.

  • CSS is what makes the website look nice. And it's not as simple to make them look pretty as I thought it was. Once again everything turns into CSS in the end. However, you may avoid writing CSS by using a library to abstract it away as much as you want. For example, bootstrap -> Tailwind -> CSS

  • JavaScript gave the web it's potential to replace most desktop applications and is used everywhere for most things. It is undoubtedly useful and important. Everything cool about the web started once we got Javascript running in our browsers. And I don't really vibe with it.

JavaScript is what killed my previous attempts every time. I get why it's needed, I understand it's usefulness, but it's way overkill for my needs. Frontend frameworks were built to make the websites that made desktop applications pointless. Today you can use Photoshop, Microsoft Office, Google Earth and even play Quake in your browser, and that's great. But I am not looking to make any of those things, I just need a white canvas with some plots, and for that, most of the frameworks look to me like shooting an ant with a bazooka.

p3.jpg

Plot shamelessly stolen from theo.gg

That's where HTMX came to the rescue for me. It supercharged HTML with the most basic modern functionality: It allowed my humble website to update without flashbanging you with a full page refresh, and that allowed me to mess around with HTML and CSS, while postponing the inevitable JavaScripting for a little bit longer. (It seems to be able to do a lot more things, but after checking that plotly charts automatically export themselves to plain HTML, I was sold).

I could get started with FastAPI, the most basic of basic APIs for the backend, and get a simple website up. Learn how to deploy the thing, properly connect to a database, and focus on writing and creating some content. It also gave me an upgrade path, to switch from FastAPI to Django, from Bootstrap to Tailwind, and then yes, whenever my projects start getting more ambitious I will go back to that Angular course and finally learn how to properly build a website.

That is, unless you undecisive lot decide to reinvent the wheel again. Who knows.