Engineering
Building yuxuanyan.com
The stack and a few design decisions behind this site: bilingual routing, a database-backed CMS, and security by default.
Published 1 min read
This site is a small full-stack application rather than a static template. A few decisions shaped it:
- Content lives in Postgres. Projects and articles are rows with one translation per language, so English and Chinese versions stay linked to the same entity.
- Security is enforced in the database. Row-level security means drafts are invisible to the public API even if application code has a bug.
- Pages are cached and revalidated on publish. Public pages are prerendered; publishing in the admin invalidates exactly the affected cache tags.
Writing should be as easy as opening the admin page — no Git commit required.