# hosam-sherif/depi-gp architecture

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

- Interactive diagram: https://gitdiagram.com/hosam-sherif/depi-gp
- Repository: https://github.com/hosam-sherif/depi-gp

## Overview

Mazaad is a B2B materials marketplace with forward and reverse auctions, company accounts, orders and payment processing. The main buyer workflow is to discover an approved listing, bid, and proceed through an order and payment; sellers create listings that require approval. Authentication and company verification support access to these workflows. The tree also shows inventory, chat, analytics, sales operations and notifications. Source excerpts confirm some service behavior, but the README is empty and many controller-to-service links are not shown, so those relationships are dashed and unverified.

Main entry points: [`Mazaad.Infrastructure/Persistence/AppDbContext.cs`](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Persistence/AppDbContext.cs) (Application database), [`Mazaad.Infrastructure/Services/Payment/PaymentService.cs`](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/Payment/PaymentService.cs) (Payment processing), [`Mazaad.Infrastructure/Services/ListingService.cs`](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/ListingService.cs) (Listing management), [`Mazaad.Infrastructure/Services/Auth/AuthService.cs`](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/Auth/AuthService.cs) (Identity and profiles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_market["Marketplace auctions"]
  node_listing_api["Listing API"]
  node_listing_service["Listing management<br/>[ListingService.cs]"]
  node_listing_state["Listings and bids<br/>[Listings.cs]"]
  node_bidding_api["Bidding API"]
  node_bidding_service["Bid processing<br/>[BiddingService.cs]"]
  node_reverse_api["Reverse auction API"]
  node_reverse_service["Reverse auction workflow"]
  node_reverse_model["Reverse auction requests<br/>[ReverseAuction.cs]"]
end

subgraph group_identity["Accounts and companies"]
  node_auth_api["Authentication API<br/>[AuthController.cs]"]
  node_auth_service["Identity and profiles<br/>[AuthService.cs]"]
  node_auth_contract["Authentication contract<br/>[IAuthService.cs]"]
  node_company_services["Company registration and users<br/>[Auth]"]
  node_company_model["Company accounts<br/>[Companies.cs]"]
end

subgraph group_commerce["Orders and operations"]
  node_inventory_api["Inventory API"]
  node_inventory_service["Inventory management"]
  node_order_service["Order management<br/>[OrderService.cs]"]
  node_payment_api["Payments API"]
  node_payment_service["Payment processing<br/>[PaymentService.cs]"]
  node_order_model["Orders and payments<br/>[Orders.cs]"]
  node_database[("Application database<br/>[AppDbContext.cs]")]
end

subgraph group_platform["Realtime and insights"]
  node_chat_api["Chat API and hub<br/>[ChatController.cs]"]
  node_chat_service["Chat messaging<br/>[ChatService.cs]"]
  node_auction_hub["Live auction hub<br/>[AuctionHub.cs]"]
  node_analytics["Analytics and sales insights"]
  node_notifications["Notifications"]
  node_result["Operation results<br/>[Result.cs]"]
end

node_buyer(("Buyer or seller"))
node_payment_provider["Paymob<br/>external system"]

node_buyer -.->|"browses listings"| node_listing_api
node_listing_api -.->|"delegates to"| node_listing_service
node_listing_service -->|"reads and writes"| node_database
node_listing_service -->|"publishes auction events"| node_auction_hub
node_listing_service -->|"manages listings"| node_listing_state
node_buyer -.->|"places bids"| node_bidding_api
node_bidding_api -.->|"delegates to"| node_bidding_service
node_bidding_service -.->|"persists bids"| node_database
node_buyer -.->|"submits purchase request"| node_reverse_api
node_reverse_api -.->|"delegates to"| node_reverse_service
node_reverse_service -->|"reads and writes"| node_database
node_reverse_service -->|"manages requests"| node_reverse_model
node_buyer -.->|"authenticates"| node_auth_api
node_auth_api -.->|"delegates to"| node_auth_service
node_auth_api -.->|"uses contract"| node_auth_contract
node_auth_service -->|"stores tokens and users"| node_database
node_auth_service -->|"returns results"| node_result
node_auth_service -.->|"coordinates company access"| node_company_services
node_company_services -.->|"manages accounts"| node_company_model
node_buyer -.->|"manages inventory"| node_inventory_api
node_inventory_api -.->|"delegates to"| node_inventory_service
node_inventory_service -.->|"persists inventory"| node_database
node_order_service -.->|"manages orders"| node_database
node_buyer -.->|"pays order"| node_payment_api
node_payment_api -.->|"delegates to"| node_payment_service
node_payment_service -->|"reads and writes"| node_database
node_payment_service -->|"updates payment state"| node_order_model
node_payment_service -.->|"requests payment"| node_payment_provider
node_payment_service -.->|"sends notifications"| node_notifications
node_buyer -.->|"exchanges messages"| node_chat_api
node_chat_api -.->|"delegates to"| node_chat_service
node_auction_hub -.->|"dispatches bids"| node_bidding_service
node_analytics -.->|"queries activity"| node_database

click node_listing_api "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.API/Controllers/ListingController.cs"
click node_listing_service "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/ListingService.cs"
click node_listing_state "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Domain/Models/Listings.cs"
click node_bidding_api "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.API/Controllers/BiddingController.cs"
click node_bidding_service "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/BiddingService.cs"
click node_reverse_api "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.API/Controllers/ReverseAuctionController.cs"
click node_reverse_service "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/ReverseAuctionService.cs"
click node_reverse_model "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Domain/Models/ReverseAuction.cs"
click node_auth_api "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.API/Controllers/AuthController.cs"
click node_auth_service "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/Auth/AuthService.cs"
click node_auth_contract "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Application/Interfaces/Services/IAuthService.cs"
click node_company_services "https://github.com/hosam-sherif/depi-gp/tree/main/Mazaad.Infrastructure/Services/Auth"
click node_company_model "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Domain/Models/Companies.cs"
click node_inventory_api "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.API/Controllers/InventoryController.cs"
click node_inventory_service "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/Inventory/InventoryService.cs"
click node_order_service "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/OrderService.cs"
click node_payment_api "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.API/Controllers/PaymentsController.cs"
click node_payment_service "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/Payment/PaymentService.cs"
click node_order_model "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Domain/Models/Orders.cs"
click node_database "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Persistence/AppDbContext.cs"
click node_chat_api "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.API/Controllers/ChatController.cs"
click node_chat_service "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/ChatService.cs"
click node_auction_hub "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Hubs/AuctionHub.cs"
click node_analytics "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/AnalyticsService.cs"
click node_notifications "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/NotificationService.cs"
click node_result "https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Application/Common/Result.cs"

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_listing_api,node_listing_service,node_listing_state,node_bidding_api,node_bidding_service,node_reverse_api,node_reverse_service,node_reverse_model toneBlue
class node_auth_api,node_auth_service,node_auth_contract,node_company_services,node_company_model toneAmber
class node_inventory_api,node_inventory_service,node_order_service,node_payment_api,node_payment_service,node_order_model,node_database toneMint
class node_chat_api,node_chat_service,node_auction_hub,node_analytics,node_notifications,node_result toneRose
class node_buyer,node_payment_provider toneIndigo
```

## Components

### Marketplace auctions

- [Listing API](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.API/Controllers/ListingController.cs): `Mazaad.API/Controllers/ListingController.cs`
- [Listing management](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/ListingService.cs): `Mazaad.Infrastructure/Services/ListingService.cs`
- [Listings and bids](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Domain/Models/Listings.cs): `Mazaad.Domain/Models/Listings.cs`
- [Bidding API](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.API/Controllers/BiddingController.cs): `Mazaad.API/Controllers/BiddingController.cs`
- [Bid processing](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/BiddingService.cs): `Mazaad.Infrastructure/Services/BiddingService.cs`
- [Reverse auction API](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.API/Controllers/ReverseAuctionController.cs): `Mazaad.API/Controllers/ReverseAuctionController.cs`
- [Reverse auction workflow](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/ReverseAuctionService.cs): `Mazaad.Infrastructure/Services/ReverseAuctionService.cs`
- [Reverse auction requests](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Domain/Models/ReverseAuction.cs): `Mazaad.Domain/Models/ReverseAuction.cs`

### Accounts and companies

- [Authentication API](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.API/Controllers/AuthController.cs): `Mazaad.API/Controllers/AuthController.cs`
- [Identity and profiles](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/Auth/AuthService.cs): `Mazaad.Infrastructure/Services/Auth/AuthService.cs`
- [Authentication contract](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Application/Interfaces/Services/IAuthService.cs): `Mazaad.Application/Interfaces/Services/IAuthService.cs`
- [Company registration and users](https://github.com/hosam-sherif/depi-gp/tree/main/Mazaad.Infrastructure/Services/Auth): `Mazaad.Infrastructure/Services/Auth`
- [Company accounts](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Domain/Models/Companies.cs): `Mazaad.Domain/Models/Companies.cs`

### Orders and operations

- [Inventory API](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.API/Controllers/InventoryController.cs): `Mazaad.API/Controllers/InventoryController.cs`
- [Inventory management](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/Inventory/InventoryService.cs): `Mazaad.Infrastructure/Services/Inventory/InventoryService.cs`
- [Order management](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/OrderService.cs): `Mazaad.Infrastructure/Services/OrderService.cs`
- [Payments API](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.API/Controllers/PaymentsController.cs): `Mazaad.API/Controllers/PaymentsController.cs`
- [Payment processing](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/Payment/PaymentService.cs): `Mazaad.Infrastructure/Services/Payment/PaymentService.cs`
- [Orders and payments](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Domain/Models/Orders.cs): `Mazaad.Domain/Models/Orders.cs`
- [Application database](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Persistence/AppDbContext.cs): `Mazaad.Infrastructure/Persistence/AppDbContext.cs`

### Realtime and insights

- [Chat API and hub](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.API/Controllers/ChatController.cs): `Mazaad.API/Controllers/ChatController.cs`
- [Chat messaging](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/ChatService.cs): `Mazaad.Infrastructure/Services/ChatService.cs`
- [Live auction hub](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Hubs/AuctionHub.cs): `Mazaad.Infrastructure/Hubs/AuctionHub.cs`
- [Analytics and sales insights](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/AnalyticsService.cs): `Mazaad.Infrastructure/Services/AnalyticsService.cs`
- [Notifications](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Infrastructure/Services/NotificationService.cs): `Mazaad.Infrastructure/Services/NotificationService.cs`
- [Operation results](https://github.com/hosam-sherif/depi-gp/blob/main/Mazaad.Application/Common/Result.cs): `Mazaad.Application/Common/Result.cs`

### Other components

- **Buyer or seller**
- **Paymob**: external system

## Connections

- Buyer or seller → Listing API: browses listings
- Listing API → Listing management: delegates to
- Listing management → Application database: reads and writes (evidence: `Mazaad.Infrastructure/Services/ListingService.cs`)
- Listing management → Live auction hub: publishes auction events (evidence: `Mazaad.Infrastructure/Services/ListingService.cs`)
- Listing management → Listings and bids: manages listings (evidence: `Mazaad.Infrastructure/Services/ListingService.cs`)
- Buyer or seller → Bidding API: places bids
- Bidding API → Bid processing: delegates to
- Bid processing → Application database: persists bids
- Buyer or seller → Reverse auction API: submits purchase request
- Reverse auction API → Reverse auction workflow: delegates to
- Reverse auction workflow → Application database: reads and writes (evidence: `Mazaad.Infrastructure/Services/ReverseAuctionService.cs`)
- Reverse auction workflow → Reverse auction requests: manages requests (evidence: `Mazaad.Infrastructure/Services/ReverseAuctionService.cs`)
- Buyer or seller → Authentication API: authenticates
- Authentication API → Identity and profiles: delegates to
- Authentication API → Authentication contract: uses contract (evidence: `Mazaad.API/Controllers/AuthController.cs`)
- Identity and profiles → Application database: stores tokens and users (evidence: `Mazaad.Infrastructure/Services/Auth/AuthService.cs`)
- Identity and profiles → Operation results: returns results (evidence: `Mazaad.Infrastructure/Services/Auth/AuthService.cs`)
- Identity and profiles → Company registration and users: coordinates company access
- Company registration and users → Company accounts: manages accounts (evidence: `Mazaad.Infrastructure/Services/Auth/AuthService.cs`)
- Buyer or seller → Inventory API: manages inventory
- Inventory API → Inventory management: delegates to
- Inventory management → Application database: persists inventory
- Order management → Application database: manages orders
- Buyer or seller → Payments API: pays order
- Payments API → Payment processing: delegates to
- Payment processing → Application database: reads and writes (evidence: `Mazaad.Infrastructure/Services/Payment/PaymentService.cs`)
- Payment processing → Orders and payments: updates payment state (evidence: `Mazaad.Infrastructure/Services/Payment/PaymentService.cs`)
- Payment processing → Paymob: requests payment
- Payment processing → Notifications: sends notifications
- Buyer or seller → Chat API and hub: exchanges messages
- Chat API and hub → Chat messaging: delegates to
- Live auction hub → Bid processing: dispatches bids
- Analytics and sales insights → Application database: queries activity
