How dlop3zc/soma-punto-venta works
SOMA is a bar/restaurant point-of-sale app for staff to manage table accounts, send items through kitchen preparation, take payment, and close shifts. The main workflow runs from menu selection and open orders through kitchen updates and checkout; inventory tracks availability and stock along the way. Admin capabilities include managing the menu and staff, reviewing analytics, and recording cash cuts. Firebase provides authentication and persistent data; ticket printing supports browser and direct ESC/POS modes. Relationships reflect the README and shown imports/calls; unsampled implementations are represented only where documented.
Main entry points: App.tsx POS app · useCartStore.ts Order state · firebase.ts Firebase setup · ProductCatalog.tsx Product catalog
Components 34
Order operations
- POS app
src/App.tsx - Product catalog
src/components/ProductCatalog.tsx - Table accounts
src/components/Cart.tsx - Order state
src/store/useCartStore.ts - Kitchen queue
src/components/KitchenView.tsx - Checkout
src/components/CheckoutView.tsx - Payment dialog
src/components/CheckoutModal.tsx - Split bill
src/components/SplitBillModal.tsx
Admin and reporting
- Menu management
src/components/MenuEditorView.tsx - Menu state
src/store/useMenuStore.ts - Initial menu
src/data/defaultMenu.ts - Inventory management
src/components/InventoryView.tsx - Inventory state
src/store/useInventoryStore.ts - Stock rules
src/utils/stock.ts - Sales analytics
src/components/AnalyticsView.tsx - Analytics calculations
src/utils/analytics.ts - Cash cut
src/components/CashCutModal.tsx - Shift state
src/store/useShiftStore.ts - Shift calculations
src/utils/cashCut.ts - Staff administration
src/components/AdminUsersView.tsx
Data and identity
- Sign in
src/components/LoginView.tsx - Auth state
src/store/useAuthStore.ts - Firebase setup
src/firebase.ts
Ticket printing
- Printer settings
src/components/PrinterSettingsView.tsx - Printer state
src/store/usePrinterStore.ts - Ticket builders
src/printer/tickets.ts - ESC/POS encoding
src/printer/escpos.ts - HTML ticket
src/printer/htmlTicket.ts - Printer transport
src/printer/transport.ts - Browser printing
src/printer/browserPrint.ts
Other components
- Restaurant staff
- Firestore
- Firebase Authentication
- Receipt printer
Connections 46
- Restaurant staff → POS app: uses
- POS app → Sign in: routes to
src/App.tsx - POS app → Product catalog: routes to
src/App.tsx - POS app → Table accounts: routes to
src/App.tsx - POS app → Kitchen queue: routes to
src/App.tsx - POS app → Checkout: routes to
src/App.tsx - POS app → Sales analytics: routes to
src/App.tsx - POS app → Inventory management: routes to
src/App.tsx - POS app → Menu management: routes to
src/App.tsx - Product catalog → Order state: adds items
src/components/ProductCatalog.tsx - Product catalog → Menu state: reads menu
src/components/ProductCatalog.tsx - Product catalog → Inventory state: checks stock
src/components/ProductCatalog.tsx - Table accounts → Order state: updates accounts
src/components/Cart.tsx - Kitchen queue → Order state: updates preparation
src/components/KitchenView.tsx - Checkout → Order state: loads accounts
src/components/CheckoutView.tsx - Checkout → Payment dialog: opens
src/components/CheckoutView.tsx - Checkout → Split bill: opens
src/components/CheckoutView.tsx - Menu management → Menu state: edits
src/components/MenuEditorView.tsx - Menu state → Initial menu: seeds from
src/store/useMenuStore.ts - Inventory management → Inventory state: adjusts stock
src/components/InventoryView.tsx - Order state → Stock rules: checks availability
src/store/useCartStore.ts - Sales analytics → Analytics calculations: calculates reports
src/components/AnalyticsView.tsx - Sales analytics → Order state: reads sales
src/components/AnalyticsView.tsx - Sales analytics → Inventory state: reads stock
src/components/AnalyticsView.tsx - Cash cut → Shift state: closes shift
src/components/CashCutModal.tsx - Cash cut → Shift calculations: summarizes sales
src/components/CashCutModal.tsx - Shift state → Order state: reads sales
src/store/useShiftStore.ts - Shift state → Shift calculations: computes totals
src/store/useShiftStore.ts - Staff administration → Auth state: manages users
src/components/AdminUsersView.tsx - Sign in → Auth state: signs in through
src/components/LoginView.tsx - Auth state → Firebase setup: uses services
src/store/useAuthStore.ts - Auth state → Firebase Authentication: authenticates
src/store/useAuthStore.ts - Menu state → Firebase setup: uses database
src/store/useMenuStore.ts - Order state → Firebase setup: uses database
src/store/useCartStore.ts - Inventory state → Firebase setup: uses database
src/store/useInventoryStore.ts - Shift state → Firebase setup: uses database
src/store/useShiftStore.ts - Firebase setup → Firestore: connects to
src/firebase.ts - Firebase setup → Firebase Authentication: connects to
src/firebase.ts - Printer settings → Printer state: configures
src/components/PrinterSettingsView.tsx - Printer state → Ticket builders: builds tickets
src/store/usePrinterStore.ts - Ticket builders → ESC/POS encoding: encodes
src/printer/tickets.ts - Ticket builders → HTML ticket: renders
src/printer/tickets.ts - Printer state → Printer transport: sends through
src/store/usePrinterStore.ts - Printer state → Browser printing: prints via
src/store/usePrinterStore.ts - Printer transport → Receipt printer: writes to
- Browser printing → Receipt printer: prints to