---
title: "from github pages to AWS"
date: "15/06/2024"
---

## pages begone

Though GitHub Pages may work for hosting your small, internal, static site, I don't think Pages is the right choice for _anyone_:

1.  Bandwidth caps: scale your software by default
2.  Limited SEO control: not a downside if you don't want want traffic...
3.  Static & client-side only: keep your options open

## why aws?

I used pages before because I had little knowledge of cloud computing.

This is not a justification—if you are a software developer, learn it.

Prior to hosting this site, I developed and hosted an internal application with Google Cloud while working at [nth Venture](https://nthventure.com). Getting a single Compute Engine up and running made me step away from cloud for the entire next year.

AWS is:

1.  Industry standard: not an actual reason but it convinced me nonetheless
2.  Secure: soon to be used by VISA, which holds security to a nearly stupid extent (seriously, I can't even clone a repository)
3.  Well-documented: everything in the documentation worked _first try_. This is extremely rare in software, so compliments to Chef Bezos.

## the setup

This website is pure HTML, CSS, and JavaScript.

AWS-wise, I use:

- S3, to host the content (static for now)
- CloudFront, to serve and cache said content
- Route53, to manage routing
- GoDaddy, to reserve [barrettruth.com](https://barrettruth.com)

A user request can be modelled as follows:

1.  A user accesses the website by typing barrettruth.com in their browser.
2.  GoDaddy's DNS servers are queried, which translating the domain name to my Route53's IP address.
3.  Route53 then routes to the request to my CloudFront distribution associated with my S3 bucket.
4.  CloudFront checks its edge caches for the requested content. If the content is stale or not cached, CloudFront fetches the content from S3. Otherwise, it uses the cached content from an edge server.
5.  CloudFront returns the content to the user's browser.

![system design of my portfolio website](/public/posts/from-github-pages-to-aws/website-design.webp)

## difficulties

The hardest part of hosting this website was interfacing with GoDaddy.

For example, configuring SSL certificates with GoDaddy is needlessly challenging. Follow [AWS's guide](https://docs.aws.amazon.com/amplify/latest/userguide/to-add-a-custom-domain-managed-by-godaddy.html) if you really want to. Otherwise, [configure your GoDaddy nameservers](https://www.godaddy.com/help/edit-my-domain-nameservers-664) and point them to your own DNS service (like Route53) instead.
