# seesathish/antkart-src3 architecture

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

- Interactive diagram: https://gitdiagram.com/seesathish/antkart-src3
- Repository: https://github.com/seesathish/antkart-src3

## Overview

AntKart is a cloud-native e-commerce platform: customers enter through an API gateway, which routes requests to six microservices. The product workflow spans catalogue and discount pricing, cart, order creation, stock reservation and payment; services coordinate business events through Service Bus, while customer-facing events use Event Grid to trigger serverless email notifications. The graph also preserves the documented persistence, identity and payment integrations. Service-to-service and cloud links are based on README statements; sampled source confirms selected handler behavior, not every runtime registration or route.

Main entry points: [`AK.Gateway/AK.Gateway.API/Program.cs`](https://github.com/seesathish/antkart-src3/blob/master/AK.Gateway/AK.Gateway.API/Program.cs) (API gateway), [`AK.Order/AK.Order.API/Endpoints/OrderEndpoints.cs`](https://github.com/seesathish/antkart-src3/blob/master/AK.Order/AK.Order.API/Endpoints/OrderEndpoints.cs) (Order service), [`AK.Payments/AK.Payments.API/Endpoints/PaymentEndpoints.cs`](https://github.com/seesathish/antkart-src3/blob/master/AK.Payments/AK.Payments.API/Endpoints/PaymentEndpoints.cs) (Payments service), [`AK.Products/AK.Products.Application/Queries/GetProducts/GetProductsQueryHandler.cs`](https://github.com/seesathish/antkart-src3/blob/master/AK.Products/AK.Products.Application/Queries/GetProducts/GetProductsQueryHandler.cs) (Product queries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_edge["Entry and identity"]
  node_gateway["API gateway<br/>[Program.cs]"]
  node_entra{{"Entra ID"}}
end

subgraph group_commerce["Commerce services"]
  node_products["Product catalogue"]
  node_product_app["Product queries"]
  node_product_domain["Product domain<br/>[Product.cs]"]
  node_cosmos[("Cosmos DB")]
  node_cart["Shopping cart"]
  node_redis[("Managed Redis")]
  node_discount_api["Discount service<br/>[DiscountService.cs]"]
  node_discount_domain["Coupon domain<br/>[Coupon.cs]"]
end

subgraph group_workflow["Order and payment workflow"]
  node_order["Order service<br/>[OrderEndpoints.cs]"]
  node_order_app["Order handlers"]
  node_order_domain["Order aggregate<br/>[Order.cs]"]
  node_order_db[("PostgreSQL<br/>[OrderDbContext.cs]")]
  node_payments["Payments service"]
  node_razorpay{{"Razorpay"}}
  node_payments_db[("Payments PostgreSQL")]
  node_service_bus["Azure Service Bus"]
end

subgraph group_notify["Customer notifications"]
  node_event_grid["Azure Event Grid"]
  node_notification_fn["Notification function"]
  node_notification_core["Notification dispatch"]
  node_email["Email channel"]
  node_acs{{"Communication Services"}}
end

subgraph group_platform["Shared platform"]
  node_building_blocks["Shared building blocks<br/>[AK.BuildingBlocks]"]
end

node_customer(("Customer"))

node_customer -->|"calls"| node_gateway
node_gateway -->|"validates token"| node_entra
node_gateway -->|"routes requests"| node_products
node_gateway -->|"routes requests"| node_cart
node_gateway -->|"routes requests"| node_order
node_gateway -->|"routes requests"| node_payments
node_gateway -->|"routes requests"| node_discount_api
node_products -.->|"handles queries"| node_product_app
node_product_app -->|"reads catalogue"| node_cosmos
node_product_app -->|"gets discounts"| node_discount_api
node_product_app -->|"maps products"| node_product_domain
node_discount_api -.->|"uses coupons"| node_discount_domain
node_cart -->|"reads and writes"| node_redis
node_order -.->|"handles commands"| node_order_app
node_order_app -->|"creates orders"| node_order_domain
node_order -->|"persists orders"| node_order_db
node_payments -->|"persists payments"| node_payments_db
node_payments -->|"processes payments"| node_razorpay
node_order -->|"publishes saga events"| node_service_bus
node_payments -->|"publishes saga events"| node_service_bus
node_service_bus -->|"delivers events"| node_order
node_service_bus -->|"delivers events"| node_payments
node_order_domain -->|"emits customer events"| node_event_grid
node_event_grid -->|"triggers function"| node_notification_fn
node_notification_fn -.->|"dispatches notifications"| node_notification_core
node_notification_core -.->|"selects channel"| node_email
node_email -->|"sends email"| node_acs

click node_gateway "https://github.com/seesathish/antkart-src3/blob/master/AK.Gateway/AK.Gateway.API/Program.cs"
click node_products "https://github.com/seesathish/antkart-src3/blob/master/AK.Products/AK.Products.API/Endpoints/ProductEndpoints.cs"
click node_product_app "https://github.com/seesathish/antkart-src3/blob/master/AK.Products/AK.Products.Application/Queries/GetProducts/GetProductsQueryHandler.cs"
click node_product_domain "https://github.com/seesathish/antkart-src3/blob/master/AK.Products/AK.Products.Domain/Entities/Product.cs"
click node_cart "https://github.com/seesathish/antkart-src3/blob/master/AK.ShoppingCart/AK.ShoppingCart.Application/Commands/AddToCart/AddToCartCommandHandler.cs"
click node_discount_api "https://github.com/seesathish/antkart-src3/blob/master/AK.Discount/AK.Discount.Grpc/Services/DiscountService.cs"
click node_discount_domain "https://github.com/seesathish/antkart-src3/blob/master/AK.Discount/AK.Discount.Domain/Entities/Coupon.cs"
click node_order "https://github.com/seesathish/antkart-src3/blob/master/AK.Order/AK.Order.API/Endpoints/OrderEndpoints.cs"
click node_order_app "https://github.com/seesathish/antkart-src3/blob/master/AK.Order/AK.Order.Application/Features/CreateOrder/CreateOrderCommandHandler.cs"
click node_order_domain "https://github.com/seesathish/antkart-src3/blob/master/AK.Order/AK.Order.Domain/Entities/Order.cs"
click node_order_db "https://github.com/seesathish/antkart-src3/blob/master/AK.Order/AK.Order.Infrastructure/Persistence/OrderDbContext.cs"
click node_payments "https://github.com/seesathish/antkart-src3/blob/master/AK.Payments/AK.Payments.API/Endpoints/PaymentEndpoints.cs"
click node_payments_db "https://github.com/seesathish/antkart-src3/blob/master/AK.Payments/AK.Payments.Infrastructure/Persistence/PaymentsDbContext.cs"
click node_notification_fn "https://github.com/seesathish/antkart-src3/blob/master/AK.Notification/AK.Notification.Functions/NotificationFunctions.cs"
click node_notification_core "https://github.com/seesathish/antkart-src3/blob/master/AK.Notification/AK.Notification.Core/Dispatch/NotificationDispatcher.cs"
click node_email "https://github.com/seesathish/antkart-src3/blob/master/AK.Notification/AK.Notification.Core/Channels/EmailNotificationChannel.cs"
click node_building_blocks "https://github.com/seesathish/antkart-src3/tree/master/AK.BuildingBlocks/AK.BuildingBlocks"

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_gateway,node_entra toneBlue
class node_products,node_product_app,node_product_domain,node_cosmos,node_cart,node_redis,node_discount_api,node_discount_domain toneAmber
class node_order,node_order_app,node_order_domain,node_order_db,node_payments,node_razorpay,node_payments_db,node_service_bus toneMint
class node_event_grid,node_notification_fn,node_notification_core,node_email,node_acs toneRose
class node_building_blocks,node_customer toneIndigo
```

## Components

### Entry and identity

- [API gateway](https://github.com/seesathish/antkart-src3/blob/master/AK.Gateway/AK.Gateway.API/Program.cs): `AK.Gateway/AK.Gateway.API/Program.cs`
- **Entra ID**

### Commerce services

- [Product catalogue](https://github.com/seesathish/antkart-src3/blob/master/AK.Products/AK.Products.API/Endpoints/ProductEndpoints.cs): `AK.Products/AK.Products.API/Endpoints/ProductEndpoints.cs`
- [Product queries](https://github.com/seesathish/antkart-src3/blob/master/AK.Products/AK.Products.Application/Queries/GetProducts/GetProductsQueryHandler.cs): `AK.Products/AK.Products.Application/Queries/GetProducts/GetProductsQueryHandler.cs`
- [Product domain](https://github.com/seesathish/antkart-src3/blob/master/AK.Products/AK.Products.Domain/Entities/Product.cs): `AK.Products/AK.Products.Domain/Entities/Product.cs`
- **Cosmos DB**
- [Shopping cart](https://github.com/seesathish/antkart-src3/blob/master/AK.ShoppingCart/AK.ShoppingCart.Application/Commands/AddToCart/AddToCartCommandHandler.cs): `AK.ShoppingCart/AK.ShoppingCart.Application/Commands/AddToCart/AddToCartCommandHandler.cs`
- **Managed Redis**
- [Discount service](https://github.com/seesathish/antkart-src3/blob/master/AK.Discount/AK.Discount.Grpc/Services/DiscountService.cs): `AK.Discount/AK.Discount.Grpc/Services/DiscountService.cs`
- [Coupon domain](https://github.com/seesathish/antkart-src3/blob/master/AK.Discount/AK.Discount.Domain/Entities/Coupon.cs): `AK.Discount/AK.Discount.Domain/Entities/Coupon.cs`

### Order and payment workflow

- [Order service](https://github.com/seesathish/antkart-src3/blob/master/AK.Order/AK.Order.API/Endpoints/OrderEndpoints.cs): `AK.Order/AK.Order.API/Endpoints/OrderEndpoints.cs`
- [Order handlers](https://github.com/seesathish/antkart-src3/blob/master/AK.Order/AK.Order.Application/Features/CreateOrder/CreateOrderCommandHandler.cs): `AK.Order/AK.Order.Application/Features/CreateOrder/CreateOrderCommandHandler.cs`
- [Order aggregate](https://github.com/seesathish/antkart-src3/blob/master/AK.Order/AK.Order.Domain/Entities/Order.cs): `AK.Order/AK.Order.Domain/Entities/Order.cs`
- [PostgreSQL](https://github.com/seesathish/antkart-src3/blob/master/AK.Order/AK.Order.Infrastructure/Persistence/OrderDbContext.cs): `AK.Order/AK.Order.Infrastructure/Persistence/OrderDbContext.cs`
- [Payments service](https://github.com/seesathish/antkart-src3/blob/master/AK.Payments/AK.Payments.API/Endpoints/PaymentEndpoints.cs): `AK.Payments/AK.Payments.API/Endpoints/PaymentEndpoints.cs`
- **Razorpay**
- [Payments PostgreSQL](https://github.com/seesathish/antkart-src3/blob/master/AK.Payments/AK.Payments.Infrastructure/Persistence/PaymentsDbContext.cs): `AK.Payments/AK.Payments.Infrastructure/Persistence/PaymentsDbContext.cs`
- **Azure Service Bus**

### Customer notifications

- **Azure Event Grid**
- [Notification function](https://github.com/seesathish/antkart-src3/blob/master/AK.Notification/AK.Notification.Functions/NotificationFunctions.cs): `AK.Notification/AK.Notification.Functions/NotificationFunctions.cs`
- [Notification dispatch](https://github.com/seesathish/antkart-src3/blob/master/AK.Notification/AK.Notification.Core/Dispatch/NotificationDispatcher.cs): `AK.Notification/AK.Notification.Core/Dispatch/NotificationDispatcher.cs`
- [Email channel](https://github.com/seesathish/antkart-src3/blob/master/AK.Notification/AK.Notification.Core/Channels/EmailNotificationChannel.cs): `AK.Notification/AK.Notification.Core/Channels/EmailNotificationChannel.cs`
- **Communication Services**

### Shared platform

- [Shared building blocks](https://github.com/seesathish/antkart-src3/tree/master/AK.BuildingBlocks/AK.BuildingBlocks): `AK.BuildingBlocks/AK.BuildingBlocks`

### Other components

- **Customer**

## Connections

- Customer → API gateway: calls (evidence: `README.md`)
- API gateway → Entra ID: validates token (evidence: `README.md`)
- API gateway → Product catalogue: routes requests (evidence: `README.md`)
- API gateway → Shopping cart: routes requests (evidence: `README.md`)
- API gateway → Order service: routes requests (evidence: `README.md`)
- API gateway → Payments service: routes requests (evidence: `README.md`)
- API gateway → Discount service: routes requests (evidence: `README.md`)
- Product catalogue → Product queries: handles queries
- Product queries → Cosmos DB: reads catalogue (evidence: `README.md`)
- Product queries → Discount service: gets discounts (evidence: `AK.Products/AK.Products.Application/Queries/GetProducts/GetProductsQueryHandler.cs`)
- Product queries → Product domain: maps products (evidence: `AK.Products/AK.Products.Application/Queries/GetProducts/GetProductsQueryHandler.cs`)
- Discount service → Coupon domain: uses coupons
- Shopping cart → Managed Redis: reads and writes (evidence: `README.md`)
- Order service → Order handlers: handles commands
- Order handlers → Order aggregate: creates orders (evidence: `AK.Order/AK.Order.Domain/Entities/Order.cs`)
- Order service → PostgreSQL: persists orders (evidence: `README.md`)
- Payments service → Payments PostgreSQL: persists payments (evidence: `README.md`)
- Payments service → Razorpay: processes payments (evidence: `README.md`)
- Order service → Azure Service Bus: publishes saga events (evidence: `README.md`)
- Payments service → Azure Service Bus: publishes saga events (evidence: `README.md`)
- Azure Service Bus → Order service: delivers events (evidence: `README.md`)
- Azure Service Bus → Payments service: delivers events (evidence: `README.md`)
- Order aggregate → Azure Event Grid: emits customer events (evidence: `README.md`)
- Azure Event Grid → Notification function: triggers function (evidence: `README.md`)
- Notification function → Notification dispatch: dispatches notifications
- Notification dispatch → Email channel: selects channel
- Email channel → Communication Services: sends email (evidence: `README.md`)
