Building This Website
cowboatHow It Started
Last year I made New Year’s resolutions to complete various personal projects of mine. I wanted to stop thinking about doing, and actually do. I failed miserably. Far from finishing projects, I barely started many. This year I took a different approach to my annual reflection period. I chose a word as a theme for the year, and identified a few categories of that theme and some examples that fit into those categories. Varieties of this approach have been well documented lately as conducive to the completion of goals. It is also an implementation I pattern after the Beliefs, Behaviors, Results model of management I adhere to, and which I might write about further sometime.
At any rate, somewhere among the categories under my theme for the year I found a place to put some more personal projects. One of those personal projects was to set up another custom email domain. Another was to start a blog, or at least explore doing so. (I love creating tasks for myself that involve thinking or planning but no doing. Thinking is so much fun! What fun is doing? I digress…) Still another was to set up another website. I quickly realized that I could mesh all of these three nicely together.
How It’s Going
The impetus to work on this project I credit to the happy accident of wandering down a rabbit hole, but that is a story for another time. What emerged was an idea for a personal blog hosted on a personal website and an email address I hosted at the same domain. A mobile developer by background, I was fine with a technically involved solution, but I wanted one that was friendly to the waning HTML and CSS skills that I have not used frequently in… many years. I also wanted something fast, affordable, and private. And I wanted something that was flexible enough to let me add to or customize it as I got the whim. What I found I believe satisfies all of these criteria, and I figured it useful to document as such for the benefit of anyone who may share similar interests.
Doing the Things
Each component of this project warrants its own section, and sometime in the future I will probably write a separate post for each, that will go into implementation details and outline steps to follow. For now though, a high level overview should suffice. The domain is registered with Cloudflare; the website is written in Swift, semi-declaratively (more on that later); and the email is hosted using Apple’s Custom Email Domain service.
The first component is the domain. I bought the domain on Cloudflare. I have previously been a customer of Google Domains and Njalla, among others, and each for different reasons. And I continue to buy and register domains with some of them. But this was the first one I registered with Cloudflare. Cloudflare is cheap - they charge only the ICANN and registry fees, and no more (i.e., at cost). Most of their prices are slightly-to-moderately below Google, which is already known for decent prices. They also offer good privacy by default and for no extra charge. All registrant information except Country and State is obfuscated and not sent to the registry. Finally, Cloudflare is fast and simple. Their DNS record management is among the easiest I’ve used, and their documentation is thorough and high quality.
The second component is the actual site. As I said before, my background is mobile development. I’m not a web developer. I can read JavaScript, but not fluently write it. I know basic HTML and CSS, and that’s about it. Mostly I know how to Google and StackOverflow. Naturally, I wanted to know if you could write a website with Swift. Turns out, you can. Well, sort of. I stumbled upon a great project by John Sundell called Publish that generates HTML from Swift code. Using some basic constructors, you can declare blocks of code in Swift that get turned into HTML that becomes your website. All you have to do is write or extend the constructor methods as necessary, and then assemble them to build your site how you want. Publish has a built-in mechanism for adding content such as blog posts via Markdown, and even RSS feeds. The only gripe I have is with the size of the project, it’s not small, which I attribute to the overhead of the generator. Also, adding new content is not hard, but could be easier. But those are details for a dedicated post.
The third and final component (so far) is the email. I wanted the simplest way of being able to address mail to and from a domain that I owned. I also wanted privacy. A year or two ago, Apple released a set of features called iCloud+ for people who sign up for their cloud subscription offering. One of those features is iCloud Custom Email Domain. I had previously used this feature while it was in beta, and it worked fine. It may be limited, but I had no issues with it. Nowadays, the feature is out of beta, and seems to be a little more fleshed out. Apple provides you the DNS instructions to set up your mailbox at your domain, hosted through iCloud servers. They can even do all the DNS setup for you if you follow the wizard-style steps under the feature in iCloud. For the purposes of experimentation, I tried it this way, and it worked flawlessly. I will note that they steer you to Cloudflare (which is another reason I went that route), who is the same provider they use to offer the Private Relay service. It seems they must have some deal or agreement in place. Anyway, it works great, and after a few taps I had multiple inboxes configured at my new email domain. I cannot give an educated opinion yet on iCloud’s merits as an email host, but others have written on the topic if you are curious. My assessment - it’s fine.
Wrap Up
So that’s it. That’s my solution. Website written in Swift, hosted via Cloudflare, with email through iCloud. It’s a clean, simple setup. It’s not perfect. Some things such as adding new posts could be easier. I could make my deployment pipeline more sophisticated. But those can be future projects. For now, this is good. 2023 is off to a good start. Thanks, rabbit hole. 🕳️🐇