How this site works
This site has two halves that live in different places.
The writing
The pages are plain static files, built with Astro and served by Cloudflare. They stay up whether or not my own machine is on. Maths is typeset when the site is built, so a page with equations needs no extra scripts in your browser.
The apps
The demos run on an NVIDIA DGX Spark on my desk; Cloudflare only forwards traffic to it. A
cloudflared tunnel on the Spark makes an outbound connection, and each app gets its own
subdomain that leads to a port on the machine:
<app>.tongli.dev
→ Cloudflare
→ tunnel
→ localhost:<port> on the Spark
No ports are open on my network, and all the GPU work happens on the Spark.
Online or offline
Demos are not always running. The apps page asks a small Cloudflare Worker which ones are up. The Worker sends one request per app through the tunnel: if the app answers, it is online; if Cloudflare has to answer for it, it is offline. Results are cached for up to a couple of minutes. Opening an app while it is offline shows a short note instead of an error page.