# abodmohammedam3/erp_q architecture

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

- Interactive diagram: https://gitdiagram.com/abodmohammedam3/erp_q
- Repository: https://github.com/abodmohammedam3/erp_q

## Overview

This is a Laravel-based inventory and accounting application, rather than the Laravel framework project described by its generic README. Users manage inventory and counterparties, record purchases and sales, and operate accounting records and cash/bank vouchers. The sampled controllers show these requests handled in the relevant domain controllers; invoice and voucher controllers delegate mutations to services, while opening balances can generate journal entries. The tree documents additional dashboards, returns, and master-data screens. Source excerpts are partial, so uncertain wiring among those capabilities is not drawn.

Main entry points: [`app/Models/Accounting/CharAccount.php`](https://github.com/abodmohammedam3/erp_q/blob/main/app/Models/Accounting/CharAccount.php) (Account records), [`config/database.php`](https://github.com/abodmohammedam3/erp_q/blob/main/config/database.php) (Application database), [`app/Http/Controllers/Operation/Sales/SalesInvoiceController.php`](https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/Operation/Sales/SalesInvoiceController.php) (Sales invoices), [`app/Http/Controllers/accounting/OpeningBalanceController.php`](https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/accounting/OpeningBalanceController.php) (Opening balances)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operations["Business operations"]
  node_sales["Sales invoices"]
  node_purchases["Purchase invoices"]
  node_receipts["Receipt vouchers"]
  node_payments["Payment vouchers"]
  node_customers["Customer records"]
  node_suppliers["Supplier records"]
  node_sales_service["Sales service"]
  node_purchase_service["Purchase service"]
end

subgraph group_inventory["Inventory management"]
  node_movement["Stock movements"]
  node_stock["Warehouses"]
  node_items["Inventory catalog<br/>[ItemController.php]"]
  node_inventory_service["Inventory service"]
end

subgraph group_accounting["Accounting"]
  node_chart["Chart of accounts"]
  node_opening["Opening balances"]
  node_journal_service["Journal service"]
  node_receipt_service["Receipt service"]
  node_payment_service["Payment service"]
end

subgraph group_data["Domain data"]
  node_sales_model["Sales records<br/>[SalesInvoice.php]"]
  node_purchase_model["Purchase records"]
  node_movement_model["Movement records"]
  node_account_model["Account records<br/>[CharAccount.php]"]
  node_opening_model["Opening balance records<br/>[openingBalance.php]"]
  node_database[("Application database<br/>[database.php]")]
end

node_user(("User"))

node_user -->|"submits invoice"| node_sales
node_user -->|"submits invoice"| node_purchases
node_user -->|"records receipt"| node_receipts
node_user -->|"records payment"| node_payments
node_user -->|"records movement"| node_movement
node_user -->|"manages warehouse"| node_stock
node_user -->|"manages catalog"| node_items
node_user -->|"manages customers"| node_customers
node_user -->|"manages suppliers"| node_suppliers
node_user -->|"maintains accounts"| node_chart
node_user -->|"enters balances"| node_opening
node_sales -->|"delegates mutations"| node_sales_service
node_sales -->|"requests last cost"| node_inventory_service
node_sales -->|"queries invoices"| node_sales_model
node_purchases -->|"delegates mutations"| node_purchase_service
node_purchases -->|"queries invoices"| node_purchase_model
node_receipts -->|"delegates deletion"| node_receipt_service
node_payments -->|"delegates deletion"| node_payment_service
node_movement -->|"queries movements"| node_movement_model
node_opening -->|"deletes journal entries"| node_journal_service
node_opening -->|"writes balances"| node_opening_model
node_customers -->|"links accounts"| node_account_model
node_suppliers -->|"links accounts"| node_account_model
node_stock -->|"links accounts"| node_account_model
node_chart -->|"manages accounts"| node_account_model
node_opening -->|"reads accounts"| node_account_model
node_sales_model -->|"persists records"| node_database
node_purchase_model -->|"persists records"| node_database
node_movement_model -->|"persists records"| node_database
node_account_model -->|"persists records"| node_database
node_opening_model -->|"persists records"| node_database

click node_sales "https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/Operation/Sales/SalesInvoiceController.php"
click node_purchases "https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/Operation/Purchases/PurchaseInvoiceController.php"
click node_receipts "https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/Operation/ReceiptVoucher/ReceiptVoucherController.php"
click node_payments "https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/Operation/PaymentVoucher/PaymentVoucherController.php"
click node_customers "https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/CustomerController.php"
click node_suppliers "https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/SupplierController.php"
click node_movement "https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/Operation/Movements/InventoryMovementController.php"
click node_stock "https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/Inventory/StockController.php"
click node_items "https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/Inventory/ItemController.php"
click node_inventory_service "https://github.com/abodmohammedam3/erp_q/blob/main/app/Services/Inventory/InventoryService.php"
click node_chart "https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/accounting/CharAccountController.php"
click node_opening "https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/accounting/OpeningBalanceController.php"
click node_journal_service "https://github.com/abodmohammedam3/erp_q/blob/main/app/Services/JournalEntryService.php"
click node_sales_service "https://github.com/abodmohammedam3/erp_q/blob/main/app/Services/Sales/SalesInvoiceService.php"
click node_purchase_service "https://github.com/abodmohammedam3/erp_q/blob/main/app/Services/Purchases/PurchaseInvoiceService.php"
click node_receipt_service "https://github.com/abodmohammedam3/erp_q/blob/main/app/Services/ReceiptVoucherService.php"
click node_payment_service "https://github.com/abodmohammedam3/erp_q/blob/main/app/Services/PaymentVoucherService.php"
click node_sales_model "https://github.com/abodmohammedam3/erp_q/blob/main/app/Models/Sales/SalesInvoice.php"
click node_purchase_model "https://github.com/abodmohammedam3/erp_q/blob/main/app/Models/Purchases/PurchaseInvoice.php"
click node_movement_model "https://github.com/abodmohammedam3/erp_q/blob/main/app/Models/Inventory/InventoryMovement.php"
click node_account_model "https://github.com/abodmohammedam3/erp_q/blob/main/app/Models/Accounting/CharAccount.php"
click node_opening_model "https://github.com/abodmohammedam3/erp_q/blob/main/app/Models/Accounting/openingBalance.php"
click node_database "https://github.com/abodmohammedam3/erp_q/blob/main/config/database.php"

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_sales,node_purchases,node_receipts,node_payments,node_customers,node_suppliers,node_sales_service,node_purchase_service,node_user toneBlue
class node_movement,node_stock,node_items,node_inventory_service toneAmber
class node_chart,node_opening,node_journal_service,node_receipt_service,node_payment_service toneMint
class node_sales_model,node_purchase_model,node_movement_model,node_account_model,node_opening_model,node_database toneRose
```

## Components

### Business operations

- [Sales invoices](https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/Operation/Sales/SalesInvoiceController.php): `app/Http/Controllers/Operation/Sales/SalesInvoiceController.php`
- [Purchase invoices](https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/Operation/Purchases/PurchaseInvoiceController.php): `app/Http/Controllers/Operation/Purchases/PurchaseInvoiceController.php`
- [Receipt vouchers](https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/Operation/ReceiptVoucher/ReceiptVoucherController.php): `app/Http/Controllers/Operation/ReceiptVoucher/ReceiptVoucherController.php`
- [Payment vouchers](https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/Operation/PaymentVoucher/PaymentVoucherController.php): `app/Http/Controllers/Operation/PaymentVoucher/PaymentVoucherController.php`
- [Customer records](https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/CustomerController.php): `app/Http/Controllers/CustomerController.php`
- [Supplier records](https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/SupplierController.php): `app/Http/Controllers/SupplierController.php`
- [Sales service](https://github.com/abodmohammedam3/erp_q/blob/main/app/Services/Sales/SalesInvoiceService.php): `app/Services/Sales/SalesInvoiceService.php`
- [Purchase service](https://github.com/abodmohammedam3/erp_q/blob/main/app/Services/Purchases/PurchaseInvoiceService.php): `app/Services/Purchases/PurchaseInvoiceService.php`

### Inventory management

- [Stock movements](https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/Operation/Movements/InventoryMovementController.php): `app/Http/Controllers/Operation/Movements/InventoryMovementController.php`
- [Warehouses](https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/Inventory/StockController.php): `app/Http/Controllers/Inventory/StockController.php`
- [Inventory catalog](https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/Inventory/ItemController.php): `app/Http/Controllers/Inventory/ItemController.php`
- [Inventory service](https://github.com/abodmohammedam3/erp_q/blob/main/app/Services/Inventory/InventoryService.php): `app/Services/Inventory/InventoryService.php`

### Accounting

- [Chart of accounts](https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/accounting/CharAccountController.php): `app/Http/Controllers/accounting/CharAccountController.php`
- [Opening balances](https://github.com/abodmohammedam3/erp_q/blob/main/app/Http/Controllers/accounting/OpeningBalanceController.php): `app/Http/Controllers/accounting/OpeningBalanceController.php`
- [Journal service](https://github.com/abodmohammedam3/erp_q/blob/main/app/Services/JournalEntryService.php): `app/Services/JournalEntryService.php`
- [Receipt service](https://github.com/abodmohammedam3/erp_q/blob/main/app/Services/ReceiptVoucherService.php): `app/Services/ReceiptVoucherService.php`
- [Payment service](https://github.com/abodmohammedam3/erp_q/blob/main/app/Services/PaymentVoucherService.php): `app/Services/PaymentVoucherService.php`

### Domain data

- [Sales records](https://github.com/abodmohammedam3/erp_q/blob/main/app/Models/Sales/SalesInvoice.php): `app/Models/Sales/SalesInvoice.php`
- [Purchase records](https://github.com/abodmohammedam3/erp_q/blob/main/app/Models/Purchases/PurchaseInvoice.php): `app/Models/Purchases/PurchaseInvoice.php`
- [Movement records](https://github.com/abodmohammedam3/erp_q/blob/main/app/Models/Inventory/InventoryMovement.php): `app/Models/Inventory/InventoryMovement.php`
- [Account records](https://github.com/abodmohammedam3/erp_q/blob/main/app/Models/Accounting/CharAccount.php): `app/Models/Accounting/CharAccount.php`
- [Opening balance records](https://github.com/abodmohammedam3/erp_q/blob/main/app/Models/Accounting/openingBalance.php): `app/Models/Accounting/openingBalance.php`
- [Application database](https://github.com/abodmohammedam3/erp_q/blob/main/config/database.php): `config/database.php`

### Other components

- **User**

## Connections

- User → Sales invoices: submits invoice
- User → Purchase invoices: submits invoice
- User → Receipt vouchers: records receipt
- User → Payment vouchers: records payment
- User → Stock movements: records movement
- User → Warehouses: manages warehouse
- User → Inventory catalog: manages catalog
- User → Customer records: manages customers
- User → Supplier records: manages suppliers
- User → Chart of accounts: maintains accounts
- User → Opening balances: enters balances
- Sales invoices → Sales service: delegates mutations
- Sales invoices → Inventory service: requests last cost
- Sales invoices → Sales records: queries invoices
- Purchase invoices → Purchase service: delegates mutations
- Purchase invoices → Purchase records: queries invoices
- Receipt vouchers → Receipt service: delegates deletion
- Payment vouchers → Payment service: delegates deletion
- Stock movements → Movement records: queries movements
- Opening balances → Journal service: deletes journal entries
- Opening balances → Opening balance records: writes balances
- Customer records → Account records: links accounts
- Supplier records → Account records: links accounts
- Warehouses → Account records: links accounts
- Chart of accounts → Account records: manages accounts
- Opening balances → Account records: reads accounts
- Sales records → Application database: persists records
- Purchase records → Application database: persists records
- Movement records → Application database: persists records
- Account records → Application database: persists records
- Opening balance records → Application database: persists records
