How mohd-azim/pharmaspot works
PharmaSpot is an Electron-based pharmacy point-of-sale application with an Express API and local NeDB persistence. The principal workflow is staff using the POS to find products, build and pay for a sale, record a transaction, and update stock; the README also describes customer orders, receipts, account permissions, transaction filtering, and stock/expiry alerts. API mounting and transaction-to-inventory calls are visible in the excerpts. The frontend-to-API connection and several README capabilities are represented at their documented subsystem level because their implementation was not sampled.
Main entry points: server.js HTTP API server · renderer.js UI bootstrap · pos.js Point of sale · start.js Electron window
Components 20
Desktop runtime
- Electron window
start.js - Install event handling
installers/setupEvents.js - UI bootstrap
renderer.js
Sales experience
- Point of sale
assets/js/pos.js - Product search
assets/js/product-filter.js - Checkout and receipts
assets/js/checkout.js
Business APIs
- HTTP API server
server.js - Inventory and alerts
api/inventory.js - Transactions and orders
api/transactions.js - Customer records
api/customers.js - Product categories
api/categories.js - Staff accounts
api/users.js - Store settings
api/settings.js
Local records
- Inventory database
api/inventory.js - Transaction database
api/transactions.js - Customer database
api/customers.js - Category database
api/categories.js - User database
api/users.js - Settings database
api/settings.js
Other components
- Pharmacy staff
Connections 23
- Electron window → Install event handling: checks install events
start.js - Electron window → HTTP API server: starts
start.js - Electron window → UI bootstrap: loads UI
- UI bootstrap → Point of sale: loads
renderer.js - UI bootstrap → Product search: loads
renderer.js - UI bootstrap → Checkout and receipts: loads
renderer.js - Pharmacy staff → Point of sale: uses
- Point of sale → Product search: searches with
- Point of sale → Checkout and receipts: initiates checkout
- Checkout and receipts → HTTP API server: submits sale
- HTTP API server → Inventory and alerts: mounts route
server.js - HTTP API server → Customer records: mounts route
server.js - HTTP API server → Product categories: mounts route
server.js - HTTP API server → Store settings: mounts route
server.js - HTTP API server → Staff accounts: mounts route
server.js - HTTP API server → Transactions and orders: mounts route
server.js - Transactions and orders → Inventory and alerts: decrements stock
api/transactions.js - Inventory and alerts → Inventory database: reads and writes
api/inventory.js - Transactions and orders → Transaction database: reads and writes
api/transactions.js - Customer records → Customer database: reads and writes
api/customers.js - Product categories → Category database: reads and writes
api/categories.js - Staff accounts → User database: reads and writes
api/users.js - Store settings → Settings database: reads and writes
api/settings.js