# ankushp965/payment-platform architecture

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

- Interactive diagram: https://gitdiagram.com/ankushp965/payment-platform
- Repository: https://github.com/ankushp965/payment-platform

## Overview

Payment-Platform is a small payment-processing system. A client submits a payment to the Payment API, which assigns an ID and independently requests ledger recording and notification dispatch before returning their statuses. The ledger persists transactions in PostgreSQL; notification delivery is currently mocked. Each service also exposes health and Prometheus metrics endpoints. The README provides no further product detail, and deployment configuration is not mapped as runtime behavior. Edges reflect the shown HTTP calls and database operations; no metrics scraper or external messaging integration is evidenced.

Main entry points: [`services/payment-api/main.py`](https://github.com/ankushp965/payment-platform/blob/main/services/payment-api/main.py) (Payment API), [`services/ledger/main.py`](https://github.com/ankushp965/payment-platform/blob/main/services/ledger/main.py) (Ledger service), [`services/notification/main.py`](https://github.com/ankushp965/payment-platform/blob/main/services/notification/main.py) (Notification service), [`charts/payment-platform/templates/postgres.yaml`](https://github.com/ankushp965/payment-platform/blob/main/charts/payment-platform/templates/postgres.yaml) (PostgreSQL)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_payment["Payment processing"]
  node_payment_api["Payment API<br/>[main.py]"]
end

subgraph group_ledger["Ledger"]
  node_ledger_service["Ledger service<br/>[main.py]"]
  node_postgres[("PostgreSQL<br/>[postgres.yaml]")]
end

subgraph group_notifications["Notifications"]
  node_notification_service["Notification service<br/>[main.py]"]
end

subgraph group_operations["Service operations"]
  node_payment_metrics["Payment metrics<br/>[main.py]"]
  node_ledger_metrics["Ledger metrics<br/>[main.py]"]
  node_notification_metrics["Notification metrics<br/>[main.py]"]
end

node_client(("Payment client"))

node_client -->|"submits payment"| node_payment_api
node_payment_api -->|"posts entry"| node_ledger_service
node_payment_api -->|"posts notification"| node_notification_service
node_ledger_service -->|"writes transaction"| node_postgres
node_payment_api -->|"records metrics"| node_payment_metrics
node_ledger_service -->|"records metrics"| node_ledger_metrics
node_notification_service -->|"records metrics"| node_notification_metrics

click node_payment_api "https://github.com/ankushp965/payment-platform/blob/main/services/payment-api/main.py"
click node_ledger_service "https://github.com/ankushp965/payment-platform/blob/main/services/ledger/main.py"
click node_postgres "https://github.com/ankushp965/payment-platform/blob/main/charts/payment-platform/templates/postgres.yaml"
click node_notification_service "https://github.com/ankushp965/payment-platform/blob/main/services/notification/main.py"
click node_payment_metrics "https://github.com/ankushp965/payment-platform/blob/main/services/payment-api/main.py"
click node_ledger_metrics "https://github.com/ankushp965/payment-platform/blob/main/services/ledger/main.py"
click node_notification_metrics "https://github.com/ankushp965/payment-platform/blob/main/services/notification/main.py"

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_payment_api,node_client toneBlue
class node_ledger_service,node_postgres toneAmber
class node_notification_service toneMint
class node_payment_metrics,node_ledger_metrics,node_notification_metrics toneRose
```

## Components

### Payment processing

- [Payment API](https://github.com/ankushp965/payment-platform/blob/main/services/payment-api/main.py): `services/payment-api/main.py`

### Ledger

- [Ledger service](https://github.com/ankushp965/payment-platform/blob/main/services/ledger/main.py): `services/ledger/main.py`
- [PostgreSQL](https://github.com/ankushp965/payment-platform/blob/main/charts/payment-platform/templates/postgres.yaml): `charts/payment-platform/templates/postgres.yaml`

### Notifications

- [Notification service](https://github.com/ankushp965/payment-platform/blob/main/services/notification/main.py): `services/notification/main.py`

### Service operations

- [Payment metrics](https://github.com/ankushp965/payment-platform/blob/main/services/payment-api/main.py): `services/payment-api/main.py`
- [Ledger metrics](https://github.com/ankushp965/payment-platform/blob/main/services/ledger/main.py): `services/ledger/main.py`
- [Notification metrics](https://github.com/ankushp965/payment-platform/blob/main/services/notification/main.py): `services/notification/main.py`

### Other components

- **Payment client**

## Connections

- Payment client → Payment API: submits payment (evidence: `services/payment-api/main.py`)
- Payment API → Ledger service: posts entry (evidence: `services/payment-api/main.py`)
- Payment API → Notification service: posts notification (evidence: `services/payment-api/main.py`)
- Ledger service → PostgreSQL: writes transaction (evidence: `services/ledger/main.py`)
- Payment API → Payment metrics: records metrics (evidence: `services/payment-api/main.py`)
- Ledger service → Ledger metrics: records metrics (evidence: `services/ledger/main.py`)
- Notification service → Notification metrics: records metrics (evidence: `services/notification/main.py`)
