The First Week, A Retrospective.

This was much more than just Golang.

Up to this point, everything that needed to be done architecturally for this site has been completed.

I aggressively went through all of these topics and didn’t give too much thought to any of them as I went through, agnostically learning as much as I could. As a little background, every piece of this site was something new for me. This is my first time getting a domain, using a web host, AWS, Golang, TailwindCSS, Github actions and projects, etc. Since I went so fast and aggressive at getting all the pieces in place, here are some of the pitfalls that I hit, and interesting (maybe) stories I have to tell.

AWS Fargate in ECS.

Let me start with the largest pitfall I had. AWS Fargate, although is great, was just not what I needed for this project. The project is built into a Docker container, which was perfect for AWS Fargate. What is not perfect with AWS Fargate is a budget and static IPs. Each “deployment” was a task, and each task had its own IP. Running anything in the backend as some bash task, that’s great… having to go to Squarespace to change the A record every update… not so much. There was a solution, however, set up a load balancer, and attach the ECS container to it, for 5 cents an hour, or somewhere in the $30 range a month. This was not an option for me.

SSL using LetsEncrypt.

This had me for hours. I had the strangest rig for getting this to work in AWS Fargate. Here is the list of things I had to do to get this working.

Templ

I am still trying to find out if I hate this or not. The concept is interesting, but I soon found out the recommendations I have heard are from those who have a great understanding of Golang already. As I mentioned, I have rushed the development up to this point, so I didn’t do a deep dive into the documentation yet. But outside of the documentation, the support for this is lacking and its name is so similar to the template, that every Google search just tries to tell me about Golang Templates. The extension for VS code is also not the most flushed out and sometimes seems to conflict with Golang’s official extension. I even resorted to turning to ChatGPT and its understanding of Templ was murky as well. Maybe in the not-too-near future, I will convert everything to native Golang and see how it goes. I still need to get my NeoVim LSPs installed for Golang as well.

Tailwindcss

I have heard a lot of praise from this. I was not unfamiliar as I have witnessed libraries like Bootstrap or FontAwesome and their use of classes. The problem I soon learned was I was not working on a node project. Without Node installed in the project, my ability to install Tailwind came into question. Luckily, they had a standalone CLI, which is great and all, but I still don’t know where to put the binary. Maybe I will find out, but for now, I have it hiding away in a .gitingore’d folder called utils. This took a decent chunk of my README to explain and for any future replicators, or myself replicating on another machine in 3 weeks.

AWS Lightsail

This is when things started to come together. I moved everything from AWS Fargate to AWS Lightsail. The nano was not powerful enough to even launch, so I went with the micro. SSL came built-in essentially, so that was a quick hookup. The configuration of this was simple enough, although not as much customization as I would like. Getting the exact right command to push up the image, get the new image name, and then deploying the new image was 32 lines, 4 hours, and 16 force-pushed commits of my life I am never getting back. But now finally, when I perform a pull request, the code finally deploys.

Github Actions and project.

This was probably the least out of the ordinary, but was an interesting perspective of alternative. I historically have used Azure DevOps the most followed by Jira. The projects is nothing compared to either of those, and the pipelines in Azure are much better flushed out from what I have seen. However, I will say this is the perfect amount of simplicity that I needed for this project.

Lightsail Database and RDS

So expensive. $15 a month for a blog that doesn’t have ads? Not worth it. I was originally going to use SQLite built into the container, but I realized before I began that if I push changes to the AWS, the container that maintains the SQLite file would be overwritten. I also didn’t want all of the content in the public repo, so I resorted to using the Lightsail storage bucket for $1 a month, and free for 12 months. I will just upload articles to that and present whatever is available in the articles and projects directories.