How maiphh/poet works
POET is a community-support site with a public donation flow, PayOS payment processing, a public gift wall, and an admin area for donation moderation and settings. Donors submit a gift through the static site; the Worker validates it, creates a pending record and PayOS checkout, then settles verified webhook events and exposes donation status and wall data. Admins authenticate to review donations and control visibility and donation availability. The frontend excerpts show the donation UI and admin client; Worker excerpts establish routing and backend calls. Other documented-by-tree site sections are included, but their internal interactions are not inferred.
Main entry points: index.js API router · routes-donations.js Donation routes · donate.js Donation form · store.js D1 access
Components 24
Static Site
- Home content
app.js - Shared UI
components - Team page
team/index.html - Partner page
dong-hanh/index.html
Donation Experience
- Donation form
ung-ho/donate.js - Gift options
ung-ho/items.js - Payment display
ung-ho/card.js - Payment result
ung-ho/result.js - Donation pages
ung-ho/index.html
Donation Worker
- API router
worker/src/index.js - Donation routes
worker/src/routes-donations.js - Payment webhook
worker/src/routes-webhook.js - Return redirects
worker/src/routes-pages.js - PayOS client
worker/src/payos.js - Callback validation
worker/src/callback-urls.js - Gift validation
worker/src/validation.js - HTTP helpers
worker/src/http.js
Admin Operations
- Admin console
admin/admin.js - Admin routes
worker/src/routes-admin.js - Admin sessions
worker/src/auth.js
Persistence
- D1 access
worker/src/store.js - D1 database
worker/schema.sql
Other components
- Site visitor
- PayOS
Connections 30
- Site visitor → Home content: visits
app.js - Site visitor → Donation pages: opens
- Site visitor → Team page: visits
- Site visitor → Partner page: visits
- Donation pages → Donation form: hosts
- Donation form → Gift options: uses
ung-ho/donate.js - Donation form → API router: requests
worker/src/index.js - Donation form → Payment display: uses
- Donation form → Payment result: uses
- Home content → Shared UI: uses
- API router → Donation routes: dispatches
worker/src/index.js - API router → Payment webhook: dispatches
worker/src/index.js - API router → Admin routes: dispatches
worker/src/index.js - API router → Return redirects: dispatches
worker/src/index.js - Donation routes → Gift validation: validates with
worker/src/routes-donations.js - Donation routes → Callback validation: resolves URLs
worker/src/routes-donations.js - Donation routes → PayOS client: creates checkout
worker/src/routes-donations.js - Donation routes → D1 access: reads/writes
worker/src/routes-donations.js - Payment webhook → PayOS client: verifies signature
worker/src/routes-webhook.js - Payment webhook → D1 access: settles gift
worker/src/routes-webhook.js - Payment webhook → Donation routes: purges cache
worker/src/routes-webhook.js - Admin console → API router: calls API
- Admin routes → Admin sessions: requires session
worker/src/routes-admin.js - Admin routes → D1 access: reads/writes
worker/src/routes-admin.js - Admin routes → Donation routes: rate limits
worker/src/routes-admin.js - Admin sessions → D1 access: checks sessions
worker/src/auth.js - D1 access → D1 database: queries
worker/src/store.js - PayOS client → PayOS: HTTP calls
worker/src/payos.js - API router → HTTP helpers: uses
worker/src/index.js - Return redirects → Donation pages: redirects to