# shaershalomwork/cleanarchitecture architecture

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

- Interactive diagram: https://gitdiagram.com/shaershalomwork/cleanarchitecture
- Repository: https://github.com/shaershalomwork/cleanarchitecture

## Overview

This is a data-centric customer integration baseline: the browser or an API client authenticates, invokes customer operations, and receives explicit Success, Warning, or Error outcomes. Customer workflows cover listing, overview, create, replace, patch, and delete; overview can include partial billing results. The README documents fake development sources and SQL Server, SQLite, and Oracle customer providers. The graph shows those documented capabilities, while some internal wiring is represented only at the subsystem level because its implementation was not sampled.

Main entry points: [`src/Infrastructure/Execution/SourceExecutor.cs`](https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Infrastructure/Execution/SourceExecutor.cs) (Source execution), [`src/Application/Customers/Commands`](https://github.com/shaershalomwork/cleanarchitecture/tree/main/src/Application/Customers/Commands) (Customer commands), [`src/Web/Endpoints/Customers.cs`](https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Web/Endpoints/Customers.cs) (Customer endpoints), [`src/Web/Program.cs`](https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Web/Program.cs) (HTTP runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_angular["Angular application<br/>[app.module.ts]"]
  node_session["Session and CSRF<br/>[session.service.ts]"]
  node_customer_client["Customer client"]
  node_auth_endpoints["Authentication endpoints<br/>[Authentication.cs]"]
  node_customer_endpoints["Customer endpoints<br/>[Customers.cs]"]
  node_auth_config["Authentication setup"]
end

subgraph group_application["Customer use cases"]
  node_application["Customer application"]
  node_customer_queries["Customer queries"]
  node_customer_commands["Customer commands"]
  node_customer_rules["Customer rules<br/>[CustomerRules.cs]"]
  node_result["Operation outcome<br/>[OperationResult.cs]"]
end

subgraph group_integration["Source integrations"]
  node_source_contracts["Customer source contracts<br/>[CustomerSources.cs]"]
  node_source_executor["Source execution<br/>[SourceExecutor.cs]"]
  node_source_pipelines["Resilience pipelines<br/>[SourcePipelines.cs]"]
  node_customer_adapters["Customer provider adapters"]
  node_billing_adapter["Billing adapter"]
  node_fake_sources["Fake sources"]
end

subgraph group_operations["Runtime operations"]
  node_web_runtime["HTTP runtime<br/>[Program.cs]"]
  node_telemetry["Integration telemetry"]
  node_service_defaults["Service defaults<br/>[Extensions.cs]"]
end

node_user(("User or API client"))
node_customer_system[("Customer system of record")]
node_billing_service["Billing service"]
node_identity_provider["External identity provider"]

node_user -->|"uses"| node_angular
node_angular -->|"loads session"| node_session
node_session -->|"requests identity"| node_auth_endpoints
node_angular -->|"invokes"| node_customer_client
node_customer_client -->|"sends operations"| node_customer_endpoints
node_customer_endpoints -->|"dispatches reads"| node_customer_queries
node_customer_endpoints -->|"dispatches writes"| node_customer_commands
node_customer_queries -->|"reads sources"| node_source_contracts
node_customer_commands -->|"checks rules"| node_customer_rules
node_customer_commands -->|"writes source"| node_source_contracts
node_customer_queries -->|"returns outcome"| node_result
node_customer_commands -->|"returns outcome"| node_result
node_source_contracts -->|"executes through"| node_source_executor
node_source_executor -->|"uses resilience"| node_source_pipelines
node_source_executor -->|"invokes provider"| node_customer_adapters
node_source_executor -.->|"uses in development"| node_fake_sources
node_customer_adapters -->|"reads and writes"| node_customer_system
node_source_executor -->|"invokes billing"| node_billing_adapter
node_billing_adapter -->|"requests billing"| node_billing_service
node_auth_endpoints -->|"uses schemes"| node_auth_config
node_auth_config -.->|"federates sign-in"| node_identity_provider
node_web_runtime -->|"maps routes"| node_auth_endpoints
node_web_runtime -->|"maps routes"| node_customer_endpoints
node_web_runtime -->|"configures runtime"| node_service_defaults
node_source_pipelines -->|"records transitions"| node_telemetry

click node_angular "https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Web/ClientApp/src/app/app.module.ts"
click node_session "https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Web/ClientApp/src/app/core/session.service.ts"
click node_customer_client "https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Web/ClientApp/src/app/core/customer.service.ts"
click node_auth_endpoints "https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Web/Endpoints/Authentication.cs"
click node_customer_endpoints "https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Web/Endpoints/Customers.cs"
click node_auth_config "https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Web/Authentication/AuthenticationRegistration.cs"
click node_application "https://github.com/shaershalomwork/cleanarchitecture/tree/main/src/Application/Customers"
click node_customer_queries "https://github.com/shaershalomwork/cleanarchitecture/tree/main/src/Application/Customers/Queries"
click node_customer_commands "https://github.com/shaershalomwork/cleanarchitecture/tree/main/src/Application/Customers/Commands"
click node_customer_rules "https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Application/Customers/CustomerRules.cs"
click node_source_contracts "https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Application/Customers/Sources/CustomerSources.cs"
click node_source_executor "https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Infrastructure/Execution/SourceExecutor.cs"
click node_source_pipelines "https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Infrastructure/Execution/SourcePipelines.cs"
click node_customer_adapters "https://github.com/shaershalomwork/cleanarchitecture/tree/main/src/Infrastructure/Sources/CustomerRegistry"
click node_billing_adapter "https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Infrastructure/Sources/Billing/HttpBillingSourceAdapter.cs"
click node_fake_sources "https://github.com/shaershalomwork/cleanarchitecture/tree/main/src/Infrastructure/Fakes"
click node_result "https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Application/Common/Results/OperationResult.cs"
click node_web_runtime "https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Web/Program.cs"
click node_telemetry "https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Infrastructure/Observability/IntegrationTelemetry.cs"
click node_service_defaults "https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/ServiceDefaults/Extensions.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_angular,node_session,node_customer_client,node_auth_endpoints,node_customer_endpoints,node_auth_config,node_user toneBlue
class node_application,node_customer_queries,node_customer_commands,node_customer_rules,node_result,node_customer_system toneAmber
class node_source_contracts,node_source_executor,node_source_pipelines,node_customer_adapters,node_billing_adapter,node_fake_sources toneMint
class node_web_runtime,node_telemetry,node_service_defaults toneRose
class node_billing_service,node_identity_provider toneIndigo
```

## Components

### Web experience

- [Angular application](https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Web/ClientApp/src/app/app.module.ts): `src/Web/ClientApp/src/app/app.module.ts`
- [Session and CSRF](https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Web/ClientApp/src/app/core/session.service.ts): `src/Web/ClientApp/src/app/core/session.service.ts`
- [Customer client](https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Web/ClientApp/src/app/core/customer.service.ts): `src/Web/ClientApp/src/app/core/customer.service.ts`
- [Authentication endpoints](https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Web/Endpoints/Authentication.cs): `src/Web/Endpoints/Authentication.cs`
- [Customer endpoints](https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Web/Endpoints/Customers.cs): `src/Web/Endpoints/Customers.cs`
- [Authentication setup](https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Web/Authentication/AuthenticationRegistration.cs): `src/Web/Authentication/AuthenticationRegistration.cs`

### Customer use cases

- [Customer application](https://github.com/shaershalomwork/cleanarchitecture/tree/main/src/Application/Customers): `src/Application/Customers`
- [Customer queries](https://github.com/shaershalomwork/cleanarchitecture/tree/main/src/Application/Customers/Queries): `src/Application/Customers/Queries`
- [Customer commands](https://github.com/shaershalomwork/cleanarchitecture/tree/main/src/Application/Customers/Commands): `src/Application/Customers/Commands`
- [Customer rules](https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Application/Customers/CustomerRules.cs): `src/Application/Customers/CustomerRules.cs`
- [Operation outcome](https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Application/Common/Results/OperationResult.cs): `src/Application/Common/Results/OperationResult.cs`

### Source integrations

- [Customer source contracts](https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Application/Customers/Sources/CustomerSources.cs): `src/Application/Customers/Sources/CustomerSources.cs`
- [Source execution](https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Infrastructure/Execution/SourceExecutor.cs): `src/Infrastructure/Execution/SourceExecutor.cs`
- [Resilience pipelines](https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Infrastructure/Execution/SourcePipelines.cs): `src/Infrastructure/Execution/SourcePipelines.cs`
- [Customer provider adapters](https://github.com/shaershalomwork/cleanarchitecture/tree/main/src/Infrastructure/Sources/CustomerRegistry): `src/Infrastructure/Sources/CustomerRegistry`
- [Billing adapter](https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Infrastructure/Sources/Billing/HttpBillingSourceAdapter.cs): `src/Infrastructure/Sources/Billing/HttpBillingSourceAdapter.cs`
- [Fake sources](https://github.com/shaershalomwork/cleanarchitecture/tree/main/src/Infrastructure/Fakes): `src/Infrastructure/Fakes`

### Runtime operations

- [HTTP runtime](https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Web/Program.cs): `src/Web/Program.cs`
- [Integration telemetry](https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/Infrastructure/Observability/IntegrationTelemetry.cs): `src/Infrastructure/Observability/IntegrationTelemetry.cs`
- [Service defaults](https://github.com/shaershalomwork/cleanarchitecture/blob/main/src/ServiceDefaults/Extensions.cs): `src/ServiceDefaults/Extensions.cs`

### Other components

- **User or API client**
- **Customer system of record**
- **Billing service**
- **External identity provider**

## Connections

- User or API client → Angular application: uses
- Angular application → Session and CSRF: loads session
- Session and CSRF → Authentication endpoints: requests identity
- Angular application → Customer client: invokes
- Customer client → Customer endpoints: sends operations
- Customer endpoints → Customer queries: dispatches reads
- Customer endpoints → Customer commands: dispatches writes
- Customer queries → Customer source contracts: reads sources
- Customer commands → Customer rules: checks rules
- Customer commands → Customer source contracts: writes source
- Customer queries → Operation outcome: returns outcome
- Customer commands → Operation outcome: returns outcome
- Customer source contracts → Source execution: executes through
- Source execution → Resilience pipelines: uses resilience
- Source execution → Customer provider adapters: invokes provider
- Source execution → Fake sources: uses in development
- Customer provider adapters → Customer system of record: reads and writes
- Source execution → Billing adapter: invokes billing
- Billing adapter → Billing service: requests billing
- Authentication endpoints → Authentication setup: uses schemes
- Authentication setup → External identity provider: federates sign-in
- HTTP runtime → Authentication endpoints: maps routes
- HTTP runtime → Customer endpoints: maps routes
- HTTP runtime → Service defaults: configures runtime
- Resilience pipelines → Integration telemetry: records transitions
