How kavampallyharishkumar-art/smallshop-pos works
Small Shop POS is a browser-based point-of-sale and shop-management application. A cashier signs in, selects products and optionally a customer at the register, submits a sale, and receives a receipt; administrators also manage catalog, staff, and stock, while users review sales and reports. The client API wrapper connects these screens to the Express API, whose routed controllers validate and authorize requests and persist operational data in SQLite. The tree and excerpts support the sale, catalog, authentication, and reporting domains; README is empty, so unsampled page details and route wiring are represented conservatively.
Main entry points: client.js API Client · connection.js SQLite Store · sale.controller.js Sale Processing · auth.js Access Control
Components 33
POS Client
- App Shell
client/src/App.jsx - Session State
client/src/context/AuthContext.jsx - Sign In
client/src/pages/LoginPage.jsx - POS Register
client/src/pages/POSRegister.jsx - Receipt View
client/src/components/ReceiptModal.jsx - Catalog Screens
client/src/pages/ProductsPage.jsx - Category Screen
client/src/pages/CategoriesPage.jsx - Customer Screen
client/src/pages/CustomersPage.jsx - Sales Screen
client/src/pages/SalesPage.jsx - Reports Screen
client/src/pages/ReportsPage.jsx - Staff Screen
client/src/pages/UsersPage.jsx
API Boundary
- API Client
client/src/api/client.js - HTTP API
server/src/app.js - Auth Routes
server/src/routes/auth.routes.js - Product Routes
server/src/routes/product.routes.js - Customer Routes
server/src/routes/customer.routes.js - Category Routes
server/src/routes/category.routes.js - Sales Routes
server/src/routes/sale.routes.js - Report Routes
server/src/routes/report.routes.js
Shop Operations
- Authentication
server/src/controllers/auth.controller.js - Product & Stock
server/src/controllers/product.controller.js - Categories
server/src/controllers/category.controller.js - Customers
server/src/controllers/customer.controller.js - Sale Processing
server/src/controllers/sale.controller.js - Sales Reporting
server/src/controllers/report.controller.js
Server Platform
- SQLite Store
server/src/db/connection.js - Request Validation
server/src/middleware/validate.js - Access Control
server/src/middleware/auth.js - Error Responses
server/src/middleware/errorHandler.js - Pagination
server/src/utils/paginate.js - Money Rules
server/src/utils/money.js - Invoice Counter
server/src/utils/invoice.js
Other components
- Cashier / Admin
Connections 40
- Cashier / Admin → App Shell: uses
- App Shell → Session State: provides session
- Session State → API Client: requests identity
client/src/context/AuthContext.jsx - Sign In → Session State: signs in
- POS Register → API Client: submits sale
client/src/pages/POSRegister.jsx - POS Register → Receipt View: renders receipt
client/src/pages/POSRegister.jsx - Catalog Screens → API Client: manages products
client/src/pages/ProductsPage.jsx - Category Screen → API Client: manages categories
- Customer Screen → API Client: manages customers
- Sales Screen → API Client: reviews sales
- Reports Screen → API Client: requests reports
client/src/pages/ReportsPage.jsx - Staff Screen → API Client: manages staff
- API Client → HTTP API: sends HTTP
client/src/api/client.js - HTTP API → Auth Routes: mounts routes
server/src/app.js - Auth Routes → Authentication: dispatches
server/src/routes/auth.routes.js - Product Routes → Product & Stock: dispatches
server/src/routes/product.routes.js - Customer Routes → Customers: dispatches
server/src/routes/customer.routes.js - Category Routes → Categories: dispatches
server/src/routes/category.routes.js - Sales Routes → Sale Processing: dispatches
server/src/routes/sale.routes.js - Report Routes → Sales Reporting: dispatches
- Auth Routes → Access Control: guards requests
server/src/routes/auth.routes.js - Product Routes → Request Validation: validates input
server/src/routes/product.routes.js - Product Routes → Access Control: guards requests
server/src/routes/product.routes.js - Customer Routes → Request Validation: validates input
server/src/routes/customer.routes.js - Customer Routes → Access Control: guards requests
server/src/routes/customer.routes.js - Category Routes → Request Validation: validates input
server/src/routes/category.routes.js - Category Routes → Access Control: guards requests
server/src/routes/category.routes.js - Sales Routes → Access Control: guards requests
server/src/routes/sale.routes.js - Authentication → SQLite Store: reads and writes
server/src/controllers/auth.controller.js - Product & Stock → SQLite Store: reads and writes
server/src/controllers/product.controller.js - Customers → SQLite Store: reads and writes
server/src/controllers/customer.controller.js - Categories → SQLite Store: reads and writes
server/src/controllers/category.controller.js - Sale Processing → SQLite Store: records transactions
server/src/controllers/sale.controller.js - Sales Reporting → SQLite Store: queries reports
server/src/controllers/report.controller.js - Product & Stock → Pagination: paginates listings
server/src/controllers/product.controller.js - Customers → Pagination: paginates listings
server/src/controllers/customer.controller.js - Sale Processing → Pagination: paginates listings
server/src/controllers/sale.controller.js - Sale Processing → Money Rules: computes totals
server/src/controllers/sale.controller.js - Sale Processing → Invoice Counter: allocates number
server/src/controllers/sale.controller.js - HTTP API → Error Responses: handles errors
server/src/app.js