How vijay0414/retailmanagement works
Retail inventory and billing system with a React client and an Express/MongoDB backend. Managers authenticate, maintain products and inventory, handle low-stock alerts and reorders; billers scan or look up products, create bills, and trigger stock deduction. The sampled backend shows stock validation, alert creation, and supplier email paths. The README describes a frontend-only version, which conflicts with the repository’s backend and context code; the graph reflects both present code areas, but leaves the client-to-server connection unverified where no request excerpt is shown.
Main entry points: App.jsx Role-based screens · app.js Express API · stockService.js Stock validation and deduction · billController.js Bill operations
Components 28
React client
- Role-based screens
Frontend/src/App.jsx - Shared app state
Frontend/src/context/AppContext.jsx - API client
Frontend/src/api/api.js - Billing screen
Frontend/src/pages/BillingScreen.jsx - Manager workflows
Frontend/src/pages/ManagerDashboard.jsx - Product entry
Frontend/src/pages/AddProduct.jsx - Reorder management
Frontend/src/pages/ReorderPage.jsx
API and access
- Express API
Backend/src/app.js - Authentication routes
Backend/src/routes/authRoutes.js - Product routes
Backend/src/routes/productRoutes.js - Bill routes
Backend/src/routes/billRoutes.js - Reorder routes
Backend/src/routes/reorderRoutes.js - Alert routes
Backend/src/routes/alertRoutes.js
Inventory and stock
- Product operations
Backend/src/controllers/productController.js - Product records
Backend/src/models/Product.js - Barcode generation and lookup
Backend/src/services/barcodeService.js - Stock validation and deduction
Backend/src/services/stockService.js
Billing and reports
- Bill operations
Backend/src/controllers/billController.js - Bill records
Backend/src/models/Bill.js - Sales reporting
Backend/src/controllers/reportController.js
Alerts and reorders
- Stock alert records
Backend/src/models/StockAlert.js - Reorder operations
Backend/src/controllers/reorderController.js - Reorder records
Backend/src/models/ReorderRequest.js - Alert handling
Backend/src/controllers/alertController.js - Supplier and invoice email
Backend/src/services/emailService.js
Other components
- Manager
- Biller
- EmailJS
Connections 33
- Manager → Role-based screens: uses
Frontend/src/App.jsx - Biller → Role-based screens: uses
Frontend/src/App.jsx - Role-based screens → Shared app state: provides state
Frontend/src/App.jsx - Role-based screens → Billing screen: routes to
Frontend/src/App.jsx - Role-based screens → Manager workflows: routes to
Frontend/src/App.jsx - Role-based screens → Product entry: routes to
Frontend/src/App.jsx - Role-based screens → Reorder management: routes to
Frontend/src/App.jsx - Shared app state → API client: calls
Frontend/src/context/AppContext.jsx - API client → Express API: requests
- Express API → Authentication routes: mounts
Backend/src/app.js - Express API → Product routes: mounts
Backend/src/app.js - Express API → Bill routes: mounts
Backend/src/app.js - Express API → Reorder routes: mounts
Backend/src/app.js - Express API → Alert routes: mounts
Backend/src/app.js - Product routes → Product operations: dispatches
Backend/src/routes/productRoutes.js - Bill routes → Bill operations: dispatches
Backend/src/routes/billRoutes.js - Reorder routes → Reorder operations: dispatches
Backend/src/routes/reorderRoutes.js - Alert routes → Alert handling: dispatches
Backend/src/routes/alertRoutes.js - Product operations → Product records: reads and writes
Backend/src/controllers/productController.js - Product operations → Barcode generation and lookup: generates and looks up
Backend/src/controllers/productController.js - Bill operations → Stock validation and deduction: validates and deducts
Backend/src/controllers/billController.js - Bill operations → Bill records: creates and reads
Backend/src/controllers/billController.js - Stock validation and deduction → Product records: updates stock
Backend/src/services/stockService.js - Stock validation and deduction → Stock alert records: creates and updates
Backend/src/services/stockService.js - Stock validation and deduction → Supplier and invoice email: sends low-stock email
Backend/src/services/stockService.js - Reorder operations → Reorder records: creates and updates
Backend/src/controllers/reorderController.js - Reorder operations → Product records: reads and replenishes
Backend/src/controllers/reorderController.js - Reorder operations → Supplier and invoice email: sends reorder email
Backend/src/controllers/reorderController.js - Supplier and invoice email → EmailJS: dispatches email
Backend/src/services/emailService.js - Bill operations → Sales reporting: feeds bill data
- Manager workflows → Shared app state: uses
- Billing screen → Shared app state: uses
Frontend/src/pages/BillingScreen.jsx - Sales reporting → Bill records: reads
Backend/src/controllers/reportController.js