# juvelasquez-dev/eclipse-inventory-system architecture

> Architecture diagram of the GitHub repository juvelasquez-dev/eclipse-inventory-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/juvelasquez-dev/eclipse-inventory-system
- Repository: https://github.com/juvelasquez-dev/eclipse-inventory-system

## Overview

This is a React inventory-management application with inventory, point-of-sale, outlet-management, IAO order, and administration areas. The main evidenced workflow is staff using POS to browse products and stock, assemble a cart, and submit a transaction through Supabase; inventory state and outlet data are provided by the shared context. The graph also preserves the other route-based product areas. The README is Vite template material, and unsampled page internals are represented only by their routes and names.

Main entry points: [`src/App.tsx`](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/App.tsx) (Route application), [`src/pages/POS/POS.tsx`](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/POS/POS.tsx) (Point of sale), [`src/context/InventoryContext.tsx`](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/context/InventoryContext.tsx) (Inventory context), [`src/lib/supabase.ts`](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/lib/supabase.ts) (Supabase)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and shell"]
  node_app["Route application<br/>[App.tsx]"]
  node_login["Login<br/>[Login.tsx]"]
  node_guards["Route guards<br/>[ProtectedRoute.tsx]"]
  node_layout["Module layout<br/>[MainLayout.tsx]"]
  node_system["System selection<br/>[System.tsx]"]
  node_admin["Administration<br/>[Admin.tsx]"]
  node_users["User management<br/>[UserManagement.tsx]"]
  node_audit["Audit logs<br/>[AuditLogs.tsx]"]
end

subgraph group_inventory["Inventory operations"]
  node_dashboard["Inventory dashboard<br/>[Dashboard.tsx]"]
  node_products["Product catalog<br/>[Products.tsx]"]
  node_stockin["Stock in<br/>[StockIn.tsx]"]
  node_stockout["Stock out<br/>[StockOut.tsx]"]
  node_inventoryview["Inventory view<br/>[Inventory.tsx]"]
  node_adjust["Stock adjustment"]
  node_history["Transaction history<br/>[History.tsx]"]
end

subgraph group_commerce["Sales and outlets"]
  node_pos["Point of sale<br/>[POS.tsx]"]
  node_poshistory["POS history<br/>[POSHistory.tsx]"]
  node_outlets["Outlet management<br/>[Outlets.tsx]"]
  node_outletdash["Outlet dashboard<br/>[Dashboard.tsx]"]
  node_reports["Outlet reports<br/>[Reports.tsx]"]
  node_iaoorders["IAO orders"]
  node_iaohistory["IAO order history"]
end

subgraph group_data["Shared data"]
  node_state["Inventory context"]
  node_inventorycalc["Stock calculation<br/>[inventory.ts]"]
  node_inventoryhook["Inventory helpers<br/>[useInventory.ts]"]
  node_supabase["Supabase<br/>[supabase.ts]"]
end

node_user(("Staff / admin"))
node_backend[("Supabase service")]

node_user -->|"uses"| node_app
node_app -->|"routes"| node_login
node_app -->|"protects routes"| node_guards
node_app -->|"routes"| node_system
node_app -->|"routes"| node_admin
node_app -->|"routes"| node_users
node_app -->|"routes"| node_audit
node_app -->|"routes"| node_iaoorders
node_app -->|"routes"| node_iaohistory
node_app -->|"wraps modules"| node_layout
node_app -->|"routes"| node_dashboard
node_app -->|"routes"| node_products
node_app -->|"routes"| node_stockin
node_app -->|"routes"| node_stockout
node_app -->|"routes"| node_inventoryview
node_app -->|"routes"| node_adjust
node_app -->|"routes"| node_history
node_app -->|"routes"| node_pos
node_app -->|"routes"| node_poshistory
node_app -->|"routes"| node_outlets
node_app -->|"routes"| node_outletdash
node_app -->|"routes"| node_reports
node_pos -->|"reads shared data"| node_inventoryhook
node_inventoryhook -->|"reads state"| node_state
node_state -->|"derives stock"| node_inventorycalc
node_state -->|"queries and writes"| node_supabase
node_pos -->|"creates POS transaction"| node_supabase
node_supabase -->|"calls"| node_backend

