How jayangupta/shopledger works
ShopLedger is a small-shop POS and bookkeeping application. Staff use its web interface and API to browse products, preview prices and coupons, place or cancel orders, manage customer credit, and review reports; order creation checks stock and credit, records the order, and persists changes. The server also serves printable tax invoices. The sampled sources support the main server, route, and domain-service relationships; the README is empty, and the frontend implementation and several route modules were not excerpted, so their internal behavior is not inferred.
Main entry points: server.js Express Server · orders.js Order Routes · store.js JSON Store · products.js Product Routes
Components 19
Web Interface
- POS Interface
public/js/app.js
HTTP API
- Express Server
server.js - Product Routes
routes/products.js - Order Routes
routes/orders.js - Customer Routes
routes/customers.js - Report Routes
routes/reports.js
Sales Operations
- Inventory
lib/inventory.js - Pricing
lib/pricing.js - Coupons
lib/coupons.js - Tax Rules
lib/tax.js - Order Lifecycle
lib/orders.js - Tax Invoice
lib/invoice.js
Accounts and Reporting
- Customer Ledger
lib/ledger.js - Date Utilities
lib/dates.js - Reports and Reconciliation
lib/reports.js
Persistence and Configuration
- JSON Store
lib/store.js - Shop Data
data/db.json - Shop Configuration
config.js
Other components
- Shop Staff
Connections 40
- Shop Staff → POS Interface: uses
- Express Server → POS Interface: serves static files
server.js - Express Server → Product Routes: mounts routes
server.js - Express Server → Order Routes: mounts routes
server.js - Express Server → Customer Routes: mounts routes
server.js - Express Server → Report Routes: mounts routes
server.js - Express Server → JSON Store: reads orders
server.js - Express Server → Order Lifecycle: looks up order
server.js - Express Server → Tax Invoice: renders invoice
server.js - Express Server → Shop Configuration: configures port
server.js - Product Routes → JSON Store: reads products
routes/products.js - Product Routes → Inventory: calculates stock
routes/products.js - Product Routes → Tax Rules: gets tax slab
routes/products.js - Product Routes → Coupons: lists coupons
routes/products.js - Order Routes → JSON Store: reads and writes
routes/orders.js - Order Routes → Inventory: checks and reserves
routes/orders.js - Order Routes → Pricing: computes totals
routes/orders.js - Order Routes → Coupons: validates code
routes/orders.js - Order Routes → Order Lifecycle: adds or cancels
routes/orders.js - Order Routes → Customer Ledger: checks credit
routes/orders.js - Customer Routes → JSON Store: reads and writes
routes/customers.js - Customer Routes → Customer Ledger: manages balances
routes/customers.js - Report Routes → JSON Store: reads data
routes/reports.js - Report Routes → Reports and Reconciliation: builds reports
routes/reports.js - Report Routes → Pricing: previews totals
routes/reports.js - Report Routes → Coupons: checks preview code
routes/reports.js - JSON Store → Shop Data: reads and writes
lib/store.js - Order Lifecycle → Date Utilities: normalizes dates
lib/orders.js - Order Lifecycle → Inventory: releases stock
lib/orders.js - Order Lifecycle → Customer Ledger: reverses credit
lib/orders.js - Customer Ledger → Date Utilities: dates settlements
lib/ledger.js - Reports and Reconciliation → Inventory: summarizes stock
lib/reports.js - Reports and Reconciliation → Customer Ledger: totals receivables
lib/reports.js - Reports and Reconciliation → Tax Invoice: compares figures
lib/reports.js - Pricing → Tax Rules: resolves tax
lib/pricing.js - Pricing → Coupons: calculates discounts
lib/pricing.js - Coupons → Shop Configuration: reads coupon rules
lib/coupons.js - Inventory → Shop Configuration: reads inventory defaults
lib/inventory.js - Tax Rules → Shop Configuration: reads tax slabs
lib/tax.js - Tax Invoice → Shop Configuration: reads shop and tax settings
lib/invoice.js