A self-hosted home for my website

  • Astro
  • Fastify
  • MariaDB
  • RustFS
  • Sharp

I wanted my personal website to be more than a collection of static pages. I wanted to understand the machinery behind it: where writing lives, how an image reaches a browser, and what happens between pressing upload and seeing a finished photograph on a page.

So I built a self-hosted publishing stack. It was built as a real system, but I did not take it to a public production deployment. That distinction matters. The point was not to claim that I had solved publishing forever; it was to build the version of the problem that would teach me what each moving part was actually responsible for.

One application, clear responsibilities

At the centre is a Node application built with Fastify. It serves the public Astro output and owns the server-side work: API routes, future authentication boundaries, database access and media handling. I preferred that to splitting the site into an Astro frontend and a separate API just because those were different tools. For this scale, one application process makes the boundary easier to follow.

I designed MariaDB to be the source of truth for editorial content. The schema has room for post metadata, publication state and Markdown bodies rather than treating writing as loose files or objects in storage. The CRUD endpoints and editorial interface were not built, so this is an architectural direction rather than a complete publishing system. RustFS, an S3-compatible service, has a much narrower job: it stores binary media. That division is intentionally boring. Text needs querying, drafts and publication state; photographs need durable object storage.

An upload is not automatically a published image

The media pipeline was the part I cared about most. Its upload API gives a browser a short-lived presigned upload URL for a private staging bucket rather than letting it write straight into the public photo bucket. The server then retrieves the staged original, orients it, creates a WebP image and a smaller thumbnail with Sharp, publishes those processed assets, removes the staged upload and records the result in MariaDB.

That path separates the convenience of a direct browser upload from the responsibility of serving clean, predictable public files. It also gives the server one place to strip unwanted metadata, constrain image dimensions and decide what a public asset should look like. Authentication has not been added to those endpoints, so I would not expose this upload path publicly as it stands.

What I was trying to learn

Self-hosting was not the only way to make this website. It was a way to make the decisions visible. I had to think about credentials, buckets, database migrations, Docker services, a virtual machine, deployment, and the difference between a proof that works locally and something I am willing to expose.

The resulting architecture gave me a useful reference point. It showed me which parts of publishing I genuinely needed, which parts I simply enjoyed understanding, and which operational responsibilities were too large for the website I wanted to maintain. Even without a public deployment, building it made the later, simpler version of this site a more deliberate choice.

Back to Portfolio