How haha7000/promise-cafe-kiosk works
P.M CAFE is a church-café kiosk system supporting personal QR and shared-cell point payments, barista order handling, and administration of menus, cells, settlements, and sales statistics. The principal workflow moves from payment-mode selection and (for cell payments) cell authentication through menu/options and cart selection to order creation and customer completion; baristas then manage order status. The React client calls a FastAPI backend backed by PostgreSQL. Frontend routing and kiosk order submission are excerpted; several backend router capabilities are documented or indexed but their internals were not sampled, so those links are omitted or marked unverified.
Main entry points: client.ts API client · KioskPage.tsx Kiosk flow · admin Admin pages · main.py FastAPI application
Components 22
Kiosk ordering
- Kiosk flow
PmCafeFrontend/pages/KioskPage.tsx - Menu and payment views
PmCafeFrontend/components/MenuViews.tsx - Option selection
PmCafeFrontend/components/OptionModal.tsx - Order state
PmCafeFrontend/shared/contexts/OrderContext.tsx
Cafe operations
- Barista order board
PmCafeFrontend/components/BaristaView.tsx
Administration
- Admin pages
PmCafeFrontend/pages/admin - Cell and points
PmCafeFrontend/pages/admin/AdminCellsPage.tsx - Menu management
PmCafeFrontend/pages/admin/AdminMenusPage.tsx - Settlement management
PmCafeFrontend/pages/admin/AdminSettlementsPage.tsx - Sales statistics
PmCafeFrontend/pages/admin/AdminStatisticsPage.tsx
Backend API
- API client
PmCafeFrontend/shared/api/client.ts - FastAPI application
PmCafeBackend/app/main.py - Cafe API routes
PmCafeBackend/app/routers - Order business logic
PmCafeBackend/app/services/order_service.py
Identity and storage
- Authentication routes
PmCafeBackend/app/routers/auth.py - JWT authorization
PmCafeBackend/app/dependencies/auth.py - Token utilities
PmCafeBackend/app/utils/auth.py - PostgreSQL session
PmCafeBackend/app/database.py - Cafe data models
PmCafeBackend/app/models
Other components
- Cafe customer
- Barista
- Administrator
Connections 26
- Cafe customer → Kiosk flow: places order
- Kiosk flow → Menu and payment views: renders
PmCafeFrontend/pages/KioskPage.tsx - Kiosk flow → Option selection: opens options
PmCafeFrontend/pages/KioskPage.tsx - Kiosk flow → API client: creates order
PmCafeFrontend/pages/KioskPage.tsx - Kiosk flow → Order state: adds order
PmCafeFrontend/pages/KioskPage.tsx - Order state → API client: loads and updates
PmCafeFrontend/shared/contexts/OrderContext.tsx - Barista → Barista order board: manages orders
- Administrator → Admin pages: manages cafe
- Admin pages → Cell and points: routes to
PmCafeFrontend/App.tsx - Admin pages → Menu management: routes to
PmCafeFrontend/App.tsx - Admin pages → Settlement management: routes to
PmCafeFrontend/App.tsx - Admin pages → Sales statistics: routes to
PmCafeFrontend/App.tsx - Cell and points → API client: uses API
- Menu management → API client: uses API
- Settlement management → API client: uses API
- Sales statistics → API client: uses API
- API client → FastAPI application: sends requests
- FastAPI application → Authentication routes: registers
PmCafeBackend/app/main.py - FastAPI application → Cafe API routes: registers
PmCafeBackend/app/main.py - Authentication routes → JWT authorization: verifies token
PmCafeBackend/app/routers/auth.py - JWT authorization → Token utilities: decodes token
PmCafeBackend/app/dependencies/auth.py - Authentication routes → PostgreSQL session: queries session
PmCafeBackend/app/routers/auth.py - JWT authorization → PostgreSQL session: loads user
PmCafeBackend/app/dependencies/auth.py - Order business logic → Cafe data models: uses order and payment models
PmCafeBackend/app/services/order_service.py - Cafe API routes → Order business logic: dispatches orders
- Order business logic → PostgreSQL session: reads and writes