Devlog 13

You're viewing a Gemini article on the web

It's much better to view it on Gemini!

Due to the job hunt, things have been slow going recently. I've been doing a lot of training and have spent over a month on an interview process for a job that I ultimately can't have because the location of the job has changed. Oh well.

Today's work

I've not done anything yet, but I've been brooding a lot about the state of the web and how much I dislike doing things the way I've been doing them. When I started making eigakanban I approached it the same way I've approached all web projects: create an API that serves JSON then create a frontend that consumes it.

For fun, I recently converted a project from a sprawling React behemoth to a single page of HTML with inline JavaScript. It really gave me pause and forced me to think about the state of frontend development these days. I realised that I don't like the way I'm doing things, and that there is a better way to approach it. I've come up with two major pieces of work I want to do to make the project better.

What's next?

Firstly, I'm going to remove gin from the project and revert to using net/http. I used gin initially because it offers a nice structure for interacting with REST functions and is fairly easy to understand, whereas net/http was historically a bit finicky when it comes to creating APIs and requires more understanding of Go. Now that I have that understanding and net/http has been updated to better support REST-style interactions, I think it's better in the long run to revert to using the standard library over a framework like gin.

Secondly, I'm going to prioritize serving HTML from the endpoints rather than JSON. I've fallen back on JSON because it's how I've always worked, and it's just what I think of when I think about REST APIs. In the back of my mind I've always been aware that delivering HTML is the original way to interact with endpoints, but I just went with what felt comfortable. However, working with frontend again has made me realize that working with JSON and consuming it with a frontend framework is enormously burdensome, and that it would be far better to write the HTML out once and then just use a framework like HTMX to interact with the API. This would hugely reduce the load on the frontend and would enable me to verify and stanadardize the response on the backend where it can be done far quicker. For downstream developer purposes I'll keep the JSON response structure, but it won't be what feeds the frontend.

This is going to take some time, but I think it will ultimately get me closer to my original goal of a lightweight application and make it far easier to work with security. Time will tell if I am actually capable of doing this right.

Tell me what you think.