04 / Library

Published · workers, d1, r2, pwa

Edge Architecture Notes

This note is written in English.

This rewrite runs as a Cloudflare Worker with static assets from Vite.

Layers

  1. Client — TypeScript modules, multi-page Vite app, PWA shell
  2. Content — Markdown library compiled at build time
  3. Edge — Worker routes for health, status (D1), media (R2)
  4. Ship — GitHub Actions → Wrangler deploy

Data

Binding Role
ASSETS Built HTML/CSS/JS
DB D1 status board
MEDIA R2 object storage

Status

/status reads live rows from D1. Seed data ships with migrations; update via POST /api/status/update when an admin token is configured.