How ahmed-dev-reda/inventory-management works
Inventory Management is a browser-based dashboard for maintaining products and stock, recording sales, and reviewing sales and inventory summaries. The user enters through the routed app, then manages products or records a sale; dashboard and sales views present operational results. Product and sales state are exposed through context hooks, while excerpts show sales and some reporting components reading browser local storage. The README advertises Supabase, but the sampled evidence does not establish a Supabase runtime integration; unsampled implementation details and links are omitted.
Main entry points: App.tsx Routed app · Dashboard.tsx Dashboard · useProducts.ts Product hook · SellProduct.tsx Sale entry
Components 25
Application shell
- Routed app
src/App.tsx - Navigation
src/components/Sidebar.tsx - Header controls
src/components/Header.tsx - Theme settings
src/components/Settings.tsx - Dashboard
src/pages/Dashboard.tsx
Product and stock
- Product search
src/pages/Products.tsx - Product dialog
src/components/AddProduct.tsx - Product editor
src/components/ProductForm.tsx - Product table
src/components/ProductsTable.tsx - Stock alerts
src/components/StockStatus.tsx
Sales operations
- Sale entry
src/components/SellProduct.tsx - Sales history
src/pages/Sales.tsx - Recent sales
src/components/RecentSales.tsx
State and reporting
- Summary cards
src/components/Cards.tsx - Sales trends
src/components/charts/SalesChart.tsx - Category chart
src/components/charts/Donut.tsx - Top sellers
src/components/charts/TopSalesChart.tsx - Product provider
src/context/ProductsProvider.tsx - Product state
src/context/ProductsContext.tsx - Product hook
src/hooks/useProducts.ts - Sales provider
src/context/SalesProvider.tsx - Sales state
src/context/SalesContext.tsx - Sales hook
src/hooks/useSales.tsx
Other components
- Operator
- Browser storage
Connections 33
- Operator → Routed app: uses
- Routed app → Navigation: renders
src/App.tsx - Routed app → Header controls: renders
src/App.tsx - Routed app → Theme settings: renders
src/App.tsx - Routed app → Product provider: wraps
src/App.tsx - Routed app → Sales provider: wraps
src/App.tsx - Routed app → Dashboard: routes to
src/App.tsx - Routed app → Product search: routes to
src/App.tsx - Routed app → Sales history: routes to
src/App.tsx - Routed app → Product dialog: renders
src/App.tsx - Routed app → Sale entry: renders
src/App.tsx - Dashboard → Summary cards: renders
src/pages/Dashboard.tsx - Dashboard → Sales trends: renders
src/pages/Dashboard.tsx - Dashboard → Category chart: renders
src/pages/Dashboard.tsx - Dashboard → Top sellers: renders
src/pages/Dashboard.tsx - Dashboard → Stock alerts: renders
src/pages/Dashboard.tsx - Dashboard → Recent sales: renders
src/pages/Dashboard.tsx - Product search → Product table: renders
src/pages/Products.tsx - Product search → Product hook: reads
src/pages/Products.tsx - Product dialog → Product editor: renders
src/components/AddProduct.tsx - Product editor → Product hook: reads
src/components/ProductForm.tsx - Product table → Product hook: reads
src/components/ProductsTable.tsx - Stock alerts → Product hook: reads
src/components/StockStatus.tsx - Sale entry → Product hook: reads
src/components/SellProduct.tsx - Sale entry → Sales hook: reads
src/components/SellProduct.tsx - Recent sales → Sales hook: reads
src/components/RecentSales.tsx - Product hook → Product state: consumes
src/hooks/useProducts.ts - Sales hook → Sales state: consumes
src/hooks/useSales.tsx - Sale entry → Product state: updates
src/components/SellProduct.tsx - Sale entry → Sales state: updates
src/components/SellProduct.tsx - Sales history → Browser storage: reads sales
src/pages/Sales.tsx - Sales trends → Browser storage: reads sales
src/components/charts/SalesChart.tsx - Product search → Product state: reads
src/pages/Products.tsx