Articles
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. - Project directory and file layout - How to handle styles - AWS Deployment - SSL Setup - Github Pipeline 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. - My docker container installed all the lets encrypt libraries, increasing the image size from 11MB to 45MB. - Environment variables for SSL file paths - Bash script as the start script of a Go project to run letsencrypt - NS records for the _acme_challenge. It was interesting, to say the least. 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.
2025-01-01
Golang
TailwindCSS
AWS
Github
First Blog post using Golang.
Happy New Year and 20 more years.
Hello! My name is Tim and this is my first blog post. I don’t expect anyone to read this or follow along too much, but I wanted to keep this as a repository of topics I found interesting. This blog was highly influenced by https://github.com/eliben/code-for-blog which has content going back to 2005. I found that blog as a fork of a developer who wrote a database obfuscation/masking tool that I was investigating the usefulness of. To look back at this time after 20 years of posts like that blog would be very reminiscing, and seems like a great idea and investment. I have been programming in either college or through work for over 7 years now and there are so many topics that have changed or I have forgotten that I want to be able to look back to. For example, a college web development book based on PHP 5.3, phpMyAdmin, and Notepad++ dated 2011. Or the C++ 11 material I have learned and completely forgotten by this point. I can remember the data structures, pointers, references and so on, but it’s been years since I have touched it. Maybe one of these posts will be a deep dive into header files because they are still an anomaly to me. Then there are the more obscure languages that rarely see the light of day outside of an educational institution or some niche including APL, Fortran 66, and assembly. I am sure there are lessons to be learned from these languages that I would have written here that are being lost to time. As of today, my interests are widespread. I am interested in the popular like Typescript, React, and Python, for the support, libraries, and community. I am interested in the hyped like Go and Rust to see what makes a language develop such a fanbase (also why I am writing this in Go). I want to return to game development using either Unity or Unreal to create enjoyment. And lastly, build upon the practical like NeoVim or GitHub. I am not sure what the future articles will entail, but I look forward to looking back.
2024-12-27
Golang
Blog