How layvanntha-glitch/inventory-management works
This is a React/Laravel sales and inventory system. Staff authenticate, then use the frontend’s routed screens to manage stock, contacts, purchases, sales, refunds, shifts, and settings; the API persists business records and supplies dashboard and reporting results. The graph preserves the documented capabilities, but several page implementations and controllers were not sampled, so some frontend/API links rely on README documentation rather than inspected calls.
Main entry points: App.jsx App routing · api.php API routes · ReportController.php Reports and dashboard · PayWayController.php PayWay checkout
Components 34
Frontend application
- App routing
frontend/src/App.jsx - Authentication
frontend/src/context/AuthContext.jsx - Sales screens
frontend/src/pages/Sales.jsx - POS screen
frontend/src/pages/POS.jsx - Purchases screen
frontend/src/pages/Purchases.jsx - Items screen
frontend/src/pages/Items.jsx - Contacts screen
frontend/src/pages/Contacts.jsx - Refunds screen
frontend/src/pages/Refunds.jsx - Shift screen
frontend/src/pages/Shift.jsx - Reports screen
frontend/src/pages/Reports.jsx - Dashboard screen
frontend/src/pages/Dashboard.jsx - Settings screen
frontend/src/pages/Settings.jsx - User management
frontend/src/pages/Users.jsx - API client
frontend/src/services/api.js
Inventory and transactions
- Contact controller
backend/app/Http/Controllers/ContactController.php - Item controller
backend/app/Http/Controllers/ItemController.php - Purchase controller
backend/app/Http/Controllers/PurchaseController.php - Sale controller
backend/app/Http/Controllers/SaleController.php - Refund controller
backend/app/Http/Controllers/RefundController.php - PayWay checkout
backend/app/Http/Controllers/PayWayController.php - PayWay gateway service
backend/app/Services/PayWayService.php - Item inventory model
backend/app/Models/Item.php - Sale record
backend/app/Models/Sale.php - Sale line items
backend/app/Models/SaleItem.php - Purchase record
backend/app/Models/Purchase.php - Purchase line items
backend/app/Models/PurchaseItem.php
Operations and insights
- Reports and dashboard
backend/app/Http/Controllers/ReportController.php - Settings controller
backend/app/Http/Controllers/SettingController.php - Shift controller
backend/app/Http/Controllers/ShiftController.php - User controller
backend/app/Http/Controllers/UserController.php
API and persistence
- API routes
backend/routes/api.php - Auth controller
backend/app/Http/Controllers/AuthController.php - Business records
backend/app/Models
Other components
- Staff user
Connections 43
- Staff user → App routing: uses
frontend/src/App.jsx - App routing → Authentication: provides auth
frontend/src/App.jsx - App routing → Sales screens: routes to
frontend/src/App.jsx - App routing → POS screen: routes to
frontend/src/App.jsx - App routing → Purchases screen: routes to
frontend/src/App.jsx - App routing → Items screen: routes to
frontend/src/App.jsx - App routing → Contacts screen: routes to
frontend/src/App.jsx - App routing → Refunds screen: routes to
frontend/src/App.jsx - App routing → Shift screen: routes to
frontend/src/App.jsx - App routing → Reports screen: routes to
frontend/src/App.jsx - App routing → Dashboard screen: routes to
frontend/src/App.jsx - App routing → Settings screen: routes to
frontend/src/App.jsx - App routing → User management: routes to
frontend/src/App.jsx - POS screen → API client: requests
frontend/src/pages/POS.jsx - Sales screens → API client: requests
frontend/src/pages/Sales.jsx - API client → API routes: calls REST API
README.md - API routes → Auth controller: routes auth
backend/routes/api.php - API routes → Contact controller: routes contacts
backend/routes/api.php - API routes → Item controller: routes items
backend/routes/api.php - API routes → Purchase controller: routes purchases
backend/routes/api.php - API routes → Sale controller: routes sales
backend/routes/api.php - API routes → Refund controller: routes refunds
backend/routes/api.php - API routes → PayWay checkout: routes payments
backend/routes/api.php - API routes → Reports and dashboard: routes reports
backend/routes/api.php - API routes → Settings controller: routes settings
backend/routes/api.php - API routes → Shift controller: routes shifts
backend/routes/api.php - API routes → User controller: routes users
backend/routes/api.php - Purchase controller → Purchase record: creates purchases
backend/app/Http/Controllers/PurchaseController.php - Purchase controller → Purchase line items: creates lines
backend/app/Http/Controllers/PurchaseController.php - Purchase controller → Item inventory model: updates stock
backend/app/Http/Controllers/PurchaseController.php - Sale controller → Sale record: creates sales
backend/app/Http/Controllers/SaleController.php - Sale controller → Sale line items: creates lines
backend/app/Http/Controllers/SaleController.php - Sale controller → Item inventory model: checks stock
backend/app/Http/Controllers/SaleController.php - PayWay checkout → PayWay gateway service: checks payment
backend/app/Http/Controllers/PayWayController.php - PayWay checkout → Sale record: finalizes sale
backend/app/Http/Controllers/PayWayController.php - PayWay checkout → Sale line items: creates lines
backend/app/Http/Controllers/PayWayController.php - PayWay checkout → Item inventory model: decrements stock
backend/app/Http/Controllers/PayWayController.php - Reports and dashboard → Sale record: queries sales
backend/app/Http/Controllers/ReportController.php - Reports and dashboard → Sale line items: aggregates sales
backend/app/Http/Controllers/ReportController.php - Reports and dashboard → Purchase record: queries purchases
backend/app/Http/Controllers/ReportController.php - Reports and dashboard → Purchase line items: aggregates purchases
backend/app/Http/Controllers/ReportController.php - Reports and dashboard → Item inventory model: values stock
backend/app/Http/Controllers/ReportController.php - API routes → Business records: serves records