How haru-1293/festival-qr-pos works
festival-qr-pos is a festival QR-payment and POS system: customers register, receive wallet balance, and pay at shop checkout; reception staff charge and reconcile cash, while shop and system managers maintain operations. The React client fronts a Workers API backed by D1. The graph preserves the documented authentication, wallet, reception, catalog, discounts, sets, cards, checkout, refunds, and administration capabilities. Some client-to-API connections are shown as unverified because client call sites were not excerpted; route-to-service links are based on the source index.
Main entry points: index.ts API gateway · api.ts HTTP client · App.tsx Client application · pos.ts POS and payment routes
Components 30
React client
- Client application
src/client/App.tsx - Login and account
src/client/pages/AuthPages.tsx - Shop checkout
src/client/pages/pos/Checkout.tsx - Reception desk
src/client/pages/reception/ChargePanel.tsx - Shop management
src/client/pages/shop/ProductManager.tsx - System administration
src/client/pages/admin/AdminUsers.tsx - HTTP client
src/client/lib/api.ts
Worker API
- API gateway
src/worker/index.ts - Authentication routes
src/worker/routes/auth.ts - Catalog routes
src/worker/routes/catalog.ts - POS and payment routes
src/worker/routes/pos.ts - Reception routes
src/worker/routes/reception.ts - Refund routes
src/worker/routes/refunds.ts - Admin and shop routes
src/worker/routes/admin.ts - Other operations routes
src/worker/routes
Commerce services
- Catalog and sets
src/worker/lib/catalog.ts - Pricing and orders
src/worker/lib/order.ts - Discount rules
src/worker/lib/discounts.ts - Physical cards
src/worker/lib/cards.ts - Cash operations
src/worker/lib/cash.ts
Identity and operations
- Session and access
src/worker/middleware/auth.ts - Session handling
src/worker/lib/session.ts - Credential cryptography
src/worker/lib/crypto.ts - Audit records
src/worker/lib/audit.ts - Festival settings
src/worker/lib/settings.ts
Other components
- Customer
- Reception staff
- Shop staff
- System manager
- D1 database
Connections 45
- Customer → Login and account: registers or signs in
README.md - Customer → Shop checkout: presents payment QR
README.md - Reception staff → Reception desk: charges wallet
README.md - Shop staff → Shop checkout: checks out sales
README.md - System manager → System administration: manages system
README.md - Client application → Login and account: hosts
- Client application → Shop checkout: hosts
- Client application → Reception desk: hosts
- Client application → Shop management: hosts
- Client application → System administration: hosts
- Login and account → HTTP client: requests API
- Shop checkout → HTTP client: requests API
- Reception desk → HTTP client: requests API
- Shop management → HTTP client: requests API
- System administration → HTTP client: requests API
- HTTP client → API gateway: calls API
- API gateway → Authentication routes: routes requests
src/worker/index.ts - API gateway → Catalog routes: routes requests
src/worker/index.ts - API gateway → POS and payment routes: routes requests
src/worker/index.ts - API gateway → Reception routes: routes requests
src/worker/index.ts - API gateway → Refund routes: routes requests
src/worker/index.ts - API gateway → Admin and shop routes: routes requests
src/worker/index.ts - API gateway → Other operations routes: routes requests
src/worker/index.ts - API gateway → Session and access: loads sessions
src/worker/index.ts - Authentication routes → Session handling: creates sessions
src/worker/routes/auth.ts - Authentication routes → Credential cryptography: verifies credentials
src/worker/routes/auth.ts - Authentication routes → Audit records: records events
src/worker/routes/auth.ts - Session and access → Session handling: uses cookie settings
src/worker/middleware/auth.ts - Session and access → Credential cryptography: hashes session token
src/worker/middleware/auth.ts - Catalog routes → Catalog and sets: builds catalog
src/worker/routes/catalog.ts - POS and payment routes → Catalog and sets: builds POS catalog
src/worker/routes/pos.ts - POS and payment routes → Pricing and orders: quotes and settles
src/worker/routes/pos.ts - POS and payment routes → Physical cards: checks card
src/worker/routes/pos.ts - Reception routes → Cash operations: uses cash operations
src/worker/routes/reception.ts - Reception routes → Physical cards: uses card operations
src/worker/routes/reception.ts - Refund routes → Pricing and orders: loads payment result
src/worker/routes/refunds.ts - Refund routes → Catalog and sets: uses catalog data
src/worker/routes/refunds.ts - POS and payment routes → Audit records: records events
src/worker/routes/pos.ts - Reception routes → Audit records: records events
src/worker/routes/reception.ts - Catalog and sets → D1 database: reads catalog data
- Pricing and orders → D1 database: reads and writes orders
- Cash operations → D1 database: records cash
- Audit records → D1 database: inserts audit logs
src/worker/lib/audit.ts - Session handling → D1 database: builds session SQL
src/worker/lib/session.ts - Festival settings → D1 database: stores settings