# mahdiebrahimidev/inventorymanagement architecture

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

- Interactive diagram: https://gitdiagram.com/mahdiebrahimidev/inventorymanagement
- Repository: https://github.com/mahdiebrahimidev/inventorymanagement

## Overview

InventoryManagement is an ASP.NET inventory-management API. Users and administrators manage accounts and roles, catalog products and suppliers, warehouses, and stock transactions. The principal operational flow is a stock-transaction request routed through the API to application logic that updates warehouse stock and records the transaction. Product and account workflows are also represented. The README is empty; unsampled capabilities are included at directory level, and links without source evidence are omitted.

Main entry points: [`InventoryManagement.Infrastructure/Repositories/CategoryRepository.cs`](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Infrastructure/Repositories/CategoryRepository.cs) (Category repository), [`InventoryManagement.Infrastructure/Repositories/ProductRepository.cs`](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Infrastructure/Repositories/ProductRepository.cs) (Product repository), [`InventoryManagement.Infrastructure/Context/AppDbContext.cs`](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Infrastructure/Context/AppDbContext.cs) (Application database), [`InventoryManagement.Application/Services/ProductService.cs`](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Application/Services/ProductService.cs) (Product service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API"]
  node_account_api["Account endpoints"]
  node_catalog_api["Catalog endpoints"]
  node_category_api["Category endpoints"]
  node_supplier_api["Supplier endpoints"]
  node_stock_api["Stock transactions"]
  node_warehouse_api["Warehouse endpoints"]
  node_warehouse_stock_api["Warehouse stock endpoints"]
  node_unit_api["Unit endpoints<br/>[UnitController.cs]"]
end

subgraph group_application["Application services"]
  node_category_service["Category service<br/>[CategoryService.cs]"]
  node_product_service["Product service<br/>[ProductService.cs]"]
  node_stock_service["Stock transaction service"]
  node_supplier_service["Supplier service<br/>[SupplierService.cs]"]
  node_warehouse_service["Warehouse service"]
  node_warehouse_stock_service["Warehouse stock service"]
  node_unit_service["Unit service<br/>[UnitService.cs]"]
end

subgraph group_identity["Identity"]
  node_account_service["Account service<br/>[AccountService.cs]"]
end

subgraph group_persistence["Persistence and domain"]
  node_domain["Inventory entities and enums<br/>[Entities]"]
  node_repo_contracts["Repository contracts<br/>[Interfaces]"]
  node_product_repository["Product repository"]
  node_category_repository["Category repository"]
  node_generic_repository["Generic repository"]
  node_warehouse_stock_repository["Warehouse stock repository"]
  node_db[("Application database<br/>[AppDbContext.cs]")]
  node_other_repositories["Other repositories<br/>[Repositories]"]
end

node_user(("API client"))
node_identity_provider["ASP.NET Identity"]

node_user -->|"requests"| node_account_api
node_user -->|"requests"| node_catalog_api
node_user -->|"requests"| node_category_api
node_user -->|"requests"| node_supplier_api
node_user -->|"requests"| node_stock_api
node_user -->|"requests"| node_warehouse_api
node_user -->|"requests"| node_warehouse_stock_api
node_user -->|"requests"| node_unit_api
node_category_api -->|"calls"| node_category_service
node_stock_api -->|"calls"| node_stock_service
node_supplier_api -->|"calls"| node_supplier_service
node_warehouse_api -->|"calls"| node_warehouse_service
node_account_api -->|"calls"| node_account_service
node_account_service -->|"manages accounts"| node_identity_provider
node_product_service -->|"calls"| node_product_repository
node_product_service -->|"validates category"| node_category_repository
node_product_service -->|"validates units and suppliers"| node_other_repositories
node_stock_service -->|"uses stock and transaction repositories"| node_other_repositories
node_category_service -->|"uses"| node_category_repository
node_product_repository -->|"inherits"| node_generic_repository
node_category_repository -->|"uses"| node_generic_repository
node_warehouse_stock_repository -->|"uses"| node_generic_repository
node_product_repository -->|"queries"| node_db
node_category_repository -->|"queries"| node_db
node_warehouse_stock_repository -->|"queries"| node_db
node_db -->|"maps entities"| node_domain
node_product_repository -->|"implements"| node_repo_contracts
node_category_repository -->|"implements"| node_repo_contracts
node_account_api -->|"uses interface"| node_account_service

click node_account_api "https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Api/Controllers/AccountController.cs"
click node_catalog_api "https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Api/Controllers/ProductController.cs"
click node_category_api "https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Api/Controllers/CategoryController.cs"
click node_supplier_api "https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Api/Controllers/SupplierController.cs"
click node_stock_api "https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Api/Controllers/StockTransactionController.cs"
click node_warehouse_api "https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Api/Controllers/WarehouseController.cs"
click node_warehouse_stock_api "https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Api/Controllers/WarehouseStockController.cs"
click node_unit_api "https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Api/Controllers/UnitController.cs"
click node_category_service "https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Application/Services/CategoryService.cs"
click node_product_service "https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Application/Services/ProductService.cs"
click node_stock_service "https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Application/Services/StockTransactionService.cs"
click node_supplier_service "https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Application/Services/SupplierService.cs"
click node_warehouse_service "https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Application/Services/WareHouseServices.cs"
click node_warehouse_stock_service "https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Application/Services/WarehouseStockService.cs"
click node_unit_service "https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Application/Services/UnitService.cs"
click node_account_service "https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Infrastructure/Identity/AccountService.cs"
click node_domain "https://github.com/mahdiebrahimidev/inventorymanagement/tree/main/InventoryManagement.Core/Entities"
click node_repo_contracts "https://github.com/mahdiebrahimidev/inventorymanagement/tree/main/InventoryManagement.Core/Interfaces"
click node_product_repository "https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Infrastructure/Repositories/ProductRepository.cs"
click node_category_repository "https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Infrastructure/Repositories/CategoryRepository.cs"
click node_generic_repository "https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Infrastructure/Repositories/GenericRepository.cs"
click node_warehouse_stock_repository "https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Infrastructure/Repositories/WarehouseStockRepository.cs"
click node_db "https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Infrastructure/Context/AppDbContext.cs"
click node_other_repositories "https://github.com/mahdiebrahimidev/inventorymanagement/tree/main/InventoryManagement.Infrastructure/Repositories"

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_account_api,node_catalog_api,node_category_api,node_supplier_api,node_stock_api,node_warehouse_api,node_warehouse_stock_api,node_unit_api,node_user toneBlue
class node_category_service,node_product_service,node_stock_service,node_supplier_service,node_warehouse_service,node_warehouse_stock_service,node_unit_service toneAmber
class node_account_service toneMint
class node_domain,node_repo_contracts,node_product_repository,node_category_repository,node_generic_repository,node_warehouse_stock_repository,node_db,node_other_repositories toneRose
class node_identity_provider toneIndigo
```

## Components

### API

- [Account endpoints](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Api/Controllers/AccountController.cs): `InventoryManagement.Api/Controllers/AccountController.cs`
- [Catalog endpoints](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Api/Controllers/ProductController.cs): `InventoryManagement.Api/Controllers/ProductController.cs`
- [Category endpoints](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Api/Controllers/CategoryController.cs): `InventoryManagement.Api/Controllers/CategoryController.cs`
- [Supplier endpoints](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Api/Controllers/SupplierController.cs): `InventoryManagement.Api/Controllers/SupplierController.cs`
- [Stock transactions](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Api/Controllers/StockTransactionController.cs): `InventoryManagement.Api/Controllers/StockTransactionController.cs`
- [Warehouse endpoints](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Api/Controllers/WarehouseController.cs): `InventoryManagement.Api/Controllers/WarehouseController.cs`
- [Warehouse stock endpoints](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Api/Controllers/WarehouseStockController.cs): `InventoryManagement.Api/Controllers/WarehouseStockController.cs`
- [Unit endpoints](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Api/Controllers/UnitController.cs): `InventoryManagement.Api/Controllers/UnitController.cs`

### Application services

- [Category service](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Application/Services/CategoryService.cs): `InventoryManagement.Application/Services/CategoryService.cs`
- [Product service](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Application/Services/ProductService.cs): `InventoryManagement.Application/Services/ProductService.cs`
- [Stock transaction service](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Application/Services/StockTransactionService.cs): `InventoryManagement.Application/Services/StockTransactionService.cs`
- [Supplier service](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Application/Services/SupplierService.cs): `InventoryManagement.Application/Services/SupplierService.cs`
- [Warehouse service](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Application/Services/WareHouseServices.cs): `InventoryManagement.Application/Services/WareHouseServices.cs`
- [Warehouse stock service](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Application/Services/WarehouseStockService.cs): `InventoryManagement.Application/Services/WarehouseStockService.cs`
- [Unit service](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Application/Services/UnitService.cs): `InventoryManagement.Application/Services/UnitService.cs`

### Identity

- [Account service](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Infrastructure/Identity/AccountService.cs): `InventoryManagement.Infrastructure/Identity/AccountService.cs`

### Persistence and domain

- [Inventory entities and enums](https://github.com/mahdiebrahimidev/inventorymanagement/tree/main/InventoryManagement.Core/Entities): `InventoryManagement.Core/Entities`
- [Repository contracts](https://github.com/mahdiebrahimidev/inventorymanagement/tree/main/InventoryManagement.Core/Interfaces): `InventoryManagement.Core/Interfaces`
- [Product repository](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Infrastructure/Repositories/ProductRepository.cs): `InventoryManagement.Infrastructure/Repositories/ProductRepository.cs`
- [Category repository](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Infrastructure/Repositories/CategoryRepository.cs): `InventoryManagement.Infrastructure/Repositories/CategoryRepository.cs`
- [Generic repository](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Infrastructure/Repositories/GenericRepository.cs): `InventoryManagement.Infrastructure/Repositories/GenericRepository.cs`
- [Warehouse stock repository](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Infrastructure/Repositories/WarehouseStockRepository.cs): `InventoryManagement.Infrastructure/Repositories/WarehouseStockRepository.cs`
- [Application database](https://github.com/mahdiebrahimidev/inventorymanagement/blob/main/InventoryManagement.Infrastructure/Context/AppDbContext.cs): `InventoryManagement.Infrastructure/Context/AppDbContext.cs`
- [Other repositories](https://github.com/mahdiebrahimidev/inventorymanagement/tree/main/InventoryManagement.Infrastructure/Repositories): `InventoryManagement.Infrastructure/Repositories`

### Other components

- **API client**
- **ASP.NET Identity**

## Connections

- API client → Account endpoints: requests
- API client → Catalog endpoints: requests
- API client → Category endpoints: requests
- API client → Supplier endpoints: requests
- API client → Stock transactions: requests
- API client → Warehouse endpoints: requests
- API client → Warehouse stock endpoints: requests
- API client → Unit endpoints: requests
- Category endpoints → Category service: calls (evidence: `InventoryManagement.Api/Controllers/CategoryController.cs`)
- Stock transactions → Stock transaction service: calls (evidence: `InventoryManagement.Api/Controllers/StockTransactionController.cs`)
- Supplier endpoints → Supplier service: calls (evidence: `InventoryManagement.Api/Controllers/SupplierController.cs`)
- Warehouse endpoints → Warehouse service: calls (evidence: `InventoryManagement.Api/Controllers/WarehouseController.cs`)
- Account endpoints → Account service: calls (evidence: `InventoryManagement.Api/Controllers/AccountController.cs`)
- Account service → ASP.NET Identity: manages accounts (evidence: `InventoryManagement.Infrastructure/Identity/AccountService.cs`)
- Product service → Product repository: calls (evidence: `InventoryManagement.Application/Services/ProductService.cs`)
- Product service → Category repository: validates category (evidence: `InventoryManagement.Application/Services/ProductService.cs`)
- Product service → Other repositories: validates units and suppliers (evidence: `InventoryManagement.Application/Services/ProductService.cs`)
- Stock transaction service → Other repositories: uses stock and transaction repositories (evidence: `InventoryManagement.Application/Services/StockTransactionService.cs`)
- Category service → Category repository: uses (evidence: `InventoryManagement.Application/Services/CategoryService.cs`)
- Product repository → Generic repository: inherits (evidence: `InventoryManagement.Infrastructure/Repositories/ProductRepository.cs`)
- Category repository → Generic repository: uses (evidence: `InventoryManagement.Infrastructure/Repositories/CategoryRepository.cs`)
- Warehouse stock repository → Generic repository: uses (evidence: `InventoryManagement.Infrastructure/Repositories/WarehouseStockRepository.cs`)
- Product repository → Application database: queries (evidence: `InventoryManagement.Infrastructure/Repositories/ProductRepository.cs`)
- Category repository → Application database: queries (evidence: `InventoryManagement.Infrastructure/Repositories/CategoryRepository.cs`)
- Warehouse stock repository → Application database: queries (evidence: `InventoryManagement.Infrastructure/Repositories/WarehouseStockRepository.cs`)
- Application database → Inventory entities and enums: maps entities (evidence: `InventoryManagement.Infrastructure/Context/AppDbContext.cs`)
- Product repository → Repository contracts: implements (evidence: `InventoryManagement.Infrastructure/Repositories/ProductRepository.cs`)
- Category repository → Repository contracts: implements (evidence: `InventoryManagement.Infrastructure/Repositories/CategoryRepository.cs`)
- Account endpoints → Account service: uses interface (evidence: `InventoryManagement.Api/Controllers/AccountController.cs`)
