Get in touch
← Things I’ve built

Case study · 04

Hexproof

A one-person web studio, and the monorepo and VPS every site runs on.

Role
Solo: architecture, infrastructure, design and build
Stack
Astro · npm workspaces · Docker · nginx · Coolify · Traefik · Tailscale · GitHub Actions · Ubuntu
Live
hexproof.co.uk ↗
The Hexproof website

The problem

I build bespoke sites for small local businesses. Each one should look like it was made for that business, but I don’t want a separate codebase, host and set of subscriptions per client, and I want the hosting to be something I can secure and look after myself.

Hexproof’s own site had to prove the approach: built and deployed exactly like a client site, with prices published and a Work page that can’t show a client who hasn’t agreed to it.

Architecture

One npm-workspaces monorepo holds every site, a shared kit and the infrastructure. Each site fills in a typed config contract that the kit’s components render against, but owns its own layouts and design. Every site builds through the same Dockerfile into a small nginx image, and Coolify on a single hardened VPS deploys them behind Traefik with automatic HTTPS.

Hexproof hosting. From local development, code is pushed to a private GitHub repo where CI type-checks and builds every workspace. Coolify on the VPS pulls with a read-only deploy key, and deploys are started over Tailscale. Visitors reach Traefik, which serves the static nginx sites, Cal.diy, design-mailer, the pack simulator API and Umami. The VPS runs ufw and fail2ban with key-only SSH, and Coolify’s own ports are dropped at the edge and in the DOCKER-USER chain.OVH VPS · Ubuntu 24.04 · CoolifyLocal devnpm workspacesGitHub (private)CI: check + buildVisitorCoolifyprivate dashboardTraefikrouting · auto HTTPSStatic sitesone Dockerfile → nginx:stable-alpineCal.diy+ Postgresdesign-mailerbooking emailspack-sim-apiSQLite volumeUmamicookieless statsHardeningkey-only SSH · ufw 22/80/443 · fail2ban · unattended upgradesdashboard ports dropped at the edge firewall + DOCKER-USERgit pushdeploy keyTailscalebuilds + routes
Everything on one box. The dashboard is only reachable over Tailscale or an SSH tunnel.

Frontend

  • A shared kit (@hexproof/site-kit) for SEO, schema.org data, the booking embed, the motion system and the nail configurator. Each site aliases its own typed config into the kit at build time, so kit components render against whichever site is building.
  • The rule is to move something into the kit only when a second site needs it, then make it config-driven, so no site ends up looking like a template.
  • The motion system wires Lenis and GSAP to data attributes (reveal, parallax, horizontal scroll, magnetic buttons, an optional lazy-loaded WebGL hero) and respects reduced motion everywhere.
  • Hexproof’s Work page and case studies are generated at build time from the deploy registry, and only show a site once the client’s consent date is recorded.

Infrastructure

  • One multi-stage Dockerfile for every site: install only that site’s workspace, build it, copy the output into nginx:stable-alpine with shared security headers and a health check. A build argument switches a staging deploy to noindex.
  • A bootstrap script hardens a fresh Ubuntu VPS: unattended security upgrades, key-only SSH, ufw allowing only 22/80/443, fail2ban and swap, then installs Coolify.
  • Coolify’s dashboard has no DNS record and no public port. Its ports are dropped at the provider’s edge firewall and in the DOCKER-USER chain (Docker-published ports bypass ufw). Day-to-day access is over Tailscale.
  • GitHub Actions type-checks, unit-tests and builds every workspace on each push. Deploys stay manual, and the repo is connected with a read-only deploy key because there’s no inbound webhook.
  • Shared services on the same box: a self-hosted calendar for bookings, the mail service, the pack simulator’s API and cookieless analytics.
  • A scaffold script creates a new client site and registers it, and the registry is kept in step with Coolify.

Interesting problems

  1. 01

    A private control plane

    The simplest way to deploy is a public dashboard with a GitHub webhook. Keeping the dashboard off the internet means no webhooks, so GitHub is connected by a read-only deploy key and deploys are a button pressed over Tailscale. It’s a deliberate trade of convenience for a much smaller attack surface.

  2. 02

    Bespoke without forking

    Shared code wants to make every site look the same. The kit only holds behaviour (SEO, booking, motion, the configurator) behind a typed config contract, and each site owns its layouts, theme and copy.

  3. 03

    Header inheritance

    nginx doesn’t inherit add_header into a block that sets its own headers, so any location that adds a caching header would silently drop every security header. The headers live in one snippet that every location includes, and the Dockerfile copies it somewhere nginx won’t also load it as a config of its own.

Outcome

Four sites live from one repo, plus booking, email, analytics and a game API on one VPS, with a repeatable path for adding the next client.