click node_app "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/App.tsx"
click node_login "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Login/Login.tsx"
click node_guards "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/components/auth/ProtectedRoute.tsx"
click node_layout "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/components/layout/MainLayout.tsx"
click node_system "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/System/System.tsx"
click node_admin "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Admin/Admin.tsx"
click node_users "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Admin/UserManagement.tsx"
click node_audit "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Admin/AuditLogs.tsx"
click node_dashboard "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Inventory/Dashboard.tsx"
click node_products "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Inventory/Products.tsx"
click node_stockin "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Inventory/StockIn.tsx"
click node_stockout "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Inventory/StockOut.tsx"
click node_inventoryview "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Inventory/Inventory.tsx"
click node_adjust "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Inventory/StockAdjustment.tsx"
click node_history "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Inventory/History.tsx"
click node_pos "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/POS/POS.tsx"
click node_poshistory "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/POS/POSHistory.tsx"
click node_outlets "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Outlets/Outlets.tsx"
click node_outletdash "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Outlets/Dashboard.tsx"
click node_reports "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Outlets/Reports.tsx"
click node_iaoorders "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/IAOOutletOrders/IAOOutletOrders.tsx"
click node_iaohistory "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/IAOOutletHistory/IAOOutletHistory.tsx"
click node_state "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/context/InventoryContext.tsx"
click node_inventorycalc "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/utils/inventory.ts"
click node_inventoryhook "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/hooks/useInventory.ts"
click node_supabase "https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/lib/supabase.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_login,node_guards,node_layout,node_system,node_admin,node_users,node_audit toneBlue
class node_dashboard,node_products,node_stockin,node_stockout,node_inventoryview,node_adjust,node_history,node_backend toneAmber
class node_pos,node_poshistory,node_outlets,node_outletdash,node_reports,node_iaoorders,node_iaohistory toneMint
class node_state,node_inventorycalc,node_inventoryhook,node_supabase toneRose
class node_user toneIndigo
```

## Components

### Access and shell

- [Route application](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/App.tsx): `src/App.tsx`
- [Login](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Login/Login.tsx): `src/pages/Login/Login.tsx`
- [Route guards](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/components/auth/ProtectedRoute.tsx): `src/components/auth/ProtectedRoute.tsx`
- [Module layout](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/components/layout/MainLayout.tsx): `src/components/layout/MainLayout.tsx`
- [System selection](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/System/System.tsx): `src/pages/System/System.tsx`
- [Administration](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Admin/Admin.tsx): `src/pages/Admin/Admin.tsx`
- [User management](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Admin/UserManagement.tsx): `src/pages/Admin/UserManagement.tsx`
- [Audit logs](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Admin/AuditLogs.tsx): `src/pages/Admin/AuditLogs.tsx`

### Inventory operations

- [Inventory dashboard](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Inventory/Dashboard.tsx): `src/pages/Inventory/Dashboard.tsx`
- [Product catalog](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Inventory/Products.tsx): `src/pages/Inventory/Products.tsx`
- [Stock in](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Inventory/StockIn.tsx): `src/pages/Inventory/StockIn.tsx`
- [Stock out](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Inventory/StockOut.tsx): `src/pages/Inventory/StockOut.tsx`
- [Inventory view](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Inventory/Inventory.tsx): `src/pages/Inventory/Inventory.tsx`
- [Stock adjustment](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Inventory/StockAdjustment.tsx): `src/pages/Inventory/StockAdjustment.tsx`
- [Transaction history](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Inventory/History.tsx): `src/pages/Inventory/History.tsx`

### Sales and outlets

- [Point of sale](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/POS/POS.tsx): `src/pages/POS/POS.tsx`
- [POS history](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/POS/POSHistory.tsx): `src/pages/POS/POSHistory.tsx`
- [Outlet management](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Outlets/Outlets.tsx): `src/pages/Outlets/Outlets.tsx`
- [Outlet dashboard](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Outlets/Dashboard.tsx): `src/pages/Outlets/Dashboard.tsx`
- [Outlet reports](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/Outlets/Reports.tsx): `src/pages/Outlets/Reports.tsx`
- [IAO orders](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/IAOOutletOrders/IAOOutletOrders.tsx): `src/pages/IAOOutletOrders/IAOOutletOrders.tsx`
- [IAO order history](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/pages/IAOOutletHistory/IAOOutletHistory.tsx): `src/pages/IAOOutletHistory/IAOOutletHistory.tsx`

### Shared data

- [Inventory context](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/context/InventoryContext.tsx): `src/context/InventoryContext.tsx`
- [Stock calculation](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/utils/inventory.ts): `src/utils/inventory.ts`
- [Inventory helpers](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/hooks/useInventory.ts): `src/hooks/useInventory.ts`
- [Supabase](https://github.com/juvelasquez-dev/eclipse-inventory-system/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`

### Other components

- **Staff / admin**
- **Supabase service**

## Connections

- Staff / admin → Route application: uses
- Route application → Login: routes
- Route application → Route guards: protects routes
- Route application → System selection: routes
- Route application → Administration: routes
- Route application → User management: routes
- Route application → Audit logs: routes
- Route application → IAO orders: routes
- Route application → IAO order history: routes
- Route application → Module layout: wraps modules
- Route application → Inventory dashboard: routes
- Route application → Product catalog: routes
- Route application → Stock in: routes
- Route application → Stock out: routes
- Route application → Inventory view: routes
- Route application → Stock adjustment: routes
- Route application → Transaction history: routes
- Route application → Point of sale: routes
- Route application → POS history: routes
- Route application → Outlet management: routes
- Route application → Outlet dashboard: routes
- Route application → Outlet reports: routes
- Point of sale → Inventory helpers: reads shared data
- Inventory helpers → Inventory context: reads state
- Inventory context → Stock calculation: derives stock
- Inventory context → Supabase: queries and writes
- Point of sale → Supabase: creates POS transaction
- Supabase → Supabase service: calls
