How puneethkumar-tech/smart-inventory-supply-chain works
Smart Inventory is a React and Express application for managing products, suppliers, purchase orders, and operational insights. The main workflow runs from the web interface through a domain service and REST API to PostgreSQL, then returns data for display; completing an order also updates product stock. The README documents dashboard analytics, demand forecasting, CSV reports, and settings as additional capabilities. Some frontend-to-service and model-to-database wiring is inferred from the documented architecture and tree; sampled excerpts do not cover every subsystem.
Main entry points: App.jsx App and routes · server.js Express server · api.js API client · db.js Database connection
Components 33
Web interface
- App and routes
frontend/src/App.jsx - Dashboard page
frontend/src/pages/Dashboard.jsx - Inventory page
frontend/src/pages/Inventory.jsx - Suppliers page
frontend/src/pages/Suppliers.jsx - Orders page
frontend/src/pages/Orders.jsx - Forecast page
frontend/src/pages/Forecast.jsx - Reports page
frontend/src/pages/Reports.jsx - Settings page
frontend/src/pages/Settings.jsx - Inventory service
frontend/src/services/inventoryService.js - Supplier service
frontend/src/services/supplierService.js - Order service
frontend/src/services/orderService.js - Dashboard service
frontend/src/services/dashboardService.js - Report service
frontend/src/services/reportService.js - API client
frontend/src/services/api.js
REST API
- Express server
backend/server.js - Product routes
backend/routes/productRoutes.js - Order routes
backend/routes/orderRoutes.js - Supplier routes
backend/routes/supplierRoutes.js - Dashboard routes
backend/routes/dashboardRoutes.js - Report routes
backend/routes/reportRoutes.js - Database connection
backend/config/db.js
Inventory domains
- Product controller
backend/controllers/productController.js - Order controller
backend/controllers/orderController.js - Supplier controller
backend/controllers/supplierController.js - Product model
backend/models/productModel.js - Order model
backend/models/orderModel.js - Supplier model
backend/models/supplierModel.js
Analytics and reports
- Dashboard controller
backend/controllers/dashboardController.js - Dashboard model
backend/models/dashboardModel.js - Report controller
backend/controllers/reportController.js - Report model
backend/models/reportModel.js
Other components
- Operator
- PostgreSQL
Connections 46
- Operator → App and routes: uses
- App and routes → Dashboard page: routes to
- App and routes → Inventory page: routes to
- App and routes → Suppliers page: routes to
- App and routes → Orders page: routes to
- App and routes → Forecast page: routes to
- App and routes → Reports page: routes to
- App and routes → Settings page: routes to
- Inventory page → Inventory service: requests data
- Suppliers page → Supplier service: requests data
- Orders page → Order service: requests data
- Dashboard page → Dashboard service: requests data
- Forecast page → Dashboard service: requests forecast
- Reports page → Report service: requests reports
- Inventory service → API client: calls
- Supplier service → API client: calls
- Order service → API client: calls
- Dashboard service → API client: calls
- Report service → API client: calls
- API client → Express server: HTTP requests
- Express server → Product routes: mounts
- Express server → Order routes: mounts
- Express server → Supplier routes: mounts
- Express server → Dashboard routes: mounts
- Express server → Report routes: mounts
- Product routes → Product controller: dispatches
- Order routes → Order controller: dispatches
- Supplier routes → Supplier controller: dispatches
- Dashboard routes → Dashboard controller: dispatches
- Report routes → Report controller: dispatches
- Product controller → Product model: reads and writes
- Order controller → Order model: reads and writes
- Order controller → Product model: adjusts stock
- Supplier controller → Supplier model: reads and writes
- Product controller → Dashboard model: logs activity
- Order controller → Dashboard model: logs activity
- Supplier controller → Dashboard model: logs activity
- Dashboard controller → Dashboard model: queries analytics
- Report controller → Report model: queries and records
- Report controller → Dashboard model: logs activity
- Product model → Database connection: queries
- Order model → Database connection: queries
- Supplier model → Database connection: queries
- Dashboard model → Database connection: queries
- Report model → Database connection: queries
- Database connection → PostgreSQL: connects