Categories
Architecture Development Tech Web

Full stack development with KTor and HTMX ❤️

Sometimes it feels like I have been yak shaving for the last 20 years. Well, not entirely. But things like Rules Engines, SOA, App Servers and debugging Hibernate comes to mind. 😉

On the back end, things have gotten better over time. But on the front end it, feels a bit like it is history repeating. While it is impressive what you can do in React. React and all the accompanying tools is too complex for many normal web applications.

So when I discovered HTMX it really tickled my interest to see how I could combine this into an efficient development flow. Back to basics. Hypermedia and HTML. 🙂

And I think I have a pretty decent starting point in the Github repo linked below. 🙂

A full stack environment with Kotlin, KTor and HTMX. Everything loaded, compiled and packaged with Gradle. Compile in IDEA to see the changes full stack.

The following repo contains a running example (just do ./gradlew run to test it) and a semi-detailed Readme: https://github.com/anderssv/kotlin-htmx/blob/main/Readme.md

You can try the “application” here (initial load might be a little slow as it is on free fly.io which suspends inactive processes): https://kotlin-htmx.fly.dev/

This holds real promise, and I hope I get to work with this for real in production soon. 🙂

Thoughts? 🙂

After doing this I discovered that there is a similar example linked directly from the HTMX site. Nice one 🙂 https://github.com/Rattlyy/htmx-ktor/tree/master


Subscribe for more:

Categories
Development Operations Web

SSL to the people

I have lost count of how many hours, days and even weeks I’ve wasted because of un-trusted self-signed/generated certificates in my time as a developer. Some util always trips up, makes me add a flag and then still fails. Trying to install custom root certificates works for some software, not all. It’s a complete mess and I long for the day it will be over.

Now, there is a solution: Let’s encrypt. Just get trusted certificates everywhere. Free, quick and easy. This will not give you all the levels of verification and trust that you can get from an SSL certificate; but it gives you an encrypted connection to every server out there. It’s way better than just HTTP, and it’s quick and easy.

Still beta, but took me about 10 minutes to set it up for this blog. Run, answer a question, check something and answer another. Bam! Encrypted! 🙂

Some thoughts and further links from Schneier.

Categories
Development Personal Web

Abstractions always leak

A quote of a quote in a InfoQ article on the release of GWT 1.5:

Key point: GWT gives you a lot of leverage, but it isn’t intended to be a “walled garden” in any way. Abstractions always leak, so it’s better to embrace that fact. We intentionally make it easy for you to punch through the abstractions and get down to the nuts and bolts JavaScript environment so that you can integrate with any other technology you like. That flexibility is a sort of insurance policy for both GWT itself and GWT users: you can be sure that you’ll be able to combine any client-side technology you want with GWT, and we (the GWT development team) don’t feel as if we have to explicitly provide integrations for an open-ended set of things, because you can always do it yourself without waiting on us. For an example of the kind of flexibility I’m talking about, check out Ray Cromwell’s Syndroid work.

This is a key aspect for good frameworks. Not only because abstractions leak, but also because sooner or later someone will discover a bug or a missing feature. Making it easy to fix or extend the framework for those special cases is essential for a good framework to live and to be adopted.