# gurungsh/shopshop architecture

> Architecture diagram of the GitHub repository gurungsh/shopshop, 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/gurungsh/shopshop
- Repository: https://github.com/gurungsh/shopshop

## Overview

ShopShop is a .NET e-commerce backend: customers authenticate, browse the catalog, place orders, and receive asynchronous payment outcomes. Ordering checks catalog data, stores orders and outbox events, and publishes events through RabbitMQ; Payment charges through Stripe and publishes results for Ordering to apply. Notification consumes order updates. The README documents these cross-service flows and the Gateway’s proxy role; source excerpts and the index support selected internal links, but unsampled endpoint and consumer wiring is not independently verified.

Main entry points: [`src/Services/Ordering/Ordering.Api/Services/OrderingService.cs`](https://github.com/gurungsh/shopshop/blob/development/src/Services/Ordering/Ordering.Api/Services/OrderingService.cs) (Order management), [`src/Gateway/Gateway.Api/Program.cs`](https://github.com/gurungsh/shopshop/blob/development/src/Gateway/Gateway.Api/Program.cs) (Gateway proxy), [`src/Services/Identity/Identity.Api/Services/AuthService.cs`](https://github.com/gurungsh/shopshop/blob/development/src/Services/Identity/Identity.Api/Services/AuthService.cs) (Authentication), [`src/Services/Payment/Payment.Api/Services/PaymentProcessingService.cs`](https://github.com/gurungsh/shopshop/blob/development/src/Services/Payment/Payment.Api/Services/PaymentProcessingService.cs) (Payment processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gateway["API Gateway"]
  node_gateway_api["Gateway proxy<br/>[Program.cs]"]
end

subgraph group_identity["Identity"]
  node_identity_api["Identity API<br/>[AuthEndpoints.cs]"]
  node_identity_auth["Authentication<br/>[AuthService.cs]"]
  node_identity_db[("Identity database")]
  node_jwt_keys["JWT keys<br/>[JwtKeyProvider.cs]"]
end

subgraph group_catalog["Catalog"]
  node_catalog_api["Catalog API"]
  node_catalog_services["Product and category services<br/>[ProductService.cs]"]
  node_catalog_db[("Catalog database")]
end

subgraph group_ordering["Ordering"]
  node_ordering_api["Ordering API<br/>[OrderEndpoints.cs]"]
  node_ordering_service["Order management<br/>[OrderingService.cs]"]
  node_catalog_client["Catalog client"]
  node_ordering_db[("Ordering database and outbox")]
  node_ordering_outbox["Order event publisher<br/>[OutboxPublisher.cs]"]
  node_payment_result_consumer["Payment result consumer"]
end

subgraph group_eventing["Events and Payments"]
  node_payment_consumer["Order event consumer"]
  node_payment_processing["Payment processing"]
  node_stripe_service["Stripe charging"]
  node_payment_db[("Payment database and outbox")]
  node_payment_outbox["Payment result publisher<br/>[OutboxPublisher.cs]"]
  node_notification_consumer["Order update consumer"]
  node_notification_service["Notification logger"]
end

node_customer(("Customer"))
node_stripe{{"Stripe"}}
node_rabbitmq["RabbitMQ"]

node_customer -->|"sends requests"| node_gateway_api
node_gateway_api -->|"proxies requests"| node_identity_api
node_gateway_api -->|"proxies requests"| node_catalog_api
node_gateway_api -->|"proxies requests"| node_ordering_api
node_identity_api -.->|"routes auth"| node_identity_auth
node_identity_auth -->|"reads and writes"| node_identity_db
node_identity_auth -.->|"signs tokens"| node_jwt_keys
node_catalog_api -.->|"dispatches requests"| node_catalog_services
node_catalog_services -->|"reads and writes"| node_catalog_db
node_ordering_api -.->|"dispatches requests"| node_ordering_service
node_ordering_service -->|"checks products"| node_catalog_client
node_ordering_service -->|"reads and writes"| node_ordering_db
node_ordering_service -.->|"records order events"| node_ordering_outbox
node_ordering_outbox -->|"publishes events"| node_rabbitmq
node_rabbitmq -->|"delivers order events"| node_payment_consumer
node_payment_consumer -.->|"dispatches charges"| node_payment_processing
node_payment_processing -.->|"requests charge"| node_stripe_service
node_stripe_service -->|"creates payment intents"| node_stripe
node_payment_processing -.->|"stores transactions"| node_payment_db
node_payment_db -.->|"supplies result events"| node_payment_outbox
node_payment_outbox -->|"publishes results"| node_rabbitmq
node_rabbitmq -->|"delivers payment results"| node_payment_result_consumer
node_payment_result_consumer -->|"applies outcomes"| node_ordering_service
node_rabbitmq -->|"delivers order updates"| node_notification_consumer
node_notification_consumer -->|"logs updates"| node_notification_service

click node_gateway_api "https://github.com/gurungsh/shopshop/blob/development/src/Gateway/Gateway.Api/Program.cs"
click node_identity_api "https://github.com/gurungsh/shopshop/blob/development/src/Services/Identity/Identity.Api/Endpoints/AuthEndpoints.cs"
click node_identity_auth "https://github.com/gurungsh/shopshop/blob/development/src/Services/Identity/Identity.Api/Services/AuthService.cs"
click node_identity_db "https://github.com/gurungsh/shopshop/blob/development/src/Services/Identity/Identity.Infrastructure/Data/IdentityDbContext.cs"
click node_jwt_keys "https://github.com/gurungsh/shopshop/blob/development/src/Services/Identity/Identity.Api/Security/JwtKeyProvider.cs"
click node_catalog_api "https://github.com/gurungsh/shopshop/blob/development/src/Services/Catalog/Catalog.Api/Endpoints/ProductEndpoints.cs"
click node_catalog_services "https://github.com/gurungsh/shopshop/blob/development/src/Services/Catalog/Catalog.Api/Services/ProductService.cs"
click node_catalog_db "https://github.com/gurungsh/shopshop/blob/development/src/Services/Catalog/Catalog.Infrastructure/Data/CatalogDbContext.cs"
click node_ordering_api "https://github.com/gurungsh/shopshop/blob/development/src/Services/Ordering/Ordering.Api/Endpoints/OrderEndpoints.cs"
click node_ordering_service "https://github.com/gurungsh/shopshop/blob/development/src/Services/Ordering/Ordering.Api/Services/OrderingService.cs"
click node_catalog_client "https://github.com/gurungsh/shopshop/blob/development/src/Services/Ordering/Ordering.Api/Services/CatalogServiceClient.cs"
click node_ordering_db "https://github.com/gurungsh/shopshop/blob/development/src/Services/Ordering/Ordering.Infrastructure/Data/OrderingDbContext.cs"
click node_ordering_outbox "https://github.com/gurungsh/shopshop/blob/development/src/Services/Ordering/Ordering.Api/Messaging/OutboxPublisher.cs"
click node_payment_consumer "https://github.com/gurungsh/shopshop/blob/development/src/Services/Payment/Payment.Api/Messaging/OrderEventsConsumer.cs"
click node_payment_processing "https://github.com/gurungsh/shopshop/blob/development/src/Services/Payment/Payment.Api/Services/PaymentProcessingService.cs"
click node_stripe_service "https://github.com/gurungsh/shopshop/blob/development/src/Services/Payment/Payment.Api/Services/StripePaymentService.cs"
click node_payment_db "https://github.com/gurungsh/shopshop/blob/development/src/Services/Payment/Payment.Infrastructure/Data/PaymentDbContext.cs"
click node_payment_outbox "https://github.com/gurungsh/shopshop/blob/development/src/Services/Payment/Payment.Api/Messaging/OutboxPublisher.cs"
click node_payment_result_consumer "https://github.com/gurungsh/shopshop/blob/development/src/Services/Ordering/Ordering.Api/Messaging/PaymentEventsConsumer.cs"
click node_notification_consumer "https://github.com/gurungsh/shopshop/blob/development/src/Services/Notification/Notification.Api/Messaging/OrderEventsConsumer.cs"
click node_notification_service "https://github.com/gurungsh/shopshop/blob/development/src/Services/Notification/Notification.Api/Services/NotificationService.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_gateway_api toneBlue
class node_identity_api,node_identity_auth,node_identity_db,node_jwt_keys toneAmber
class node_catalog_api,node_catalog_services,node_catalog_db toneMint
class node_ordering_api,node_ordering_service,node_catalog_client,node_ordering_db,node_ordering_outbox,node_payment_result_consumer toneRose
class node_payment_consumer,node_payment_processing,node_stripe_service,node_payment_db,node_payment_outbox,node_notification_consumer,node_notification_service,node_customer,node_stripe,node_rabbitmq toneIndigo
```

## Components

### API Gateway

- [Gateway proxy](https://github.com/gurungsh/shopshop/blob/development/src/Gateway/Gateway.Api/Program.cs): `src/Gateway/Gateway.Api/Program.cs`

### Identity

- [Identity API](https://github.com/gurungsh/shopshop/blob/development/src/Services/Identity/Identity.Api/Endpoints/AuthEndpoints.cs): `src/Services/Identity/Identity.Api/Endpoints/AuthEndpoints.cs`
- [Authentication](https://github.com/gurungsh/shopshop/blob/development/src/Services/Identity/Identity.Api/Services/AuthService.cs): `src/Services/Identity/Identity.Api/Services/AuthService.cs`
- [Identity database](https://github.com/gurungsh/shopshop/blob/development/src/Services/Identity/Identity.Infrastructure/Data/IdentityDbContext.cs): `src/Services/Identity/Identity.Infrastructure/Data/IdentityDbContext.cs`
- [JWT keys](https://github.com/gurungsh/shopshop/blob/development/src/Services/Identity/Identity.Api/Security/JwtKeyProvider.cs): `src/Services/Identity/Identity.Api/Security/JwtKeyProvider.cs`

### Catalog

- [Catalog API](https://github.com/gurungsh/shopshop/blob/development/src/Services/Catalog/Catalog.Api/Endpoints/ProductEndpoints.cs): `src/Services/Catalog/Catalog.Api/Endpoints/ProductEndpoints.cs`
- [Product and category services](https://github.com/gurungsh/shopshop/blob/development/src/Services/Catalog/Catalog.Api/Services/ProductService.cs): `src/Services/Catalog/Catalog.Api/Services/ProductService.cs`
- [Catalog database](https://github.com/gurungsh/shopshop/blob/development/src/Services/Catalog/Catalog.Infrastructure/Data/CatalogDbContext.cs): `src/Services/Catalog/Catalog.Infrastructure/Data/CatalogDbContext.cs`

### Ordering

- [Ordering API](https://github.com/gurungsh/shopshop/blob/development/src/Services/Ordering/Ordering.Api/Endpoints/OrderEndpoints.cs): `src/Services/Ordering/Ordering.Api/Endpoints/OrderEndpoints.cs`
- [Order management](https://github.com/gurungsh/shopshop/blob/development/src/Services/Ordering/Ordering.Api/Services/OrderingService.cs): `src/Services/Ordering/Ordering.Api/Services/OrderingService.cs`
- [Catalog client](https://github.com/gurungsh/shopshop/blob/development/src/Services/Ordering/Ordering.Api/Services/CatalogServiceClient.cs): `src/Services/Ordering/Ordering.Api/Services/CatalogServiceClient.cs`
- [Ordering database and outbox](https://github.com/gurungsh/shopshop/blob/development/src/Services/Ordering/Ordering.Infrastructure/Data/OrderingDbContext.cs): `src/Services/Ordering/Ordering.Infrastructure/Data/OrderingDbContext.cs`
- [Order event publisher](https://github.com/gurungsh/shopshop/blob/development/src/Services/Ordering/Ordering.Api/Messaging/OutboxPublisher.cs): `src/Services/Ordering/Ordering.Api/Messaging/OutboxPublisher.cs`
- [Payment result consumer](https://github.com/gurungsh/shopshop/blob/development/src/Services/Ordering/Ordering.Api/Messaging/PaymentEventsConsumer.cs): `src/Services/Ordering/Ordering.Api/Messaging/PaymentEventsConsumer.cs`

### Events and Payments

- [Order event consumer](https://github.com/gurungsh/shopshop/blob/development/src/Services/Payment/Payment.Api/Messaging/OrderEventsConsumer.cs): `src/Services/Payment/Payment.Api/Messaging/OrderEventsConsumer.cs`
- [Payment processing](https://github.com/gurungsh/shopshop/blob/development/src/Services/Payment/Payment.Api/Services/PaymentProcessingService.cs): `src/Services/Payment/Payment.Api/Services/PaymentProcessingService.cs`
- [Stripe charging](https://github.com/gurungsh/shopshop/blob/development/src/Services/Payment/Payment.Api/Services/StripePaymentService.cs): `src/Services/Payment/Payment.Api/Services/StripePaymentService.cs`
- [Payment database and outbox](https://github.com/gurungsh/shopshop/blob/development/src/Services/Payment/Payment.Infrastructure/Data/PaymentDbContext.cs): `src/Services/Payment/Payment.Infrastructure/Data/PaymentDbContext.cs`
- [Payment result publisher](https://github.com/gurungsh/shopshop/blob/development/src/Services/Payment/Payment.Api/Messaging/OutboxPublisher.cs): `src/Services/Payment/Payment.Api/Messaging/OutboxPublisher.cs`
- [Order update consumer](https://github.com/gurungsh/shopshop/blob/development/src/Services/Notification/Notification.Api/Messaging/OrderEventsConsumer.cs): `src/Services/Notification/Notification.Api/Messaging/OrderEventsConsumer.cs`
- [Notification logger](https://github.com/gurungsh/shopshop/blob/development/src/Services/Notification/Notification.Api/Services/NotificationService.cs): `src/Services/Notification/Notification.Api/Services/NotificationService.cs`

### Other components

- **Customer**
- **Stripe**
- **RabbitMQ**

## Connections

- Customer → Gateway proxy: sends requests (evidence: `README.md`)
- Gateway proxy → Identity API: proxies requests (evidence: `README.md`)
- Gateway proxy → Catalog API: proxies requests (evidence: `README.md`)
- Gateway proxy → Ordering API: proxies requests (evidence: `README.md`)
- Identity API → Authentication: routes auth
- Authentication → Identity database: reads and writes (evidence: `src/Services/Identity/Identity.Api/Services/AuthService.cs`)
- Authentication → JWT keys: signs tokens
- Catalog API → Product and category services: dispatches requests
- Product and category services → Catalog database: reads and writes (evidence: `src/Services/Catalog/Catalog.Api/Services/ProductService.cs`)
- Ordering API → Order management: dispatches requests
- Order management → Catalog client: checks products (evidence: `src/Services/Ordering/Ordering.Api/Services/OrderingService.cs`)
- Order management → Ordering database and outbox: reads and writes (evidence: `src/Services/Ordering/Ordering.Api/Services/OrderingService.cs`)
- Order management → Order event publisher: records order events
- Order event publisher → RabbitMQ: publishes events (evidence: `README.md`)
- RabbitMQ → Order event consumer: delivers order events (evidence: `README.md`)
- Order event consumer → Payment processing: dispatches charges
- Payment processing → Stripe charging: requests charge
- Stripe charging → Stripe: creates payment intents (evidence: `src/Services/Payment/Payment.Api/Services/StripePaymentService.cs`)
- Payment processing → Payment database and outbox: stores transactions
- Payment database and outbox → Payment result publisher: supplies result events
- Payment result publisher → RabbitMQ: publishes results (evidence: `README.md`)
- RabbitMQ → Payment result consumer: delivers payment results (evidence: `README.md`)
- Payment result consumer → Order management: applies outcomes (evidence: `README.md`)
- RabbitMQ → Order update consumer: delivers order updates (evidence: `README.md`)
- Order update consumer → Notification logger: logs updates (evidence: `README.md`)
