How lintiance078/hhh-workbuddy-homepage works
This is a personal homepage, blog, and toolbox with a single-page frontend and Cloudflare Pages API. Visitors browse published posts and site information; the administrator logs in, edits and manages posts, and can update the site profile. In offline or local mode, drafts stay in browser storage and can later be uploaded in batches. The README documents frontend behavior, while the sampled API files show authentication and D1 access; unsampled frontend details are represented only where the README supports them.
Main entry points: posts.js Posts collection API · [id].js Single-post API · index.html Drafts box · profile.js Profile API
Components 14
Homepage and authoring
- Homepage SPA
public/index.html - Article reader
public/index.html - Article editor
public/index.html - Hidden login entry
public/index.html - Drafts box
public/index.html - Local drafts
public/index.html
Pages API
- Login endpoint
functions/api/login.js - Token signing and verification
functions/api/_auth.js - Posts collection API
functions/api/posts.js - Single-post API
functions/api/posts/[id].js - Profile API
functions/api/profile.js
Persistent data
- Cloudflare D1
schema.sql
Other components
- Visitor
- Administrator
Connections 23
- Visitor → Homepage SPA: visits
README.md - Administrator → Hidden login entry: opens entry
README.md - Hidden login entry → Login endpoint: submits password
README.md - Login endpoint → Token signing and verification: signs token
functions/api/login.js - Administrator → Article editor: writes articles
README.md - Article editor → Posts collection API: creates articles
README.md - Article editor → Single-post API: edits articles
README.md - Homepage SPA → Posts collection API: loads list
README.md - Article reader → Single-post API: loads article
README.md - Drafts box → Posts collection API: loads online drafts
README.md - Drafts box → Single-post API: changes status
functions/api/posts/[id].js - Article reader → Single-post API: changes status
functions/api/posts/[id].js - Article editor → Local drafts: saves offline
README.md - Drafts box → Local drafts: reads drafts
README.md - Drafts box → Posts collection API: uploads batches
README.md - Homepage SPA → Profile API: loads profile
README.md - Administrator → Profile API: updates profile
README.md - Posts collection API → Token signing and verification: checks admin
functions/api/posts.js - Single-post API → Token signing and verification: checks admin
functions/api/posts/[id].js - Profile API → Token signing and verification: checks admin
functions/api/profile.js - Posts collection API → Cloudflare D1: reads and writes
functions/api/posts.js - Single-post API → Cloudflare D1: reads and writes
functions/api/posts/[id].js - Profile API → Cloudflare D1: reads and writes
functions/api/profile.js