Website Infrastructure


The website's architecture may look weird, but it is something that came out of months of iterations. The whole thing had a singular goal, to keep costs to a minimum because I am a cheap 😄.

The whole system leverages as much as possible on GCP's free tier that does not expire, the only concession made while designing this, was the storage of containers within the Container Registry, amounting to a total cost of between SGD$0.08 to SGD$0.16 a month (ignoring domain name cost), while having a full CI/CD pipeline.

The private GitHub repo stores all the code for the different frontends of the different projects, currently some are in pure HTML, while others are in Vue.js.

Cloud Build will detect the update on the Main branch, and send an alert to the Flask Server, sending out a Telegram message. At the same time, it will start building the docker image, compiling the frontends that require compilation, and moving them to the proper folders.

Upon completion, it pushes the image to Container Registry, while sending an alert to the Flask Server. The Flask Server reboots itself and pulls the new code from the git repo, following that, it triggers docker-compose to pull the new images from Container Registry and restart itself. Upon completion, a health check is done and sent to me via Telegram.

Telegram - Sends me alerts, as well as allows me to restart the server
Certbot - Periodically refreshes SSL certs from Let's Encrypt, ensuring all websites are accessible through HTTPS
Cloudflare - DDOS/IP protection together with forced HTTPS
Cloud Functions - Allows hosting of various website's backends while essentially costing nothing
Wake-On-Lan - I use Google Assistant in my home, as such, the only way to trigger a Magic Packet to be sent to turn on my PC is to re-interpret IFTTT's REST request triggered by the Assistant to send a special packet. My home network will then reroute my PC and turn it on from a shutdown state.