How a5-wjc/website-for-huiyihongbei works
This is a Cloudflare Worker-backed cake classification and catalog manager. The main workflow is an administrator using the browser UI to manage category → subcategory → cake records, with data persisted in D1; the README also documents login, role-based access, and viewing logs. The Worker routes API requests to the business module, which performs D1 operations and can invoke idempotent schema/sample-data initialization. Source excerpts show these layers, but do not expose the full API dispatch or frontend request code, so those internal links are omitted where not evidenced.
Main entry points: api.js API business logic · seed.js Schema and seed · index.html Management UI · worker.js Worker router
Components 11
Browser experience
- Management UI
public/index.html
Worker runtime
- Worker router
src/worker.js - API business logic
src/api.js
Catalog and access
- Category hierarchy
src/api.js - Cake catalog
src/api.js - Accounts and roles
src/api.js - Cake view logs
src/api.js
D1 persistence
- Validation and auth helpers
src/db.js - Schema and seed
src/seed.js - D1 database
Other components
- Administrator
Connections 8
- Administrator → Management UI: manages catalog
README.md - Management UI → Worker router: requests API
README.md - Worker router → API business logic: routes API
src/worker.js - API business logic → Validation and auth helpers: uses helpers
src/api.js - API business logic → Schema and seed: initializes schema
src/api.js - API business logic → D1 database: queries and writes
src/api.js - Schema and seed → Validation and auth helpers: uses ID and hash helpers
src/seed.js - Schema and seed → D1 database: creates and seeds
src/seed.js