Skip to content
Nathan Zhou

How this site works

Three things this site does, drawn step by step, with figures from the copy running right now. You do not need to be an engineer to follow along, and the details are there if you are.

A page request§

What happens between typing the address and seeing the page, and on the next visit.

Your browserasks for a pageCloudflareTLS, cached filesTunnelopened from homeNext.js serverat my homePage is builtafresh each timeSQLitelibSQL and DrizzleService workersaves files

Shaded boxes run on the small computer at my home.

Step 1 of 8

You ask for a page

Your browser asks for an address such as nathanz.cloud/projects. The name is looked up and the request is sent, encrypted, to the nearest Cloudflare server.

Read all the steps as text
  1. You ask for a page. Your browser asks for an address such as nathanz.cloud/projects. The name is looked up and the request is sent, encrypted, to the nearest Cloudflare server.
  2. Cloudflare answers the door. Cloudflare handles the encryption (TLS) and keeps copies of files that never change: the site’s scripts, styles and fonts, its films and its downloads. Pages are not kept there, so the request goes on.
  3. Through the tunnel. The computer at home opened a connection out to Cloudflare and keeps it open. Requests come in along it, so the home network has no open port for anyone to knock on.
  4. The Next.js server. A Next.js server at home receives it. A short piece of code runs first: it tidies the address (no trailing slash), and sends anyone without a sign-in cookie away from the private areas.
  5. The page is built, fresh. React server components build the page right then, in your language (your language cookie, or else your browser’s setting). Because the language can differ, no public page is kept ready-made: each request builds its own.
  6. Reading the database. Pages that need data ask SQLite, through libSQL and Drizzle: the blog, the guestbook, the changelog. The database is a file on the same machine, so a question never leaves the house.
  7. The HTML comes back. The finished HTML goes back the way it came, compressed on the way. Your browser starts drawing it as it arrives, then fetches the scripts, styles, fonts and pictures it names.
  8. Next time, a saved copy helps. A service worker, a small script the site installs in your browser, keeps the build files, which are named by their contents and so never go stale, and shows pictures from its copy while refreshing them. It also keeps the last forty public pages, but only so you can read them offline: while you are online, the page itself is always fetched fresh. Signed-in areas, the API and search are never kept.

What is kept, and what is built fresh

From what the code does, not from what would be convenient.

Built fresh on every request

  • Every page: home, projects, blog, guestbook, colophon and the rest
  • The status page and the health check
  • The answers to Ask the site

Kept, so it comes from a copy

  • Scripts, styles and fonts: named by their contents, kept by Cloudflare and your browser
  • Films and downloads: kept for a day, at Cloudflare too
  • Pictures: shown from the service worker’s copy and refreshed behind it

Saved only for reading offline

  • The last forty public pages you read, never one behind a sign-in
  • Never saved: signed-in areas, the API, search and the status page

A deploy§

From a change on my laptop to the public site, and what stops a broken one.

Laptopcommit and pushGitHubbranch mainHome serverchecks every 2 minIdle slot (a/b)test and buildCommit refusedold copy serves onSwitch overnew slot goes liveHealth check/api/healthLivereports the commit

Shaded boxes run on the small computer at my home.

Step 1 of 8

A commit leaves my laptop

I commit a change and push it to the main branch on GitHub. Code reaches the site only this way.

Read all the steps as text
  1. A commit leaves my laptop. I commit a change and push it to the main branch on GitHub. Code reaches the site only this way.
  2. GitHub keeps it. GitHub holds the code and its history. The computer at home only ever reads from it, with a read-only key.
  3. The home server checks every two minutes. A small script asks GitHub whether main has a new commit. The server sits behind a home router that nobody outside can call, so it asks rather than waiting to be told. Only one deploy runs at a time.
  4. It builds in the idle slot. There are two copies of the site, a and b. One is serving visitors; the new commit goes into the other, so the live site is never disturbed. It installs packages if the lockfile changed, runs the automated tests, then builds.
  5. A bad commit is refused. If a test fails or the build breaks, the commit is refused. The old copy keeps serving, and the commit is not tried again until the next push. A failed package download is the one exception: that is usually the network, so it is retried two minutes later.
  6. Switch over. If everything passed, it waits for any Juice quiz games in progress to finish (up to thirty minutes), points “current” at the new slot and restarts the server, which takes a few seconds.
  7. A restart is not proof. The script asks the server’s /api/health which commit it is running, and only the new commit answering counts. If it never does, within under a minute, it rolls back to the old slot.
  8. Live. The site is on the new commit. /api/health reports it, and so does the first of the live figures further down this page.

