How brainwise-dev/posnext works
POS Next is an ERPNext point-of-sale application with a Vue client and Frappe backend. The main user workflow is cashier login, item/customer selection, cart and promotion handling, checkout/payment, and receipt printing; shifts, returns, drafts, and offline selling are related product stages. Backend capabilities include invoice and item APIs, authorization, and reporting. The source excerpts show application startup, offline-worker behavior, and authorization internals; other feature links below rely on the README, so unsampled implementation details are not inferred.
Main entry points: POSSale.vue Sales workflow · authorization.py Authorization API · gate.py Document gate · App.vue Vue application
Components 29
POS client
- Vue application
POS/src/App.vue - Sales workflow
POS/src/pages/POSSale.vue - Invoice management
POS/src/components/invoices/InvoiceManagement.vue - Session identity
POS/src/data/session.js - User identity
POS/src/data/user.js - Currency formatting
POS/src/utils/currency.js - Translations
POS/src/utils/translation.ts - Client logging
POS/src/utils/logger.js
Offline operation
- Offline state
POS/src/utils/offline/offlineState.js - Translation cache
POS/src/utils/offline/translationCache.js - Worker client
POS/src/utils/offline/workerClient.js - Offline worker
POS/src/workers/offline.worker.js - Offline sync
POS/src/utils/offline/sync.js
ERPNext services
- Invoice services
pos_next/api/invoices.py - Item services
pos_next/api/items.py - Credit sales
pos_next/api/credit_sales.py - Shift management
pos_next/api/shifts.py - Promotions and coupons
pos_next/api/offers.py - POS reports
pos_next/pos_next/report - Sales commissions
pos_next/pos_next/utils/sales_person_commission.py - Invoice hooks
pos_next/api/sales_invoice_hooks.py
Authorization
- Authorization API
pos_next/api/authorization.py - Document gate
pos_next/authorization/gate.py - Approval policy
pos_next/authorization/policy.py - Approver PIN
pos_next/authorization/pin.py - Action registry
pos_next/authorization/registry.py - Authorization grants
pos_next/authorization/grants.py - Authorization audit
pos_next/authorization/log.py
Other components
- Cashier
Connections 27
- Cashier → Sales workflow: selects and checks out
README.md - Sales workflow → Invoice services: submits sales
README.md - Sales workflow → Item services: searches items
README.md - Sales workflow → Promotions and coupons: applies offers
README.md - Sales workflow → Credit sales: requests credit approval
README.md - Sales workflow → Shift management: opens and closes shifts
README.md - Sales workflow → Invoice management: manages invoices
README.md - Invoice management → Invoice services: processes returns
README.md - Sales workflow → POS reports: views shift insights
README.md - Vue application → Session identity: initializes session
POS/src/main.js - Vue application → User identity: initializes user
POS/src/main.js - Vue application → Worker client: initializes worker
POS/src/main.js - Worker client → Offline state: reads offline state
POS/src/utils/offline/workerClient.js - Offline worker → Offline state: persists queued sales
- Offline worker → Offline sync: synchronizes queued data
- Translations → Translation cache: uses cached translations
POS/src/utils/translation.ts - Authorization API → Document gate: queries gate policy
pos_next/api/authorization.py - Authorization API → Approval policy: resolves approvers
pos_next/api/authorization.py - Authorization API → Action registry: looks up actions
pos_next/api/authorization.py - Authorization API → Approver PIN: verifies PIN
pos_next/api/authorization.py - Authorization API → Authorization audit: records decisions
pos_next/api/authorization.py - Document gate → Authorization grants: checks grants
pos_next/authorization/gate.py - Document gate → Approval policy: resolves rules
pos_next/authorization/gate.py - Document gate → Action registry: dispatches actions
pos_next/authorization/gate.py - Document gate → Authorization audit: records enforcement
pos_next/authorization/gate.py - Invoice hooks → Credit sales: uses credit-sale hooks
pos_next/api/sales_invoice_hooks.py - Invoice hooks → Sales commissions: applies commissions
pos_next/overrides/sales_invoice.py