How abhii-navv/order-management works
This is a React and Express inventory/order-management application. Users authenticate, browse products, build a cart, and place orders; administrators manage products and categories, stock, and reports. The frontend routes screens through a shared Axios client to the versioned API. Backend routes apply authentication and role checks before controllers perform domain operations against PostgreSQL. Orders include stock updates and audit logging, and the order controller generates PDF invoices. The graph preserves documented reporting and audit capabilities; some frontend pages and backend modules were not sampled, so their internal links are omitted where unverified.
Main entry points: App.jsx App routes · api.js API client · server.js Express API · orderController.js Order and invoices
Components 23
React application
- App routes
frontend/src/App.jsx - Login and registration
frontend/src/pages/Login.jsx - Product catalog
frontend/src/pages/Products.jsx - Cart state
frontend/src/context/CartContext.jsx - Cart and checkout
frontend/src/pages/Cart.jsx - Category management
frontend/src/pages/Categories.jsx - Orders
frontend/src/pages/Orders.jsx - Dashboard
frontend/src/pages/Dashboard.jsx - Reports
frontend/src/pages/Reports.jsx - Audit logs
frontend/src/pages/AuditLogs.jsx
API and access
- API client
frontend/src/api.js - Express API
backend/server.js - Auth routes
backend/src/routes/authRoutes.js - Authentication
backend/src/controllers/authController.js - JWT and role guards
backend/src/middleware/auth.js
Inventory operations
- Product operations
backend/src/controllers/productController.js - Category operations
backend/src/controllers/categoryController.js - Order and invoices
backend/src/controllers/orderController.js - Product data access
backend/src/models/Product.js - Stock audit log
backend/src/models/StockAuditLog.js
Reporting and persistence
- Analytics and reports
backend/src/controllers/reportController.js - PostgreSQL
Other components
- User or admin
Connections 37
- User or admin → App routes: uses
frontend/src/App.jsx - App routes → Login and registration: routes to
frontend/src/App.jsx - App routes → Product catalog: routes to
frontend/src/App.jsx - App routes → Category management: routes to
frontend/src/App.jsx - App routes → Orders: routes to
frontend/src/App.jsx - App routes → Cart and checkout: routes to
frontend/src/App.jsx - App routes → Dashboard: routes to
frontend/src/App.jsx - App routes → Reports: routes to
frontend/src/App.jsx - App routes → Audit logs: routes to
frontend/src/App.jsx - Product catalog → API client: requests data
frontend/src/pages/Products.jsx - Cart and checkout → API client: places order
frontend/src/pages/Cart.jsx - Cart and checkout → Cart state: reads cart
frontend/src/pages/Cart.jsx - Product catalog → Cart state: adds items
frontend/src/pages/Products.jsx - Category management → API client: requests data
frontend/src/pages/Categories.jsx - Orders → API client: requests data
frontend/src/pages/Orders.jsx - Dashboard → API client: requests data
frontend/src/pages/Dashboard.jsx - Reports → API client: requests data
frontend/src/pages/Reports.jsx - API client → Express API: calls API
README.md - Express API → Auth routes: mounts routes
backend/server.js - Auth routes → Authentication: dispatches
backend/src/routes/authRoutes.js - Auth routes → JWT and role guards: checks access
backend/src/routes/authRoutes.js - Express API → Product operations: mounts routes
- Express API → Category operations: mounts routes
- Express API → Order and invoices: mounts routes
- Express API → Analytics and reports: mounts routes
- Product operations → Product data access: calls
backend/src/controllers/productController.js - Product operations → Stock audit log: writes and reads
backend/src/controllers/productController.js - Order and invoices → Product data access: checks stock
backend/src/controllers/orderController.js - Order and invoices → Stock audit log: writes audit
backend/src/controllers/orderController.js - Analytics and reports → Product data access: queries low stock
backend/src/controllers/reportController.js - Analytics and reports → Stock audit log: queries logs
backend/src/controllers/reportController.js - Product data access → PostgreSQL: reads and writes
backend/src/models/Product.js - Stock audit log → PostgreSQL: reads and writes
backend/src/models/StockAuditLog.js - Authentication → PostgreSQL: persists account data
- Analytics and reports → PostgreSQL: queries analytics
backend/src/controllers/reportController.js - Category operations → PostgreSQL: persists categories
- Order and invoices → PostgreSQL: transactions and order data
backend/src/controllers/orderController.js