# prem-kumar-e/orderflow architecture

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

- Interactive diagram: https://gitdiagram.com/prem-kumar-e/orderflow
- Repository: https://github.com/prem-kumar-e/orderflow

## Overview

This repository implements a small order-processing system: clients manage products and submit orders; order creation checks the product service, records an order, and publishes an event for asynchronous notification handling. The sampled code shows in-memory product and order state, an AWS SQS publisher, and an SQS-triggered Lambda handler. The README is empty, and deployment configuration is excluded; notification work beyond logging is a TODO.

Main entry points: [`OrderService/Controllers/OrderController.cs`](https://github.com/prem-kumar-e/orderflow/blob/main/OrderService/Controllers/OrderController.cs) (Order endpoints), [`ProductService/Controllers/ProductController.cs`](https://github.com/prem-kumar-e/orderflow/blob/main/ProductService/Controllers/ProductController.cs) (Product endpoints), [`ProductService/Program.cs`](https://github.com/prem-kumar-e/orderflow/blob/main/ProductService/Program.cs) (Product API host), [`OrderService/Program.cs`](https://github.com/prem-kumar-e/orderflow/blob/main/OrderService/Program.cs) (Order API host)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Product catalog"]
  node_product_host["Product API host<br/>[Program.cs]"]
  node_products["Product endpoints"]
  node_product_model["Product model<br/>[Product.cs]"]
end

subgraph group_orders["Order processing"]
  node_order_host["Order API host<br/>[Program.cs]"]
  node_orders_api["Order endpoints<br/>[OrderController.cs]"]
  node_order_model["Order model<br/>[Order.cs]"]
end

subgraph group_notifications["Notifications"]
  node_notification_lambda["Notification handler<br/>[Function.cs]"]
end

node_client(("API client"))
node_product_service["Product service"]
node_sqs["Order events queue"]
node_lambda_logger["Lambda logger"]

node_client -->|"HTTP requests"| node_product_host
node_product_host -->|"maps controllers"| node_products
node_products -->|"uses model"| node_product_model
node_client -->|"HTTP requests"| node_order_host
node_order_host -->|"maps controllers"| node_orders_api
node_orders_api -->|"creates order"| node_order_model
node_orders_api -->|"checks product"| node_product_service
node_product_service -->|"HTTP lookup"| node_products
node_orders_api -->|"publishes event"| node_sqs
node_sqs -->|"invokes handler"| node_notification_lambda
node_notification_lambda -->|"logs event"| node_lambda_logger

click node_product_host "https://github.com/prem-kumar-e/orderflow/blob/main/ProductService/Program.cs"
click node_products "https://github.com/prem-kumar-e/orderflow/blob/main/ProductService/Controllers/ProductController.cs"
click node_product_model "https://github.com/prem-kumar-e/orderflow/blob/main/ProductService/Models/Product.cs"
click node_order_host "https://github.com/prem-kumar-e/orderflow/blob/main/OrderService/Program.cs"
click node_orders_api "https://github.com/prem-kumar-e/orderflow/blob/main/OrderService/Controllers/OrderController.cs"
click node_order_model "https://github.com/prem-kumar-e/orderflow/blob/main/OrderService/Models/Order.cs"
click node_notification_lambda "https://github.com/prem-kumar-e/orderflow/blob/main/NotificationService/Function.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_product_host,node_products,node_product_model,node_client toneBlue
class node_order_host,node_orders_api,node_order_model toneAmber
class node_notification_lambda toneMint
class node_product_service,node_lambda_logger toneIndigo
class node_sqs toneRose
```

## Components

### Product catalog

- [Product API host](https://github.com/prem-kumar-e/orderflow/blob/main/ProductService/Program.cs): `ProductService/Program.cs`
- [Product endpoints](https://github.com/prem-kumar-e/orderflow/blob/main/ProductService/Controllers/ProductController.cs): `ProductService/Controllers/ProductController.cs`
- [Product model](https://github.com/prem-kumar-e/orderflow/blob/main/ProductService/Models/Product.cs): `ProductService/Models/Product.cs`

### Order processing

- [Order API host](https://github.com/prem-kumar-e/orderflow/blob/main/OrderService/Program.cs): `OrderService/Program.cs`
- [Order endpoints](https://github.com/prem-kumar-e/orderflow/blob/main/OrderService/Controllers/OrderController.cs): `OrderService/Controllers/OrderController.cs`
- [Order model](https://github.com/prem-kumar-e/orderflow/blob/main/OrderService/Models/Order.cs): `OrderService/Models/Order.cs`

### Notifications

- [Notification handler](https://github.com/prem-kumar-e/orderflow/blob/main/NotificationService/Function.cs): `NotificationService/Function.cs`

### Other components

- **API client**
- **Product service**
- **Order events queue**
- **Lambda logger**

## Connections

- API client → Product API host: HTTP requests
- Product API host → Product endpoints: maps controllers
- Product endpoints → Product model: uses model
- API client → Order API host: HTTP requests
- Order API host → Order endpoints: maps controllers
- Order endpoints → Order model: creates order
- Order endpoints → Product service: checks product
- Product service → Product endpoints: HTTP lookup
- Order endpoints → Order events queue: publishes event
- Order events queue → Notification handler: invokes handler
- Notification handler → Lambda logger: logs event