An AI answer§

How “Ask the site” answers from the site’s own pages and a free model.

Your questionmax 500 charactersLimits20 a day eachFind excerptsfrom site pagesModel listpublic, kept 1 hourFree modelnewest firstNext free modelif the first failsAnswer streamsas it is writtenCitationslinks to pages

Shaded boxes run on the small computer at my home.

Step 1 of 8

You ask

You type a question of up to 500 characters on the Ask page. The browser sends it to the site and reads the reply as it streams in.

Read all the steps as text
  1. You ask. You type a question of up to 500 characters on the Ask page. The browser sends it to the site and reads the reply as it streams in.
  2. Limits come first. One question at a time from an address, 20 a day from one address and 500 a day from everyone, and only from this site’s own page. Over a limit, you are told so and nothing is sent anywhere.
  3. Find the right excerpts. The site searches its own pages (projects, the blog’s published articles, the CV, the colophon, the guides and the games), cut into passages. Rarer words count for more. The best six passages, at most 6,000 characters, are picked. Nothing private is in the pile.
  4. Which model?. OpenCode Go publishes the list of models it serves, with no key needed. The site reads it and keeps it for an hour. A model counts as free only if its input and output prices are both zero, and the newest release goes first. No model is named in the code, because which ones are free changes every few weeks.
  5. Ask the model. The excerpts and your question go to that model with strict rules: answer only from the excerpts, say so when they do not cover it, cite them, keep it short. Your question sits in tags marked as a stranger’s, and the model has no tools.
  6. If it fails, the next one. A model that refuses, times out or errors is passed over for five minutes and the next free model is tried, as long as nothing has been shown to you yet. If none can answer, the page says so plainly.
  7. The answer streams in. Words reach the page as the model writes them, as server-sent events. A reasoning model’s thinking is skipped and never shown.
  8. Citations. Each claim is marked [1], [2] and linked to the page it came from. The answer names the model and says it can be wrong. Free models may keep what they are sent, so please do not type anything private.

Live figures§

Read from the running copy and kept for a minute. A figure that cannot be read says so instead of guessing.

Commit being served
dbdc45bThe one /api/health reports.
Running for
5 days 5 hoursSince 17 Nov, 18:36 UTC; a deploy restarts the server.
Database answer time
2 msOne query, just now. The status page keeps no history, so this is a single reading, not an average.
Pages in the sitemap
59Every page search engines are told about, each blog article included.
Automated tests
1,484 tests in 162 filesCounted from the source when the site was built, as of 17 November 2026.
First in line for Ask the site
Hy4 flash FreeThe newest free model on OpenCode Go's list right now; the list is kept an hour.
Page views today
5All pages together, the UTC day so far. Counted without cookies or IDs, so views, not people.

Read 22 Nov, 23:47 UTC.Is it up right now? See the status page.

Built with§

The tools, each with the reason it is here.

Next.js 16 and React 19
One framework for the pages, the forms and the API. Pages are built on the server, so they reach you as plain HTML.
Tailwind CSS v4
Styles sit next to the markup they style, and every colour comes from a token rather than being typed in.
Meridian
My own set of components and colour tokens, so switching between light and dark is one change.
SQLite, libSQL and Drizzle
A database that is just a file: nothing extra to run beside the site, and easy to back up or move. Drizzle keeps the queries typed.
Cloudflare Tunnel
Lets visitors reach a computer at home without opening a port there, with TLS and file caching in front.
Vitest
Fast tests that run before every deploy. A failing one stops the deploy.
Playwright
Drives a real browser. With axe-core it checks every page for accessibility, in both languages, both themes and at phone size.

← Back to the colophon