How joshleejhankimgbunao-ops/inventory works
Inventory System is a browser-based inventory and point-of-sale product backed by an Express API and MongoDB. Users sign in, manage catalog and stock, complete sales or credit transactions, and review history, reports, partners, and special orders. The frontend contexts and API clients mediate page workflows; backend routes dispatch requests to domain controllers, which use models and services. The README establishes the overall stack, while sampled source confirms selected auth, sale, credit, logging, and realtime relationships; other capability links are documented but not traced through unsampled handlers.
Main entry points: inventoryApi.js Inventory API client · creditTransactionController.js Credit workflow · saleController.js Sales workflow · app.js Express application
Components 32
Web application
- Application routing
src/App.jsx - Session context
src/context/AuthContext.jsx - Inventory context
src/context/InventoryContext.jsx - Point of sale
src/pages/PointOfSale.jsx - Catalog management
src/pages/ProductList.jsx - Dashboard and reports
src/pages/Dashboard.jsx - Sales history
src/pages/History.jsx - Special orders
src/pages/SpecialOrders.jsx - Credit transactions
src/pages/CreditTransactions.jsx - Settings and users
src/pages/Settings.jsx - HTTP API client
src/services/apiClient.js - Inventory API client
src/services/inventoryApi.js - Realtime client
src/services/realtimeClient.js
API and identity
- Express application
server/src/app.js - Auth routes and guards
server/src/routes/authRoutes.js - Authentication
server/src/controllers/authController.js - User records
server/src/models/User.js
Commerce operations
- Sales workflow
server/src/controllers/saleController.js - Sales routes
server/src/routes/saleRoutes.js - Credit workflow
server/src/controllers/creditTransactionController.js - Sales records
server/src/models/Sale.js - Credit records
server/src/models/CreditTransaction.js - Product and category workflows
server/src/controllers/productController.js - Special order workflow
server/src/controllers/specialOrderController.js - Partner management
server/src/controllers/partnerController.js
Shared services
- Settings workflow
server/src/controllers/settingController.js - Audit and inventory logs
server/src/services/logService.js - Realtime event service
server/src/services/realtimeService.js - Document object storage
server/src/services/r2StorageService.js
Other components
- Staff user
- MongoDB
- Cloudflare R2
Connections 35
- Staff user → Application routing: uses
README.md - Application routing → Session context: hosts
src/App.jsx - Application routing → Dashboard and reports: routes to
src/App.jsx - Point of sale → Inventory context: reads state
src/pages/PointOfSale.jsx - Catalog management → Inventory context: uses state
- Dashboard and reports → Inventory context: uses state
- Inventory context → Inventory API client: loads data
src/context/InventoryContext.jsx - Session context → HTTP API client: requests
src/context/AuthContext.jsx - Inventory API client → HTTP API client: uses
src/services/inventoryApi.js - HTTP API client → Express application: HTTP requests
README.md - Express application → Auth routes and guards: mounts
server/src/app.js - Express application → Sales routes: mounts
server/src/app.js - Sales routes → Sales workflow: dispatches
server/src/routes/saleRoutes.js - Auth routes and guards → Authentication: dispatches
server/src/routes/authRoutes.js - Authentication → User records: reads and writes
server/src/controllers/authController.js - Sales workflow → Sales records: reads and writes
server/src/controllers/saleController.js - Credit workflow → Credit records: reads and writes
server/src/controllers/creditTransactionController.js - Credit workflow → Sales records: looks up sales
server/src/controllers/creditTransactionController.js - Sales workflow → Audit and inventory logs: writes activity
server/src/controllers/saleController.js - Credit workflow → Audit and inventory logs: writes activity
server/src/controllers/creditTransactionController.js - Authentication → Audit and inventory logs: writes activity
server/src/controllers/authController.js - Sales workflow → Realtime event service: publishes updates
server/src/controllers/saleController.js - Credit workflow → Realtime event service: publishes updates
server/src/controllers/creditTransactionController.js - Realtime client → Express application: requests stream
- Sales workflow → Document object storage: stores documents
server/src/controllers/saleController.js - Credit workflow → Document object storage: loads proofs
server/src/controllers/creditTransactionController.js - Document object storage → Cloudflare R2: object operations
server/src/services/r2StorageService.js - Product and category workflows → MongoDB: catalog data
- Special order workflow → MongoDB: order data
- Partner management → MongoDB: partner data
- Settings workflow → MongoDB: settings data
- Sales history → Inventory API client: requests history
- Special orders → Inventory API client: requests orders
- Credit transactions → Inventory API client: requests credit
- Settings and users → Inventory API client: requests settings
src/pages/Settings.jsx