How mohd-azim/store-pos works
Store POS is a desktop point-of-sale application for a single register or networked tills. A cashier signs in, scans or searches products, builds a cart, selects a customer and payment, then records or holds a sale; staff can later review transaction history. Catalog, customer, team, settings, demo-data, and photo-library capabilities form distinct supporting workflows. The Electron shell supplies operating-mode and filesystem configuration, while the renderer uses an HTTP client to reach the Express API and its SQLite-backed services. Relationships below follow excerpts or README statements; unsampled route behavior is represented by subsystem nodes without speculative internal links.
Main entry points: index.js Express API · client.ts HTTP API client · PosPage.tsx POS workspace · AuthContext.tsx Session context
Components 27
Desktop and session
- Electron main
electron/main.js - Secure preload
electron/preload.cjs - POS bridge
src/bridge.ts - Session context
src/context/AuthContext.tsx - Login screen
src/pages/LoginPage.tsx
Register and sales
- POS workspace
src/pages/PosPage.tsx - Till checkout
src/pages/TillView.tsx - Payment pad
src/components/PaymentPad.tsx - Customer picker
src/components/CustomerSelect.tsx - Transaction history
src/components/TransactionsModal.tsx
Store management
- Product catalog
src/pages/CatalogView.tsx - Store settings
src/pages/SettingsView.tsx
API and persistence
- HTTP API client
src/api/client.ts - Express API
server/index.js - Authentication
server/auth.js - Inventory routes
server/routes/inventory.js - Transaction routes
server/routes/transactions.js - Customer routes
server/routes/customers.js - Users routes
server/routes/users.js - Category routes
server/routes/categories.js - Settings routes
server/routes/settings.js - Demo data routes
server/routes/demo.js - SQLite database
server/db.js
Catalog media
- Photo picker
src/components/PhotoPicker.tsx - Media routes
server/routes/media.js
Other components
- Cashier / staff
- Pexels service
Connections 35
- Cashier / staff → Login screen: signs in
- Login screen → Session context: submits credentials
src/pages/LoginPage.tsx - Session context → POS bridge: gets API config
src/context/AuthContext.tsx - Electron main → Express API: starts local API
electron/main.js - Electron main → Secure preload: installs bridge
electron/main.js - Secure preload → POS bridge: exposes window.pos
electron/preload.cjs - Session context → HTTP API client: authenticates
src/context/AuthContext.tsx - Session context → POS workspace: renders signed-in UI
src/App.tsx - POS workspace → HTTP API client: loads store data
src/pages/PosPage.tsx - POS workspace → Till checkout: renders till view
src/pages/PosPage.tsx - POS workspace → Product catalog: renders catalog
src/pages/PosPage.tsx - POS workspace → Store settings: renders settings
src/pages/PosPage.tsx - Till checkout → HTTP API client: looks up and records sales
src/pages/TillView.tsx - Till checkout → Payment pad: renders payment pad
src/pages/TillView.tsx - Till checkout → Customer picker: renders customer picker
src/pages/TillView.tsx - Transaction history → HTTP API client: loads transactions
src/components/TransactionsModal.tsx - Product catalog → HTTP API client: manages catalog
src/pages/CatalogView.tsx - Store settings → HTTP API client: saves settings
src/pages/SettingsView.tsx - Store settings → Photo picker: renders photo picker
src/pages/SettingsView.tsx - Product catalog → Photo picker: selects product photos
src/pages/CatalogView.tsx - Photo picker → HTTP API client: manages media
src/components/PhotoPicker.tsx - HTTP API client → Express API: sends HTTP requests
src/api/client.ts - Express API → Authentication: mounts user routes
server/index.js - Express API → Inventory routes: mounts inventory routes
server/index.js - Express API → Transaction routes: mounts sales routes
server/index.js - Express API → Customer routes: mounts customer routes
server/index.js - Express API → Users routes: mounts users routes
server/index.js - Express API → Category routes: mounts category routes
server/index.js - Express API → Settings routes: mounts settings routes
server/index.js - Express API → Demo data routes: mounts demo routes
server/index.js - Express API → Media routes: mounts media routes
server/index.js - Express API → SQLite database: initializes database
server/index.js - Authentication → SQLite database: reads user records
server/auth.js - Media routes → SQLite database: reads and writes media
server/routes/media.js - Media routes → Pexels service: searches and downloads
server/routes/media.js