# mohithkinthada2006-crypto/hyperswitch architecture

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

- Interactive diagram: https://gitdiagram.com/mohithkinthada2006-crypto/hyperswitch
- Repository: https://github.com/mohithkinthada2006-crypto/hyperswitch

## Overview

Hyperswitch is a composable payments platform: merchants configure processors and submit payment requests, while the platform provides payment processing, intelligent routing, payment-method vaulting, retries, and operational analytics. The graph retains these documented product capabilities and distinguishes API routing, payment-domain handling, processor integration, persistence, and analytics. Some subsystem paths are directory-level because their implementation files appear in the tree but were not sampled; only documented or excerpt-visible relationships are connected.

Main entry points: [`crates/router/src/core`](https://github.com/mohithkinthada2006-crypto/hyperswitch/tree/main/crates/router/src/core) (Payment processing), [`crates/router/src/core/offer_engine`](https://github.com/mohithkinthada2006-crypto/hyperswitch/tree/main/crates/router/src/core/offer_engine) (Offer engine), [`crates/openapi/src/routes`](https://github.com/mohithkinthada2006-crypto/hyperswitch/tree/main/crates/openapi/src/routes) (HTTP API routes), [`crates/router/src/routes/app.rs`](https://github.com/mohithkinthada2006-crypto/hyperswitch/blob/main/crates/router/src/routes/app.rs) (Router application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and orchestration"]
  node_http_api["HTTP API routes"]
  node_router_entry["Router application<br/>[app.rs]"]
  node_offer_routes["Offer API routes<br/>[offer_engine.rs]"]
  node_offer_openapi["Offer API specification<br/>[offer_engine.rs]"]
end

subgraph group_payments["Payment capabilities"]
  node_payment_flow["Payment processing"]
  node_intelligent_routing["Intelligent routing"]
  node_retry_recovery["Retries and recovery"]
  node_vault["Payment methods vault<br/>[controller.rs]"]
  node_offer_engine["Offer engine"]
  node_domain_models["Payment domain models"]
end

subgraph group_integrations["Integrations and data"]
  node_processor_adapters["Processor connectors"]
  node_authentication["3DS authentication"]
  node_storage[("Payment persistence<br/>[storage.rs]")]
  node_file_storage[("File storage<br/>[file_storage.rs]")]
end

subgraph group_operations["Operations and insight"]
  node_analytics["Analytics and observability<br/>[query.rs]"]
  node_scheduler["Scheduled workflows"]
end

node_merchant(("Merchant / client"))

node_merchant -->|"submits requests"| node_http_api
node_http_api -.->|"routes requests"| node_router_entry
node_router_entry -.->|"dispatches flows"| node_payment_flow
node_payment_flow -.->|"selects processor"| node_intelligent_routing
node_payment_flow -.->|"applies retries"| node_retry_recovery
node_payment_flow -.->|"uses payment methods"| node_vault
node_payment_flow -.->|"sends transactions"| node_processor_adapters
node_payment_flow -.->|"persists payment state"| node_storage
node_offer_openapi -->|"documents browse API"| node_offer_routes
node_offer_routes -->|"dispatches browse"| node_offer_engine
node_offer_engine -.->|"schedules notifications"| node_scheduler
node_scheduler -->|"executes notifications"| node_offer_engine
node_authentication -->|"uses request types"| node_domain_models
node_file_storage -->|"selects backend"| node_file_storage

click node_http_api "https://github.com/mohithkinthada2006-crypto/hyperswitch/tree/main/crates/openapi/src/routes"
click node_router_entry "https://github.com/mohithkinthada2006-crypto/hyperswitch/blob/main/crates/router/src/routes/app.rs"
click node_payment_flow "https://github.com/mohithkinthada2006-crypto/hyperswitch/tree/main/crates/router/src/core"
click node_intelligent_routing "https://github.com/mohithkinthada2006-crypto/hyperswitch/tree/main/crates/router/src/core"
click node_retry_recovery "https://github.com/mohithkinthada2006-crypto/hyperswitch/tree/main/crates/router/src/core"
click node_vault "https://github.com/mohithkinthada2006-crypto/hyperswitch/blob/main/crates/payment_methods/src/controller.rs"
click node_offer_routes "https://github.com/mohithkinthada2006-crypto/hyperswitch/blob/main/crates/router/src/routes/offer_engine.rs"
click node_offer_engine "https://github.com/mohithkinthada2006-crypto/hyperswitch/tree/main/crates/router/src/core/offer_engine"
click node_processor_adapters "https://github.com/mohithkinthada2006-crypto/hyperswitch/tree/main/crates/hyperswitch_connectors/src/connectors"
click node_authentication "https://github.com/mohithkinthada2006-crypto/hyperswitch/blob/main/crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs"
click node_domain_models "https://github.com/mohithkinthada2006-crypto/hyperswitch/blob/main/crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs"
click node_storage "https://github.com/mohithkinthada2006-crypto/hyperswitch/blob/main/crates/router/src/types/storage.rs"
click node_file_storage "https://github.com/mohithkinthada2006-crypto/hyperswitch/blob/main/crates/external_services/src/file_storage.rs"
click node_analytics "https://github.com/mohithkinthada2006-crypto/hyperswitch/blob/main/crates/analytics/src/query.rs"
click node_scheduler "https://github.com/mohithkinthada2006-crypto/hyperswitch/blob/main/crates/router/src/workflows/offer_engine_notify.rs"
click node_offer_openapi "https://github.com/mohithkinthada2006-crypto/hyperswitch/blob/main/crates/openapi/src/routes/offer_engine.rs"

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_http_api,node_router_entry,node_offer_routes,node_offer_openapi,node_merchant toneBlue
class node_payment_flow,node_intelligent_routing,node_retry_recovery,node_vault,node_offer_engine,node_domain_models toneAmber
class node_processor_adapters,node_authentication,node_storage,node_file_storage toneMint
class node_analytics,node_scheduler toneRose
```

## Components

### API and orchestration

- [HTTP API routes](https://github.com/mohithkinthada2006-crypto/hyperswitch/tree/main/crates/openapi/src/routes): `crates/openapi/src/routes`
- [Router application](https://github.com/mohithkinthada2006-crypto/hyperswitch/blob/main/crates/router/src/routes/app.rs): `crates/router/src/routes/app.rs`
- [Offer API routes](https://github.com/mohithkinthada2006-crypto/hyperswitch/blob/main/crates/router/src/routes/offer_engine.rs): `crates/router/src/routes/offer_engine.rs`
- [Offer API specification](https://github.com/mohithkinthada2006-crypto/hyperswitch/blob/main/crates/openapi/src/routes/offer_engine.rs): `crates/openapi/src/routes/offer_engine.rs`

### Payment capabilities

- [Payment processing](https://github.com/mohithkinthada2006-crypto/hyperswitch/tree/main/crates/router/src/core): `crates/router/src/core`
- [Intelligent routing](https://github.com/mohithkinthada2006-crypto/hyperswitch/tree/main/crates/router/src/core): `crates/router/src/core`
- [Retries and recovery](https://github.com/mohithkinthada2006-crypto/hyperswitch/tree/main/crates/router/src/core): `crates/router/src/core`
- [Payment methods vault](https://github.com/mohithkinthada2006-crypto/hyperswitch/blob/main/crates/payment_methods/src/controller.rs): `crates/payment_methods/src/controller.rs`
- [Offer engine](https://github.com/mohithkinthada2006-crypto/hyperswitch/tree/main/crates/router/src/core/offer_engine): `crates/router/src/core/offer_engine`
- [Payment domain models](https://github.com/mohithkinthada2006-crypto/hyperswitch/blob/main/crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs): `crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs`

### Integrations and data

- [Processor connectors](https://github.com/mohithkinthada2006-crypto/hyperswitch/tree/main/crates/hyperswitch_connectors/src/connectors): `crates/hyperswitch_connectors/src/connectors`
- [3DS authentication](https://github.com/mohithkinthada2006-crypto/hyperswitch/blob/main/crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs): `crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs`
- [Payment persistence](https://github.com/mohithkinthada2006-crypto/hyperswitch/blob/main/crates/router/src/types/storage.rs): `crates/router/src/types/storage.rs`
- [File storage](https://github.com/mohithkinthada2006-crypto/hyperswitch/blob/main/crates/external_services/src/file_storage.rs): `crates/external_services/src/file_storage.rs`

### Operations and insight

- [Analytics and observability](https://github.com/mohithkinthada2006-crypto/hyperswitch/blob/main/crates/analytics/src/query.rs): `crates/analytics/src/query.rs`
- [Scheduled workflows](https://github.com/mohithkinthada2006-crypto/hyperswitch/blob/main/crates/router/src/workflows/offer_engine_notify.rs): `crates/router/src/workflows/offer_engine_notify.rs`

### Other components

- **Merchant / client**

## Connections

- Merchant / client → HTTP API routes: submits requests (evidence: `README.md`)
- HTTP API routes → Router application: routes requests
- Router application → Payment processing: dispatches flows
- Payment processing → Intelligent routing: selects processor
- Payment processing → Retries and recovery: applies retries
- Payment processing → Payment methods vault: uses payment methods
- Payment processing → Processor connectors: sends transactions
- Payment processing → Payment persistence: persists payment state
- Offer API specification → Offer API routes: documents browse API (evidence: `crates/openapi/src/routes/offer_engine.rs`)
- Offer API routes → Offer engine: dispatches browse (evidence: `crates/router/src/routes/offer_engine.rs`)
- Offer engine → Scheduled workflows: schedules notifications (evidence: `crates/router/src/workflows/offer_engine_notify.rs`)
- Scheduled workflows → Offer engine: executes notifications (evidence: `crates/router/src/workflows/offer_engine_notify.rs`)
- 3DS authentication → Payment domain models: uses request types (evidence: `crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs`)
- File storage → File storage: selects backend (evidence: `crates/external_services/src/file_storage.rs`)
