How hoyirul/gacoan-pos works
Gacoan POS is a Next.js point-of-sale application for admin, cashier, and self-service ordering. Customers or cashiers select menu items; order endpoints validate BOM ingredient stock, calculate totals, decrement inventory, record stock mutations, and save transactions. Admin pages manage ingredients, menus, and stock history and review transactions; login supplies a client-side session. The graph reflects documented features and sampled routes; several UI-to-API relationships are supported by direct fetches, while unsampled route wiring is omitted.
Main entry points: prisma.ts Prisma client · admin/page.tsx Admin dashboard · menus/page.tsx Menu and BOM management · mainLayout.tsx Session layout
Components 23
Sales channels
- Self-service ordering
app/order/page.tsx - Cashier checkout
app/cashier/cashierForm.tsx - Available menus
app/cashier/page.tsx - Login screen
app/login/page.tsx
Administration
- Ingredient management
app/admin/ingredients/page.tsx - Menu and BOM management
app/admin/menus/page.tsx - Stock history
app/admin/stock-mutations/page.tsx - Transaction reports
app/admin/transactions/page.tsx - Admin dashboard
app/admin/page.tsx - Session layout
components/mainLayout.tsx
Application routes
- Login endpoint
app/api/login/route.ts - Order menu catalog
app/api/order/menus/route.ts - Self-service order processing
app/api/order/submit/route.ts - Cashier transaction processing
app/api/cashier/transactions/add/route.ts - Ingredient routes
app/api/admin/ingredients - Menu routes
app/api/admin/menus - Stock history route
app/api/admin/stock-mutations/route.ts - Transaction history route
app/api/admin/transactions/route.ts
Persistence
- Prisma client
lib/prisma.ts - POS database
prisma/schema.prisma
Other components
- Customer
- Cashier
- Administrator
Connections 30
- Customer → Self-service ordering: selects items
README.md - Self-service ordering → Order menu catalog: loads menu
- Self-service ordering → Self-service order processing: submits order
- Cashier → Cashier checkout: enters sale
- Available menus → Cashier checkout: renders
app/cashier/page.tsx - Cashier checkout → Cashier transaction processing: records sale
- Administrator → Login screen: signs in
README.md - Login screen → Login endpoint: authenticates
- Login endpoint → Prisma client: queries user
app/api/login/route.ts - Prisma client → POS database: persists records
- Ingredient management → Ingredient routes: manages stock
- Menu and BOM management → Menu routes: creates menu
app/admin/menus/page.tsx - Menu and BOM management → Ingredient routes: loads ingredients
app/admin/menus/page.tsx - Stock history → Stock history route: loads history
- Transaction reports → Transaction history route: loads sales
- Admin dashboard → Ingredient management: links to
app/admin/page.tsx - Admin dashboard → Menu and BOM management: links to
app/admin/page.tsx - Admin dashboard → Stock history: links to
app/admin/page.tsx - Admin dashboard → Transaction reports: links to
app/admin/page.tsx - Ingredient management → Session layout: renders within
app/admin/ingredients/page.tsx - Menu and BOM management → Session layout: renders within
app/admin/menus/page.tsx - Stock history → Session layout: renders within
app/admin/stock-mutations/page.tsx - Transaction reports → Session layout: renders within
app/admin/transactions/page.tsx - Ingredient routes → Prisma client: uses client
app/api/admin/ingredients/add/route.ts - Menu routes → Prisma client: uses client
app/api/admin/menus/add/route.ts - Stock history route → Prisma client: reads mutations
app/api/admin/stock-mutations/route.ts - Transaction history route → Prisma client: reads transactions
app/api/admin/transactions/route.ts - Order menu catalog → Prisma client: reads menus
app/api/order/menus/route.ts - Self-service order processing → Prisma client: updates stock and sales
app/api/order/submit/route.ts - Cashier transaction processing → Prisma client: updates stock and sales
app/api/cashier/transactions/add/route.ts