# mominsalam114768/smarterp architecture

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

- Interactive diagram: https://gitdiagram.com/mominsalam114768/smarterp
- Repository: https://github.com/mominsalam114768/smarterp

## Overview

This is a Bengali-language small-business ERP/POS. Users sign in, work through inventory and customer records, create sales and due-payment requests, and use management views for approvals, accounting, reporting, and messaging. The sampled code shows App routing to these capabilities, the API persisting operational data through Firebase, and settings offering Google Sheets and Drive backup integrations. Several feature components are indexed but not excerpted, so their internal calls and any backend integration are not inferred.

Main entry points: [`src/App.tsx`](https://github.com/mominsalam114768/smarterp/blob/main/src/App.tsx) (App shell and access), [`src/services/api.ts`](https://github.com/mominsalam114768/smarterp/blob/main/src/services/api.ts) (ERP data API), [`src/components/POS.tsx`](https://github.com/mominsalam114768/smarterp/blob/main/src/components/POS.tsx) (Point of sale), [`src/components/Settings.tsx`](https://github.com/mominsalam114768/smarterp/blob/main/src/components/Settings.tsx) (Business settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_app["App shell and access<br/>[App.tsx]"]
end

subgraph group_operations["Sales and Records"]
  node_pos["Point of sale<br/>[POS.tsx]"]
  node_scanner["Barcode scanning<br/>[BarcodeScanner.tsx]"]
  node_products["Product inventory<br/>[ProductList.tsx]"]
  node_customers["Customer records<br/>[CustomerList.tsx]"]
  node_sales["Sales records<br/>[SalesList.tsx]"]
  node_suppliers["Supplier records<br/>[SupplierList.tsx]"]
end

subgraph group_management["Management"]
  node_approvals["Approval management"]
  node_dues["Due management<br/>[DueManagement.tsx]"]
  node_accounting["Accounting<br/>[Accounting.tsx]"]
  node_reports["Reports and dashboard<br/>[Reports.tsx]"]
  node_sms["SMS messaging<br/>[SMSModule.tsx]"]
  node_users["User management<br/>[UserManagement.tsx]"]
  node_settings["Business settings<br/>[Settings.tsx]"]
end

subgraph group_integrations["Integrations and Data"]
  node_api["ERP data API<br/>[api.ts]"]
  node_firebase["Firebase services<br/>[firebase.ts]"]
  node_firestore[("Cloud Firestore")]
  node_printing["Print utilities<br/>[printUtils.ts]"]
  node_sheets["Sheets synchronization<br/>[sheetsSync.ts]"]
  node_drive["Drive backup<br/>[drive.ts]"]
  node_excel["Excel export<br/>[excelExport.ts]"]
end

node_user(("Business user"))
node_apps_script["Google Apps Script<br/>[gasScriptCode.ts]"]
node_google_drive[("Google Drive")]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_pos
node_app -->|"routes to"| node_products
node_app -->|"routes to"| node_customers
node_app -->|"routes to"| node_sales
node_app -->|"routes to"| node_suppliers
node_app -->|"routes to"| node_approvals
node_app -->|"routes to"| node_dues
node_app -->|"routes to"| node_accounting
node_app -->|"routes to"| node_reports
node_app -->|"routes to"| node_sms
node_app -->|"routes to"| node_users
node_app -->|"routes to"| node_settings
node_pos -->|"opens scanner"| node_scanner
node_products -->|"opens scanner"| node_scanner
node_pos -->|"creates sales"| node_api
node_pos -->|"prints invoice"| node_printing
node_approvals -->|"processes requests"| node_api
node_approvals -->|"prints receipts"| node_printing
node_products -->|"manages products"| node_api
node_customers -->|"manages customers"| node_api
node_sales -->|"loads sales"| node_api
node_suppliers -->|"manages suppliers"| node_api
node_dues -->|"manages dues"| node_api
node_accounting -->|"loads records"| node_api
node_reports -->|"loads metrics"| node_api
node_sms -->|"uses data"| node_api
node_users -->|"manages users"| node_api
node_api -->|"reads and writes"| node_firebase
node_firebase -->|"persists data"| node_firestore
node_settings -->|"tests connection"| node_sheets
node_settings -->|"generates workbook"| node_excel
node_settings -->|"uploads backup"| node_drive
node_sheets -->|"stores config"| node_firebase
node_sheets -.->|"syncs data"| node_apps_script
node_drive -->|"stores account config"| node_firebase
node_drive -.->|"uploads files"| node_google_drive

click node_app "https://github.com/mominsalam114768/smarterp/blob/main/src/App.tsx"
click node_pos "https://github.com/mominsalam114768/smarterp/blob/main/src/components/POS.tsx"
click node_scanner "https://github.com/mominsalam114768/smarterp/blob/main/src/components/BarcodeScanner.tsx"
click node_products "https://github.com/mominsalam114768/smarterp/blob/main/src/components/ProductList.tsx"
click node_customers "https://github.com/mominsalam114768/smarterp/blob/main/src/components/CustomerList.tsx"
click node_sales "https://github.com/mominsalam114768/smarterp/blob/main/src/components/SalesList.tsx"
click node_suppliers "https://github.com/mominsalam114768/smarterp/blob/main/src/components/SupplierList.tsx"
click node_approvals "https://github.com/mominsalam114768/smarterp/blob/main/src/components/ApprovalManagement.tsx"
click node_dues "https://github.com/mominsalam114768/smarterp/blob/main/src/components/DueManagement.tsx"
click node_accounting "https://github.com/mominsalam114768/smarterp/blob/main/src/components/Accounting.tsx"
click node_reports "https://github.com/mominsalam114768/smarterp/blob/main/src/components/Reports.tsx"
click node_sms "https://github.com/mominsalam114768/smarterp/blob/main/src/components/SMSModule.tsx"
click node_users "https://github.com/mominsalam114768/smarterp/blob/main/src/components/UserManagement.tsx"
click node_settings "https://github.com/mominsalam114768/smarterp/blob/main/src/components/Settings.tsx"
click node_api "https://github.com/mominsalam114768/smarterp/blob/main/src/services/api.ts"
click node_firebase "https://github.com/mominsalam114768/smarterp/blob/main/src/lib/firebase.ts"
click node_printing "https://github.com/mominsalam114768/smarterp/blob/main/src/lib/printUtils.ts"
click node_sheets "https://github.com/mominsalam114768/smarterp/blob/main/src/lib/sheetsSync.ts"
click node_apps_script "https://github.com/mominsalam114768/smarterp/blob/main/src/lib/gasScriptCode.ts"
click node_drive "https://github.com/mominsalam114768/smarterp/blob/main/src/lib/drive.ts"
click node_excel "https://github.com/mominsalam114768/smarterp/blob/main/src/lib/excelExport.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_user toneBlue
class node_pos,node_scanner,node_products,node_customers,node_sales,node_suppliers,node_google_drive toneAmber
class node_approvals,node_dues,node_accounting,node_reports,node_sms,node_users,node_settings toneMint
class node_api,node_firebase,node_firestore,node_printing,node_sheets,node_drive,node_excel toneRose
class node_apps_script toneTeal
```

## Components

### Application

- [App shell and access](https://github.com/mominsalam114768/smarterp/blob/main/src/App.tsx): `src/App.tsx`

### Sales and Records

- [Point of sale](https://github.com/mominsalam114768/smarterp/blob/main/src/components/POS.tsx): `src/components/POS.tsx`
- [Barcode scanning](https://github.com/mominsalam114768/smarterp/blob/main/src/components/BarcodeScanner.tsx): `src/components/BarcodeScanner.tsx`
- [Product inventory](https://github.com/mominsalam114768/smarterp/blob/main/src/components/ProductList.tsx): `src/components/ProductList.tsx`
- [Customer records](https://github.com/mominsalam114768/smarterp/blob/main/src/components/CustomerList.tsx): `src/components/CustomerList.tsx`
- [Sales records](https://github.com/mominsalam114768/smarterp/blob/main/src/components/SalesList.tsx): `src/components/SalesList.tsx`
- [Supplier records](https://github.com/mominsalam114768/smarterp/blob/main/src/components/SupplierList.tsx): `src/components/SupplierList.tsx`

### Management

- [Approval management](https://github.com/mominsalam114768/smarterp/blob/main/src/components/ApprovalManagement.tsx): `src/components/ApprovalManagement.tsx`
- [Due management](https://github.com/mominsalam114768/smarterp/blob/main/src/components/DueManagement.tsx): `src/components/DueManagement.tsx`
- [Accounting](https://github.com/mominsalam114768/smarterp/blob/main/src/components/Accounting.tsx): `src/components/Accounting.tsx`
- [Reports and dashboard](https://github.com/mominsalam114768/smarterp/blob/main/src/components/Reports.tsx): `src/components/Reports.tsx`
- [SMS messaging](https://github.com/mominsalam114768/smarterp/blob/main/src/components/SMSModule.tsx): `src/components/SMSModule.tsx`
- [User management](https://github.com/mominsalam114768/smarterp/blob/main/src/components/UserManagement.tsx): `src/components/UserManagement.tsx`
- [Business settings](https://github.com/mominsalam114768/smarterp/blob/main/src/components/Settings.tsx): `src/components/Settings.tsx`

### Integrations and Data

- [ERP data API](https://github.com/mominsalam114768/smarterp/blob/main/src/services/api.ts): `src/services/api.ts`
- [Firebase services](https://github.com/mominsalam114768/smarterp/blob/main/src/lib/firebase.ts): `src/lib/firebase.ts`
- **Cloud Firestore**
- [Print utilities](https://github.com/mominsalam114768/smarterp/blob/main/src/lib/printUtils.ts): `src/lib/printUtils.ts`
- [Sheets synchronization](https://github.com/mominsalam114768/smarterp/blob/main/src/lib/sheetsSync.ts): `src/lib/sheetsSync.ts`
- [Drive backup](https://github.com/mominsalam114768/smarterp/blob/main/src/lib/drive.ts): `src/lib/drive.ts`
- [Excel export](https://github.com/mominsalam114768/smarterp/blob/main/src/lib/excelExport.ts): `src/lib/excelExport.ts`

### Other components

- **Business user**
- [Google Apps Script](https://github.com/mominsalam114768/smarterp/blob/main/src/lib/gasScriptCode.ts): `src/lib/gasScriptCode.ts`
- **Google Drive**

## Connections

- Business user → App shell and access: uses
- App shell and access → Point of sale: routes to (evidence: `src/App.tsx`)
- App shell and access → Product inventory: routes to (evidence: `src/App.tsx`)
- App shell and access → Customer records: routes to (evidence: `src/App.tsx`)
- App shell and access → Sales records: routes to (evidence: `src/App.tsx`)
- App shell and access → Supplier records: routes to (evidence: `src/App.tsx`)
- App shell and access → Approval management: routes to (evidence: `src/App.tsx`)
- App shell and access → Due management: routes to (evidence: `src/App.tsx`)
- App shell and access → Accounting: routes to (evidence: `src/App.tsx`)
- App shell and access → Reports and dashboard: routes to (evidence: `src/App.tsx`)
- App shell and access → SMS messaging: routes to (evidence: `src/App.tsx`)
- App shell and access → User management: routes to (evidence: `src/App.tsx`)
- App shell and access → Business settings: routes to (evidence: `src/App.tsx`)
- Point of sale → Barcode scanning: opens scanner (evidence: `src/components/POS.tsx`)
- Product inventory → Barcode scanning: opens scanner (evidence: `src/components/ProductList.tsx`)
- Point of sale → ERP data API: creates sales (evidence: `src/components/POS.tsx`)
- Point of sale → Print utilities: prints invoice (evidence: `src/components/POS.tsx`)
- Approval management → ERP data API: processes requests (evidence: `src/components/ApprovalManagement.tsx`)
- Approval management → Print utilities: prints receipts (evidence: `src/components/ApprovalManagement.tsx`)
- Product inventory → ERP data API: manages products (evidence: `src/services/api.ts`)
- Customer records → ERP data API: manages customers (evidence: `src/services/api.ts`)
- Sales records → ERP data API: loads sales (evidence: `src/services/api.ts`)
- Supplier records → ERP data API: manages suppliers (evidence: `src/services/api.ts`)
- Due management → ERP data API: manages dues (evidence: `src/services/api.ts`)
- Accounting → ERP data API: loads records (evidence: `src/services/api.ts`)
- Reports and dashboard → ERP data API: loads metrics (evidence: `src/services/api.ts`)
- SMS messaging → ERP data API: uses data (evidence: `src/services/api.ts`)
- User management → ERP data API: manages users (evidence: `src/services/api.ts`)
- ERP data API → Firebase services: reads and writes (evidence: `src/services/api.ts`)
- Firebase services → Cloud Firestore: persists data (evidence: `src/lib/firebase.ts`)
- Business settings → Sheets synchronization: tests connection (evidence: `src/components/Settings.tsx`)
- Business settings → Excel export: generates workbook (evidence: `src/components/Settings.tsx`)
- Business settings → Drive backup: uploads backup (evidence: `src/components/Settings.tsx`)
- Sheets synchronization → Firebase services: stores config (evidence: `src/lib/sheetsSync.ts`)
- Sheets synchronization → Google Apps Script: syncs data
- Drive backup → Firebase services: stores account config (evidence: `src/lib/drive.ts`)
- Drive backup → Google Drive: uploads files
