# johndakultor/multilevelmarketing-v1 architecture

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

- Interactive diagram: https://gitdiagram.com/johndakultor/multilevelmarketing-v1
- Repository: https://github.com/johndakultor/multilevelmarketing-v1

## Overview

This is a multi-organization marketplace with binary-network MLM features. Its product workflow spans catalog management and discovery, cart and checkout, payment processing, order fulfillment/refunds, then commission and wallet accounting. The source tree shows vertical Application features and a shared persistence contract; the README documents REST endpoints and infrastructure, but those implementations are not in the supplied tree. Edges therefore show only evidenced query-to-context access, not an inferred HTTP or command pipeline.

Main entry points: [`src/Application/Common/Interfaces/IApplicationDbContext.cs`](https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Common/Interfaces/IApplicationDbContext.cs) (Application data contract), [`src/Application/Commerce/Queries/GetOrderDetails/GetOrderDetailsQueryHandler.cs`](https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Commerce/Queries/GetOrderDetails/GetOrderDetailsQueryHandler.cs) (Order queries), [`src/Application/Network/Queries/GetAdminAgentDetails/GetAdminAgentDetailsQueryHandler.cs`](https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Network/Queries/GetAdminAgentDetails/GetAdminAgentDetailsQueryHandler.cs) (Agent network), [`src/Application/Network/Queries/GetAgentQualificationStatus/GetAgentQualificationStatusQueryHandler.cs`](https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Network/Queries/GetAgentQualificationStatus/GetAgentQualificationStatusQueryHandler.cs) (Qualification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Catalog"]
  node_catalog_commands["Catalog management"]
  node_catalog_queries["Catalog queries"]
end

subgraph group_commerce["Commerce"]
  node_cart["Cart"]
  node_cart_query["Cart view"]
  node_checkout["Checkout"]
  node_payment["Payment sessions"]
  node_payment_webhook["Payment webhook"]
  node_order_ops["Order lifecycle"]
  node_refunds["Refunds"]
  node_order_views["Order queries"]
end

subgraph group_network["Network and compensation"]
  node_network_queries["Agent network"]
  node_qualification["Qualification"]
  node_commission_plans["Commission plans"]
  node_commissions["Commission processing"]
  node_pairing["Binary pairing"]
end

subgraph group_operations["Operations and reporting"]
  node_wallet_queries["Wallet administration"]
  node_reporting["Reports"]
  node_audit["Audit trail"]
end

subgraph group_shared["Application core"]
  node_db_context["Application data contract"]
end

node_admin(("Administrator"))
node_customer(("Customer"))
node_agent(("Agent"))
node_payment_provider(("Payment provider"))
node_store[("Marketplace database")]

node_customer -->|"changes cart"| node_cart
node_customer -->|"starts checkout"| node_checkout
node_customer -->|"browses catalog"| node_catalog_queries
node_admin -->|"manages catalog"| node_catalog_commands
node_customer -->|"views orders"| node_order_views
node_admin -->|"fulfills orders"| node_order_ops
node_admin -->|"reviews refunds"| node_refunds
node_payment -->|"creates session"| node_payment_provider
node_payment_provider -->|"sends event"| node_payment_webhook
node_agent -->|"views network"| node_network_queries
node_agent -->|"checks status"| node_qualification
node_admin -->|"manages plans"| node_commission_plans
node_admin -->|"processes commissions"| node_commissions
node_admin -->|"runs pairing"| node_pairing
node_admin -->|"reviews wallets"| node_wallet_queries
node_admin -->|"views reports"| node_reporting
node_admin -->|"reviews audit"| node_audit
node_cart_query -->|"reads data"| node_db_context
node_order_views -->|"reads order data"| node_db_context
node_network_queries -->|"reads network data"| node_db_context
node_qualification -->|"reads qualification data"| node_db_context
node_wallet_queries -->|"reads wallet data"| node_db_context
node_reporting -->|"reads report data"| node_db_context
node_audit -->|"reads audit data"| node_db_context
node_db_context -->|"persists domain data"| node_store

click node_catalog_commands "https://github.com/johndakultor/multilevelmarketing-v1/tree/main/src/Application/Catalog/Commands"
click node_catalog_queries "https://github.com/johndakultor/multilevelmarketing-v1/tree/main/src/Application/Catalog/Queries"
click node_cart "https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Commerce/Commands/AddCartItem/AddCartItemCommandHandler.cs"
click node_cart_query "https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Commerce/Queries/GetCart/GetCartQueryHandler.cs"
click node_checkout "https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Commerce/Commands/CreateCheckout/CreateCheckoutCommandHandler.cs"
click node_payment "https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Commerce/Commands/CreatePaymentSession/CreatePaymentSessionCommandHandler.cs"
click node_payment_webhook "https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Commerce/Commands/HandlePaymentWebhook/HandlePaymentWebhookCommandHandler.cs"
click node_order_ops "https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Commerce/Commands/StartOrderProcessing/StartOrderProcessingCommandHandler.cs"
click node_refunds "https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Commerce/Commands/RequestItemRefund/RequestItemRefundCommandHandler.cs"
click node_order_views "https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Commerce/Queries/GetOrderDetails/GetOrderDetailsQueryHandler.cs"
click node_network_queries "https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Network/Queries/GetAdminAgentDetails/GetAdminAgentDetailsQueryHandler.cs"
click node_qualification "https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Network/Queries/GetAgentQualificationStatus/GetAgentQualificationStatusQueryHandler.cs"
click node_commission_plans "https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Compensation/Commands/CreateCommissionPlan/CreateCommissionPlanCommandHandler.cs"
click node_commissions "https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Compensation/Commands/ProcessPaidOrderCommissions/ProcessPaidOrderCommissionsCommandHandler.cs"
click node_pairing "https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Compensation/Commands/ProcessBinaryPairing/ProcessBinaryPairingCommandHandler.cs"
click node_wallet_queries "https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Wallets/Queries/GetAdminWallets/GetAdminWalletsQueryHandler.cs"
click node_reporting "https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Reporting/Queries/GetAdminReport/GetAdminReportQueryHandler.cs"
click node_audit "https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Auditing/Queries/GetAuditTrail/GetAuditTrailQueryHandler.cs"
click node_db_context "https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Common/Interfaces/IApplicationDbContext.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_catalog_commands,node_catalog_queries toneBlue
class node_cart,node_cart_query,node_checkout,node_payment,node_payment_webhook,node_order_ops,node_refunds,node_order_views,node_store toneAmber
class node_network_queries,node_qualification,node_commission_plans,node_commissions,node_pairing toneMint
class node_wallet_queries,node_reporting,node_audit toneRose
class node_db_context,node_admin,node_customer,node_agent,node_payment_provider toneIndigo
```

## Components

### Catalog

- [Catalog management](https://github.com/johndakultor/multilevelmarketing-v1/tree/main/src/Application/Catalog/Commands): `src/Application/Catalog/Commands`
- [Catalog queries](https://github.com/johndakultor/multilevelmarketing-v1/tree/main/src/Application/Catalog/Queries): `src/Application/Catalog/Queries`

### Commerce

- [Cart](https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Commerce/Commands/AddCartItem/AddCartItemCommandHandler.cs): `src/Application/Commerce/Commands/AddCartItem/AddCartItemCommandHandler.cs`
- [Cart view](https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Commerce/Queries/GetCart/GetCartQueryHandler.cs): `src/Application/Commerce/Queries/GetCart/GetCartQueryHandler.cs`
- [Checkout](https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Commerce/Commands/CreateCheckout/CreateCheckoutCommandHandler.cs): `src/Application/Commerce/Commands/CreateCheckout/CreateCheckoutCommandHandler.cs`
- [Payment sessions](https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Commerce/Commands/CreatePaymentSession/CreatePaymentSessionCommandHandler.cs): `src/Application/Commerce/Commands/CreatePaymentSession/CreatePaymentSessionCommandHandler.cs`
- [Payment webhook](https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Commerce/Commands/HandlePaymentWebhook/HandlePaymentWebhookCommandHandler.cs): `src/Application/Commerce/Commands/HandlePaymentWebhook/HandlePaymentWebhookCommandHandler.cs`
- [Order lifecycle](https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Commerce/Commands/StartOrderProcessing/StartOrderProcessingCommandHandler.cs): `src/Application/Commerce/Commands/StartOrderProcessing/StartOrderProcessingCommandHandler.cs`
- [Refunds](https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Commerce/Commands/RequestItemRefund/RequestItemRefundCommandHandler.cs): `src/Application/Commerce/Commands/RequestItemRefund/RequestItemRefundCommandHandler.cs`
- [Order queries](https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Commerce/Queries/GetOrderDetails/GetOrderDetailsQueryHandler.cs): `src/Application/Commerce/Queries/GetOrderDetails/GetOrderDetailsQueryHandler.cs`

### Network and compensation

- [Agent network](https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Network/Queries/GetAdminAgentDetails/GetAdminAgentDetailsQueryHandler.cs): `src/Application/Network/Queries/GetAdminAgentDetails/GetAdminAgentDetailsQueryHandler.cs`
- [Qualification](https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Network/Queries/GetAgentQualificationStatus/GetAgentQualificationStatusQueryHandler.cs): `src/Application/Network/Queries/GetAgentQualificationStatus/GetAgentQualificationStatusQueryHandler.cs`
- [Commission plans](https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Compensation/Commands/CreateCommissionPlan/CreateCommissionPlanCommandHandler.cs): `src/Application/Compensation/Commands/CreateCommissionPlan/CreateCommissionPlanCommandHandler.cs`
- [Commission processing](https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Compensation/Commands/ProcessPaidOrderCommissions/ProcessPaidOrderCommissionsCommandHandler.cs): `src/Application/Compensation/Commands/ProcessPaidOrderCommissions/ProcessPaidOrderCommissionsCommandHandler.cs`
- [Binary pairing](https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Compensation/Commands/ProcessBinaryPairing/ProcessBinaryPairingCommandHandler.cs): `src/Application/Compensation/Commands/ProcessBinaryPairing/ProcessBinaryPairingCommandHandler.cs`

### Operations and reporting

- [Wallet administration](https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Wallets/Queries/GetAdminWallets/GetAdminWalletsQueryHandler.cs): `src/Application/Wallets/Queries/GetAdminWallets/GetAdminWalletsQueryHandler.cs`
- [Reports](https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Reporting/Queries/GetAdminReport/GetAdminReportQueryHandler.cs): `src/Application/Reporting/Queries/GetAdminReport/GetAdminReportQueryHandler.cs`
- [Audit trail](https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Auditing/Queries/GetAuditTrail/GetAuditTrailQueryHandler.cs): `src/Application/Auditing/Queries/GetAuditTrail/GetAuditTrailQueryHandler.cs`

### Application core

- [Application data contract](https://github.com/johndakultor/multilevelmarketing-v1/blob/main/src/Application/Common/Interfaces/IApplicationDbContext.cs): `src/Application/Common/Interfaces/IApplicationDbContext.cs`

### Other components

- **Administrator**
- **Customer**
- **Agent**
- **Payment provider**
- **Marketplace database**

## Connections

- Customer → Cart: changes cart
- Customer → Checkout: starts checkout
- Customer → Catalog queries: browses catalog
- Administrator → Catalog management: manages catalog
- Customer → Order queries: views orders
- Administrator → Order lifecycle: fulfills orders
- Administrator → Refunds: reviews refunds
- Payment sessions → Payment provider: creates session
- Payment provider → Payment webhook: sends event
- Agent → Agent network: views network
- Agent → Qualification: checks status
- Administrator → Commission plans: manages plans
- Administrator → Commission processing: processes commissions
- Administrator → Binary pairing: runs pairing
- Administrator → Wallet administration: reviews wallets
- Administrator → Reports: views reports
- Administrator → Audit trail: reviews audit
- Cart view → Application data contract: reads data
- Order queries → Application data contract: reads order data
- Agent network → Application data contract: reads network data
- Qualification → Application data contract: reads qualification data
- Wallet administration → Application data contract: reads wallet data
- Reports → Application data contract: reads report data
- Audit trail → Application data contract: reads audit data
- Application data contract → Marketplace database: persists domain data
