How manivuppala124/balaji-cool-drinks works
Sri Balaji is a dual retail/wholesale storefront and store-operations platform. Shoppers browse products, maintain a cart, and place orders; the server authenticates requests, verifies prices and stock, persists the order, and notifies administrators. Staff also manage catalog, inventory, customers, credits, cash-register sessions, settings, and reports. The graph combines documented capabilities with sampled routing and source-index references; unsampled page-to-endpoint wiring is not expanded into asserted calls.
Main entry points: server.js Express API · orderController.js Order processing · App.jsx React application · endpoints.js API client
Components 28
Customer and admin client
- React application
client/src/App.jsx - Auth state
client/src/context/AuthContext.jsx - Cart state
client/src/context/CartContext.jsx - Storefront pages
client/src/pages - Admin workspace
client/src/pages/admin - Point of sale
client/src/pages/admin/POS.jsx - Cash register UI
client/src/pages/admin/CashRegister.jsx
API and access
- API client
client/src/services/endpoints.js - Express API
server/server.js - Authentication
server/src/controllers/authController.js - Auth and roles
server/src/middleware/auth.js
Commerce operations
- Catalog management
server/src/controllers/productController.js - Order processing
server/src/controllers/orderController.js - Inventory management
server/src/controllers/inventoryController.js
Store operations
- Customer management
server/src/controllers/customerController.js - Customer credits
server/src/controllers/creditController.js - Cash register
server/src/controllers/cashRegisterController.js - Sales reports
server/src/controllers/reportController.js - Shop settings
server/src/controllers/settingsController.js - Notifications
server/src/services/notificationService.js
Persistence and services
- Order records
server/src/models/Order.js - Product records
server/src/models/Product.js - Credit records
server/src/models/Credit.js - User records
server/src/models/User.js - MongoDB
- Audit logging
server/src/services/auditService.js
Other components
- Shopper
- Store staff
Connections 44
- Shopper → React application: uses
- Store staff → React application: uses
- React application → Auth state: provides
client/src/App.jsx - React application → Cart state: provides
client/src/App.jsx - React application → Storefront pages: routes to
client/src/App.jsx - React application → Admin workspace: routes to
client/src/App.jsx - Storefront pages → Cart state: updates
- Storefront pages → API client: requests
client/src/pages/admin/POS.jsx - Admin workspace → API client: requests
client/src/pages/admin/POS.jsx - Point of sale → API client: requests
client/src/pages/admin/POS.jsx - Cash register UI → API client: requests
client/src/pages/admin/CashRegister.jsx - Auth state → API client: calls
client/src/context/AuthContext.jsx - API client → Express API: sends REST requests
- Express API → Authentication: routes auth
server/server.js - Express API → Catalog management: routes products
- Express API → Order processing: routes orders
server/server.js - Express API → Inventory management: routes admin operations
- Express API → Customer management: routes admin operations
- Express API → Customer credits: routes admin operations
- Express API → Cash register: routes admin operations
- Express API → Sales reports: routes admin operations
- Express API → Shop settings: routes settings
- Express API → Auth and roles: uses guards
- Authentication → User records: reads and writes
server/src/controllers/authController.js - Auth and roles → User records: loads user
server/src/middleware/auth.js - Order processing → Order records: creates orders
server/src/controllers/orderController.js - Order processing → Product records: checks stock
server/src/controllers/orderController.js - Order processing → Shop settings: checks settings
server/src/controllers/orderController.js - Order processing → Notifications: notifies admins
server/src/controllers/orderController.js - Order processing → Inventory management: deducts stock
- Order processing → Customer credits: creates credit orders
- Catalog management → Product records: manages products
server/src/controllers/productController.js - Catalog management → Audit logging: records changes
server/src/controllers/productController.js - Customer credits → Credit records: manages credits
server/src/controllers/creditController.js - Customer credits → Audit logging: records changes
server/src/controllers/creditController.js - Cash register → Credit records: reads collections
server/src/controllers/cashRegisterController.js - Cash register → Order records: reads sales
server/src/controllers/cashRegisterController.js - Sales reports → Order records: aggregates orders
server/src/controllers/reportController.js - Sales reports → Product records: reads costs
server/src/controllers/reportController.js - Notifications → User records: selects recipients
server/src/services/notificationService.js - Order records → MongoDB: persists
- Product records → MongoDB: persists
- Credit records → MongoDB: persists
- User records → MongoDB: persists