How prachaya971-jpg/cafe_boardgame_server works
This is a restaurant operations backend with customer food ordering, table requests, board-game borrowing, staff and catalog administration, and sales reporting. The main evidenced customer workflow is menu lookup followed by adding food and options to an open table order; staff workflows manage requests and operational records, while reporting summarizes sales. The excerpts show selected server routes and database access patterns, but not the complete route wiring or the implementations of every listed subsystem, so uncertain links are omitted.
Main entry points: server.js HTTP API · user_account.js Account checks · report_food.js Food maintenance · table_check.js Table verification
Components 17
API and identity
- HTTP API
server.js - Account checks
models/user_account.js - Token signing
libs/jwt.js
Food ordering
- Customer menu
customer/menu/menu.js - Food catalog
create/createfood.js - Food maintenance
report/report_food.js - Order handling
order/order.js
Tables and games
- Table verification
tablecus/table_check.js - Table requests
table/tablereq.js - Game borrowing
borrow/borrow.js - Game types
borrow/edit_boardgame_type.js
Staff and reporting
- Employee records
emp/emp.js - Revenue dashboard
dashboard/dashboard.js - Sales reporting
salereport/salereport.js
Other components
- Customer
- Staff
- MariaDB
Connections 19
- Customer → HTTP API: sends requests
- Staff → HTTP API: sends requests
- HTTP API → Account checks: checks identity
- HTTP API → Token signing: signs table token
- HTTP API → Revenue dashboard: gets revenue data
- HTTP API → Employee records: gets employee data
- HTTP API → Table verification: checks table request
- HTTP API → Food maintenance: deletes food variant
- HTTP API → Game types: deletes game type
- Customer menu → MariaDB: reads and writes
- Food catalog → MariaDB: writes catalog
- Food maintenance → MariaDB: reads and writes
- Order handling → MariaDB: reads and writes
- Account checks → MariaDB: checks accounts
- Table verification → MariaDB: checks tables
- Table requests → MariaDB: reads and writes
- Employee records → MariaDB: reads and writes
- Revenue dashboard → MariaDB: queries sales
- Game types → MariaDB: reads and writes