# youssefgsamuel/karma-erp architecture

> Architecture diagram of the GitHub repository youssefgsamuel/karma-erp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/youssefgsamuel/karma-erp
- Repository: https://github.com/youssefgsamuel/karma-erp

## Overview

Karma-ERP is a browser-based ERP application. Users enter through the routed app, authenticate or await approval, then work in domain areas including sales, quotations, inventory, manufacturing, purchasing, finance, HR, and reporting. The main runtime is a React frontend backed by Supabase; the available excerpts show the client setup but do not establish most domain pages’ data-access relationships, so those links are omitted. The README gives only the product name, so capability coverage is based on the source index and routed pages.

Main entry points: [`karma-erp-5ff8d356-main/src/App.tsx`](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/App.tsx) (Application router), [`karma-erp-5ff8d356-main/src/pages/BOM.tsx`](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/BOM.tsx) (Bill of materials), [`karma-erp-5ff8d356-main/src/pages/Auth.tsx`](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Auth.tsx) (Sign-in and approval), [`karma-erp-5ff8d356-main/src/pages/Products.tsx`](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Products.tsx) (Products)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application access"]
  node_runtime["Application router<br/>[App.tsx]"]
  node_auth["Sign-in and approval<br/>[Auth.tsx]"]
  node_authctx["Authentication context<br/>[AuthContext.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
end

subgraph group_sales["Customer and sales"]
  node_customers["Customer management<br/>[Customers.tsx]"]
  node_quotations["Quotations<br/>[Quotations.tsx]"]
  node_salesorders["Sales orders<br/>[Sales.tsx]"]
end

subgraph group_operations["Products and operations"]
  node_products["Products<br/>[Products.tsx]"]
  node_rawmaterials["Raw materials<br/>[RawMaterials.tsx]"]
  node_bom["Bill of materials<br/>[BOM.tsx]"]
  node_inventory["Inventory<br/>[Inventory.tsx]"]
  node_manufacturing["Manufacturing<br/>[Manufacturing.tsx]"]
  node_quality["Quality control<br/>[QualityControl.tsx]"]
  node_purchasing["Purchase orders<br/>[PurchaseOrders.tsx]"]
  node_suppliers["Suppliers<br/>[Suppliers.tsx]"]
end

subgraph group_finance["Finance and people"]
  node_finance["Finance<br/>[Finance.tsx]"]
  node_branchfinance["Branch finance<br/>[BranchFinance.tsx]"]
  node_hr["HR<br/>[HR.tsx]"]
  node_salaries["Salaries<br/>[Salaries.tsx]"]
  node_reports["Reports<br/>[Reports.tsx]"]
  node_audit["Audit logs<br/>[AuditLogs.tsx]"]
end

subgraph group_platform["Data platform"]
  node_supabase["Supabase client<br/>[client.ts]"]
end

node_user(("ERP user"))

node_user -.->|"opens"| node_runtime
node_runtime -->|"routes to"| node_auth
node_runtime -->|"routes to"| node_dashboard
node_runtime -->|"routes to"| node_customers
node_runtime -->|"routes to"| node_quotations
node_runtime -->|"routes to"| node_salesorders
node_runtime -->|"routes to"| node_products
node_runtime -->|"routes to"| node_rawmaterials
node_runtime -->|"routes to"| node_bom
node_runtime -->|"routes to"| node_inventory
node_runtime -->|"routes to"| node_manufacturing
node_runtime -->|"routes to"| node_quality
node_runtime -->|"routes to"| node_purchasing
node_runtime -->|"routes to"| node_suppliers
node_runtime -->|"routes to"| node_finance
node_runtime -->|"routes to"| node_branchfinance
node_runtime -->|"routes to"| node_hr
node_runtime -->|"routes to"| node_salaries
node_runtime -->|"routes to"| node_reports
node_runtime -->|"routes to"| node_audit
node_auth -->|"uses"| node_authctx
node_bom -->|"reads materials"| node_rawmaterials
node_bom -->|"reads products"| node_products

click node_runtime "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/App.tsx"
click node_auth "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Auth.tsx"
click node_authctx "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/contexts/AuthContext.tsx"
click node_dashboard "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Dashboard.tsx"
click node_customers "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Customers.tsx"
click node_quotations "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Quotations.tsx"
click node_salesorders "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Sales.tsx"
click node_products "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Products.tsx"
click node_rawmaterials "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/RawMaterials.tsx"
click node_bom "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/BOM.tsx"
click node_inventory "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Inventory.tsx"
click node_manufacturing "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Manufacturing.tsx"
click node_quality "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/QualityControl.tsx"
click node_purchasing "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/PurchaseOrders.tsx"
click node_suppliers "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Suppliers.tsx"
click node_finance "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Finance.tsx"
click node_branchfinance "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/BranchFinance.tsx"
click node_hr "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/HR.tsx"
click node_salaries "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Salaries.tsx"
click node_reports "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Reports.tsx"
click node_audit "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/AuditLogs.tsx"
click node_supabase "https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/integrations/supabase/client.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_runtime,node_auth,node_authctx,node_dashboard,node_user toneBlue
class node_customers,node_quotations,node_salesorders toneAmber
class node_products,node_rawmaterials,node_bom,node_inventory,node_manufacturing,node_quality,node_purchasing,node_suppliers toneMint
class node_finance,node_branchfinance,node_hr,node_salaries,node_reports,node_audit toneRose
class node_supabase toneIndigo
```

## Components

### Application access

- [Application router](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/App.tsx): `karma-erp-5ff8d356-main/src/App.tsx`
- [Sign-in and approval](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Auth.tsx): `karma-erp-5ff8d356-main/src/pages/Auth.tsx`
- [Authentication context](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/contexts/AuthContext.tsx): `karma-erp-5ff8d356-main/src/contexts/AuthContext.tsx`
- [Dashboard](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Dashboard.tsx): `karma-erp-5ff8d356-main/src/pages/Dashboard.tsx`

### Customer and sales

- [Customer management](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Customers.tsx): `karma-erp-5ff8d356-main/src/pages/Customers.tsx`
- [Quotations](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Quotations.tsx): `karma-erp-5ff8d356-main/src/pages/Quotations.tsx`
- [Sales orders](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Sales.tsx): `karma-erp-5ff8d356-main/src/pages/Sales.tsx`

### Products and operations

- [Products](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Products.tsx): `karma-erp-5ff8d356-main/src/pages/Products.tsx`
- [Raw materials](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/RawMaterials.tsx): `karma-erp-5ff8d356-main/src/pages/RawMaterials.tsx`
- [Bill of materials](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/BOM.tsx): `karma-erp-5ff8d356-main/src/pages/BOM.tsx`
- [Inventory](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Inventory.tsx): `karma-erp-5ff8d356-main/src/pages/Inventory.tsx`
- [Manufacturing](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Manufacturing.tsx): `karma-erp-5ff8d356-main/src/pages/Manufacturing.tsx`
- [Quality control](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/QualityControl.tsx): `karma-erp-5ff8d356-main/src/pages/QualityControl.tsx`
- [Purchase orders](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/PurchaseOrders.tsx): `karma-erp-5ff8d356-main/src/pages/PurchaseOrders.tsx`
- [Suppliers](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Suppliers.tsx): `karma-erp-5ff8d356-main/src/pages/Suppliers.tsx`

### Finance and people

- [Finance](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Finance.tsx): `karma-erp-5ff8d356-main/src/pages/Finance.tsx`
- [Branch finance](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/BranchFinance.tsx): `karma-erp-5ff8d356-main/src/pages/BranchFinance.tsx`
- [HR](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/HR.tsx): `karma-erp-5ff8d356-main/src/pages/HR.tsx`
- [Salaries](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Salaries.tsx): `karma-erp-5ff8d356-main/src/pages/Salaries.tsx`
- [Reports](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/Reports.tsx): `karma-erp-5ff8d356-main/src/pages/Reports.tsx`
- [Audit logs](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/pages/AuditLogs.tsx): `karma-erp-5ff8d356-main/src/pages/AuditLogs.tsx`

### Data platform

- [Supabase client](https://github.com/youssefgsamuel/karma-erp/blob/main/karma-erp-5ff8d356-main/src/integrations/supabase/client.ts): `karma-erp-5ff8d356-main/src/integrations/supabase/client.ts`

### Other components

- **ERP user**

## Connections

- ERP user → Application router: opens
- Application router → Sign-in and approval: routes to (evidence: `karma-erp-5ff8d356-main/src/App.tsx`)
- Application router → Dashboard: routes to (evidence: `karma-erp-5ff8d356-main/src/App.tsx`)
- Application router → Customer management: routes to (evidence: `karma-erp-5ff8d356-main/src/App.tsx`)
- Application router → Quotations: routes to (evidence: `karma-erp-5ff8d356-main/src/App.tsx`)
- Application router → Sales orders: routes to (evidence: `karma-erp-5ff8d356-main/src/App.tsx`)
- Application router → Products: routes to (evidence: `karma-erp-5ff8d356-main/src/App.tsx`)
- Application router → Raw materials: routes to (evidence: `karma-erp-5ff8d356-main/src/App.tsx`)
- Application router → Bill of materials: routes to (evidence: `karma-erp-5ff8d356-main/src/App.tsx`)
- Application router → Inventory: routes to (evidence: `karma-erp-5ff8d356-main/src/App.tsx`)
- Application router → Manufacturing: routes to (evidence: `karma-erp-5ff8d356-main/src/App.tsx`)
- Application router → Quality control: routes to (evidence: `karma-erp-5ff8d356-main/src/App.tsx`)
- Application router → Purchase orders: routes to (evidence: `karma-erp-5ff8d356-main/src/App.tsx`)
- Application router → Suppliers: routes to (evidence: `karma-erp-5ff8d356-main/src/App.tsx`)
- Application router → Finance: routes to (evidence: `karma-erp-5ff8d356-main/src/App.tsx`)
- Application router → Branch finance: routes to (evidence: `karma-erp-5ff8d356-main/src/App.tsx`)
- Application router → HR: routes to (evidence: `karma-erp-5ff8d356-main/src/App.tsx`)
- Application router → Salaries: routes to (evidence: `karma-erp-5ff8d356-main/src/App.tsx`)
- Application router → Reports: routes to (evidence: `karma-erp-5ff8d356-main/src/App.tsx`)
- Application router → Audit logs: routes to (evidence: `karma-erp-5ff8d356-main/src/App.tsx`)
- Sign-in and approval → Authentication context: uses (evidence: `karma-erp-5ff8d356-main/src/pages/Auth.tsx`)
- Bill of materials → Raw materials: reads materials (evidence: `karma-erp-5ff8d356-main/src/pages/BOM.tsx`)
- Bill of materials → Products: reads products (evidence: `karma-erp-5ff8d356-main/src/pages/BOM.tsx`)
