How 1eakkkk/my-blog works
1eak.cool is a lightweight private forum built as a browser SPA and Cloudflare Pages Functions API. Visitors register or sign in, browse and search posts, open discussions, comment or react, and manage their profiles; authors can publish posts with uploaded media, while administrators maintain content and site settings. The README documents additional features such as Markdown rendering, nested comments, and a management console. The sampled handlers show API-to-D1 and upload-to-R2 behavior; other subsystem links rely on README descriptions, so uncertain internal wiring is omitted.
Main entry points: script.js Forum SPA · _lib.js Session identity · auth Register and login · posts.js Post service
Components 22
Browser app
- Forum SPA
script.js - Forum shell
index.html - Login page
login.html
Identity and security
- Register and login
functions/api/auth - Session identity
functions/api/_lib.js - Rate limiting
functions/api/_middleware.js
Forum features
- Post service
functions/api/posts.js - Comment service
functions/api/comments.js - Like service
functions/api/like.js - Media upload
functions/api/upload.js - Profile service
functions/api/profile.js - Public user lookup
functions/api/user-public.js
Site operations
- Admin console API
functions/api/admin.js - Presence heartbeat
functions/api/heartbeat.js - Public configuration
functions/api/config.js - Avatar generation
functions/api/random_avatar.js
Cloudflare services
- D1 database
- R2 object storage
- KV rate-limit store
- Turnstile verification
Other components
- Visitor
- Administrator
Connections 36
- Visitor → Forum shell: opens forum
- Visitor → Login page: opens account
- Administrator → Forum shell: opens console
- Forum shell → Forum SPA: loads app
- Login page → Register and login: registers or signs in
- Forum SPA → Post service: requests posts
- Forum SPA → Comment service: requests comments
- Forum SPA → Like service: toggles likes
- Forum SPA → Media upload: uploads media
- Forum SPA → Profile service: updates profile
- Forum SPA → Public user lookup: looks up profiles
- Forum SPA → Admin console API: requests admin actions
- Forum SPA → Presence heartbeat: reports presence
- Forum SPA → Public configuration: loads settings
- Forum SPA → Avatar generation: requests avatar
- Register and login → D1 database: reads and writes
- Register and login → Turnstile verification: verifies challenge
- Register and login → Session identity: creates session
- Session identity → D1 database: checks sessions
- Post service → Session identity: checks identity
- Post service → D1 database: reads and writes
- Comment service → Session identity: checks identity
- Comment service → D1 database: reads and writes
- Like service → Session identity: checks identity
- Like service → D1 database: updates likes
- Media upload → Session identity: checks identity
- Media upload → R2 object storage: stores media
- Profile service → Session identity: checks identity
- Profile service → D1 database: updates user
- Public user lookup → D1 database: reads users
- Admin console API → Session identity: checks identity
- Admin console API → D1 database: reads and writes
- Presence heartbeat → D1 database: updates presence
- Public configuration → D1 database: reads settings
- Avatar generation → D1 database: reads user data
- Rate limiting → KV rate-limit store: tracks request limits