# abdulrahman11a/orderflow-observability architecture

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

- Interactive diagram: https://gitdiagram.com/abdulrahman11a/orderflow-observability
- Repository: https://github.com/abdulrahman11a/orderflow-observability

## Overview

ShopFlow is an e-commerce API used as an observability lab: clients browse products or submit orders, while the API emits correlated logs, metrics, and traces for investigation in Grafana, Prometheus, Loki, and Jaeger. The order service owns the validation, stock check, payment, and save workflow; payment delay/failure can be injected to demonstrate incidents. The graph follows documented integrations and sampled calls; backend wiring beyond those sources is based on the README architecture.

Main entry points: [`ShopFlow.Api/Program.cs`](https://github.com/abdulrahman11a/orderflow-observability/blob/main/ShopFlow.Api/Program.cs) (HTTP API), [`ShopFlow.Api/Services/OrderService.cs`](https://github.com/abdulrahman11a/orderflow-observability/blob/main/ShopFlow.Api/Services/OrderService.cs) (Order Workflow), [`ShopFlow.Api/Telemetry/ShopFlowTelemetry.cs`](https://github.com/abdulrahman11a/orderflow-observability/blob/main/ShopFlow.Api/Telemetry/ShopFlowTelemetry.cs) (Custom Telemetry), [`ShopFlow.Api/Services/PaymentService.cs`](https://github.com/abdulrahman11a/orderflow-observability/blob/main/ShopFlow.Api/Services/PaymentService.cs) (Payment Simulator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["ShopFlow API"]
  node_api["HTTP API<br/>[Program.cs]"]
  node_models["Commerce Models<br/>[Models.cs]"]
  node_orders["Order Workflow<br/>[OrderService.cs]"]
  node_catalog[("Product Catalog<br/>[ProductService.cs]")]
  node_payment["Payment Simulator<br/>[PaymentService.cs]"]
end

subgraph group_telemetry["Observability"]
  node_telemetry["Custom Telemetry"]
end

subgraph group_monitoring["Monitoring Stack"]
  node_jaeger["Jaeger"]
  node_prometheus[("Prometheus")]
  node_loki[("Loki")]
  node_grafana["Grafana"]
  node_dashboard["Overview Dashboard"]
  node_promconfig["Scrape Config<br/>[prometheus.yml]"]
  node_lokiconfig["Log Config<br/>[loki-config.yml]"]
  node_datasources["Datasource Setup<br/>[datasource.yml]"]
end

node_client(("Client"))
node_loadclient(("k6 Load Client<br/>[load-test.js]"))

node_client -->|"sends requests"| node_api
node_loadclient -->|"generates traffic"| node_api
node_api -->|"routes product calls"| node_catalog
node_api -->|"routes order creation"| node_orders
node_orders -->|"reads and updates"| node_catalog
node_orders -->|"charges payment"| node_payment
node_api -->|"configures signals"| node_telemetry
node_orders -->|"records business signals"| node_telemetry
node_payment -->|"records payment signals"| node_telemetry
node_api -->|"exports traces"| node_jaeger
node_prometheus -->|"scrapes metrics"| node_api
node_api -->|"ships logs"| node_loki
node_prometheus -->|"provides metrics"| node_grafana
node_loki -->|"provides logs"| node_grafana
node_jaeger -.->|"explored through"| node_grafana
node_grafana -->|"loads dashboard"| node_dashboard
node_promconfig -->|"configures scraping"| node_prometheus
node_lokiconfig -.->|"configures storage"| node_loki
node_datasources -->|"provisions sources"| node_grafana

click node_api "https://github.com/abdulrahman11a/orderflow-observability/blob/main/ShopFlow.Api/Program.cs"
click node_models "https://github.com/abdulrahman11a/orderflow-observability/blob/main/ShopFlow.Api/Models/Models.cs"
click node_orders "https://github.com/abdulrahman11a/orderflow-observability/blob/main/ShopFlow.Api/Services/OrderService.cs"
click node_catalog "https://github.com/abdulrahman11a/orderflow-observability/blob/main/ShopFlow.Api/Services/ProductService.cs"
click node_payment "https://github.com/abdulrahman11a/orderflow-observability/blob/main/ShopFlow.Api/Services/PaymentService.cs"
click node_telemetry "https://github.com/abdulrahman11a/orderflow-observability/blob/main/ShopFlow.Api/Telemetry/ShopFlowTelemetry.cs"
click node_dashboard "https://github.com/abdulrahman11a/orderflow-observability/blob/main/grafana/dashboards/shopflow-overview.json"
click node_promconfig "https://github.com/abdulrahman11a/orderflow-observability/blob/main/prometheus.yml"
click node_lokiconfig "https://github.com/abdulrahman11a/orderflow-observability/blob/main/loki-config.yml"
click node_datasources "https://github.com/abdulrahman11a/orderflow-observability/blob/main/grafana/provisioning/datasources/datasource.yml"
click node_loadclient "https://github.com/abdulrahman11a/orderflow-observability/blob/main/load-test.js"

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_api,node_models,node_orders,node_catalog,node_payment,node_client,node_loadclient toneBlue
class node_telemetry toneAmber
class node_jaeger,node_prometheus,node_loki,node_grafana,node_dashboard,node_promconfig,node_lokiconfig,node_datasources toneMint
```

## Components

### ShopFlow API

- [HTTP API](https://github.com/abdulrahman11a/orderflow-observability/blob/main/ShopFlow.Api/Program.cs): `ShopFlow.Api/Program.cs`
- [Commerce Models](https://github.com/abdulrahman11a/orderflow-observability/blob/main/ShopFlow.Api/Models/Models.cs): `ShopFlow.Api/Models/Models.cs`
- [Order Workflow](https://github.com/abdulrahman11a/orderflow-observability/blob/main/ShopFlow.Api/Services/OrderService.cs): `ShopFlow.Api/Services/OrderService.cs`
- [Product Catalog](https://github.com/abdulrahman11a/orderflow-observability/blob/main/ShopFlow.Api/Services/ProductService.cs): `ShopFlow.Api/Services/ProductService.cs`
- [Payment Simulator](https://github.com/abdulrahman11a/orderflow-observability/blob/main/ShopFlow.Api/Services/PaymentService.cs): `ShopFlow.Api/Services/PaymentService.cs`

### Observability

- [Custom Telemetry](https://github.com/abdulrahman11a/orderflow-observability/blob/main/ShopFlow.Api/Telemetry/ShopFlowTelemetry.cs): `ShopFlow.Api/Telemetry/ShopFlowTelemetry.cs`

### Monitoring Stack

- **Jaeger**
- **Prometheus**
- **Loki**
- **Grafana**
- [Overview Dashboard](https://github.com/abdulrahman11a/orderflow-observability/blob/main/grafana/dashboards/shopflow-overview.json): `grafana/dashboards/shopflow-overview.json`
- [Scrape Config](https://github.com/abdulrahman11a/orderflow-observability/blob/main/prometheus.yml): `prometheus.yml`
- [Log Config](https://github.com/abdulrahman11a/orderflow-observability/blob/main/loki-config.yml): `loki-config.yml`
- [Datasource Setup](https://github.com/abdulrahman11a/orderflow-observability/blob/main/grafana/provisioning/datasources/datasource.yml): `grafana/provisioning/datasources/datasource.yml`

### Other components

- **Client**
- [k6 Load Client](https://github.com/abdulrahman11a/orderflow-observability/blob/main/load-test.js): `load-test.js`

## Connections

- Client → HTTP API: sends requests (evidence: `README.md`)
- k6 Load Client → HTTP API: generates traffic (evidence: `README.md`)
- HTTP API → Product Catalog: routes product calls (evidence: `ShopFlow.Api/Program.cs`)
- HTTP API → Order Workflow: routes order creation (evidence: `ShopFlow.Api/Program.cs`)
- Order Workflow → Product Catalog: reads and updates (evidence: `ShopFlow.Api/Services/OrderService.cs`)
- Order Workflow → Payment Simulator: charges payment (evidence: `ShopFlow.Api/Services/OrderService.cs`)
- HTTP API → Custom Telemetry: configures signals (evidence: `ShopFlow.Api/Program.cs`)
- Order Workflow → Custom Telemetry: records business signals (evidence: `ShopFlow.Api/Services/OrderService.cs`)
- Payment Simulator → Custom Telemetry: records payment signals (evidence: `ShopFlow.Api/Services/PaymentService.cs`)
- HTTP API → Jaeger: exports traces (evidence: `README.md`)
- Prometheus → HTTP API: scrapes metrics (evidence: `README.md`)
- HTTP API → Loki: ships logs (evidence: `README.md`)
- Prometheus → Grafana: provides metrics (evidence: `README.md`)
- Loki → Grafana: provides logs (evidence: `README.md`)
- Jaeger → Grafana: explored through (evidence: `README.md`)
- Grafana → Overview Dashboard: loads dashboard (evidence: `README.md`)
- Scrape Config → Prometheus: configures scraping (evidence: `README.md`)
- Log Config → Loki: configures storage
- Datasource Setup → Grafana: provisions sources (evidence: `README.md`)
