Two projects have distracted me recently (and we all need distractions in these unsettling Covid days). The more recent distraction has been my first attempt to write a computer game - more about that in another post. Before that, I've been writing an online bascule editor for my Dad to use to add content to The Right Notes website. When the Right Notes project started, my Dad would email me the text of a blog post, and I would mark it up in Markdown, run bascule, and publish the web pages to the cloud. I've gotten pretty quick at turning these around. In my previous post on The Right Notes project I talked about the custom Spotify extension I have written to embed Spotify tracks into the website. It turns out, there are lot of tracks in Dad's website, and creating the spotify links was quite laborious.
I wondered if I could shift some of that work on to my Dad instead? After all, he has already written the text and researched all the music links.
So I decided to write a small web app my Dad could use. I was concerned that it might be too technical - Markdown is not for everyone - but I've been pleasantly surprised how well he has adapted to using it.
I decided to write everything in the cloud, and Amazon's AWS Lambda was the obvious place to go, so I started looking for a way to write a simple REST app in Kotlin and run it in AWS Lambda. Jetbrain's Ktor was the obvious choice, but it's a big beast, and very hard to get running on Lambda. There's a young project called Kotless which is supposed to help, but I struggled to get it work at all. It couldn't compile in Windows, and once I got that solved (a bug in their code) still had to attempt to run it in the WSL, Windows Subsystem for Linux. A lot of effort.
A lot of googling lead me to another, similar project - Osiris. Much smaller in scope than Kotless, but effective and it quickly got me started with some simple REST services. Osiris hooks up all the component parts required for Amazon - the Lambda function, the API Gateway, etc, so a simple project didn't take long. Well, once I got past the bug where Osiris would fail to deploy from Microsoft Windows - do Kotlin developers ever step away from their Macs? The Osiris developers have been responsive to my queries, fixed bugs and prepared example projects to help me out.
All this work on The Right Notes has slightly broken bascule for my own website, and I need to make some decisions for the project. I fear I'm going to have to add a lot more configuration in the project
yaml file, but I'm reluctant to complicate things further. There are also some changes required for my Dad's website, in particular around ordering and re-ordering posts. But those are tasks for another day.
I've got a computer game to write...