# pratiksinha-rzp/paymentsintegrationstudio architecture

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

- Interactive diagram: https://gitdiagram.com/pratiksinha-rzp/paymentsintegrationstudio
- Repository: https://github.com/pratiksinha-rzp/paymentsintegrationstudio

## Overview

Payments Integration Studio lets users define reusable API scenarios, configure their steps, run them with credentials, and inspect recorded executions; it also supports standalone API and webhook replay. The frontend proxies selected actions to the Go API, while the orchestrator coordinates scenario steps and replay, and execution persistence records request and response results. The tree also shows scenario, execution, replay, webhook, settings, and credential-related capabilities. Evidence is limited to the supplied excerpts and source index; unsampled implementation details and some wiring are therefore omitted.

Main entry points: [`backend/main.go`](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/main.go) (HTTP server), [`backend/internal/orchestrator/service.go`](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/internal/orchestrator/service.go) (Run coordinator), [`backend/pkg/httpclient/client.go`](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/pkg/httpclient/client.go) (HTTP client), [`frontend/src/app/api/replay/route.ts`](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/frontend/src/app/api/replay/route.ts) (API replay proxy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_scenario_ui["Scenario screens"]
  node_run_ui["Execution screens"]
  node_api_replay_ui["API replay page<br/>[page.tsx]"]
  node_webhook_ui["Webhook page<br/>[page.tsx]"]
  node_scenario_proxy["Scenario run proxy<br/>[route.ts]"]
  node_api_proxy["API replay proxy<br/>[route.ts]"]
  node_webhook_proxy["Webhook replay proxy<br/>[route.ts]"]
end

subgraph group_scenarios["Scenario management"]
  node_scenario_handler["Scenario endpoints<br/>[handler.go]"]
  node_scenario_service["Scenario logic<br/>[service.go]"]
  node_scenario_repo["Scenario storage<br/>[repository.go]"]
end

subgraph group_runs["Execution and replay"]
  node_orchestrator["Run coordinator<br/>[service.go]"]
  node_orchestrator_handler["Run endpoint<br/>[handler.go]"]
  node_replay_service["API replay logic<br/>[service.go]"]
  node_webhook_logic["Webhook replay logic<br/>[webhook.go]"]
  node_execution_handler["Execution endpoints<br/>[handler.go]"]
  node_execution_repo["Execution records<br/>[repository.go]"]
  node_http_client["HTTP client<br/>[client.go]"]
end

subgraph group_backend["Backend API"]
  node_server["HTTP server<br/>[main.go]"]
end

node_user(("Engineer"))
node_postgres[("PostgreSQL")]
node_external_api(("Payment API"))
node_webhook_target(("Webhook target"))

node_user -.->|"defines scenarios"| node_scenario_ui
node_user -.->|"reviews runs"| node_run_ui
node_user -.->|"starts replay"| node_api_replay_ui
node_user -.->|"configures replay"| node_webhook_ui
node_scenario_ui -.->|"manages scenarios"| node_scenario_handler
node_run_ui -.->|"views executions"| node_execution_handler
node_api_replay_ui -->|"posts request"| node_api_proxy
node_api_proxy -->|"forwards replay"| node_server
node_webhook_ui -.->|"starts replay"| node_webhook_proxy
node_webhook_proxy -->|"forwards replay"| node_server
node_scenario_proxy -->|"creates execution"| node_server
node_server -->|"routes requests"| node_scenario_handler
node_server -->|"routes requests"| node_execution_handler
node_server -->|"routes run"| node_orchestrator_handler
node_scenario_handler -->|"calls logic"| node_scenario_service
node_scenario_service -.->|"uses storage"| node_scenario_repo
node_orchestrator_handler -.->|"starts run"| node_orchestrator
node_orchestrator -->|"loads steps"| node_scenario_service
node_orchestrator -->|"replays steps"| node_replay_service
node_orchestrator -.->|"records run"| node_execution_handler
node_api_proxy -.->|"requests replay"| node_replay_service
node_webhook_proxy -.->|"requests replay"| node_webhook_logic
node_replay_service -->|"sends request"| node_http_client
node_http_client -->|"calls API"| node_external_api
node_webhook_logic -.->|"sends webhook"| node_http_client
node_http_client -.->|"calls target"| node_webhook_target
node_execution_repo -->|"reads and writes"| node_postgres

click node_scenario_ui "https://github.com/pratiksinha-rzp/paymentsintegrationstudio/tree/main/frontend/src/app/scenarios"
click node_run_ui "https://github.com/pratiksinha-rzp/paymentsintegrationstudio/tree/main/frontend/src/app/executions"
click node_api_replay_ui "https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/frontend/src/app/api-replay/page.tsx"
click node_webhook_ui "https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/frontend/src/app/webhooks/page.tsx"
click node_scenario_proxy "https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/frontend/src/app/api/scenarios/run/route.ts"
click node_api_proxy "https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/frontend/src/app/api/replay/route.ts"
click node_webhook_proxy "https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/frontend/src/app/api/webhooks/replay/route.ts"
click node_server "https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/main.go"
click node_scenario_handler "https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/internal/scenario/handler.go"
click node_scenario_service "https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/internal/scenario/service.go"
click node_scenario_repo "https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/internal/scenario/repository.go"
click node_orchestrator "https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/internal/orchestrator/service.go"
click node_orchestrator_handler "https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/internal/orchestrator/handler.go"
click node_replay_service "https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/internal/replay/service.go"
click node_webhook_logic "https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/internal/replay/webhook.go"
click node_execution_handler "https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/internal/execution/handler.go"
click node_execution_repo "https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/internal/execution/repository.go"
click node_http_client "https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/pkg/httpclient/client.go"

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_scenario_ui,node_run_ui,node_api_replay_ui,node_webhook_ui,node_scenario_proxy,node_api_proxy,node_webhook_proxy toneBlue
class node_scenario_handler,node_scenario_service,node_scenario_repo,node_postgres toneAmber
class node_orchestrator,node_orchestrator_handler,node_replay_service,node_webhook_logic,node_execution_handler,node_execution_repo,node_http_client,node_external_api,node_webhook_target toneMint
class node_server toneRose
class node_user toneIndigo
```

## Components

### Frontend

- [Scenario screens](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/tree/main/frontend/src/app/scenarios): `frontend/src/app/scenarios`
- [Execution screens](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/tree/main/frontend/src/app/executions): `frontend/src/app/executions`
- [API replay page](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/frontend/src/app/api-replay/page.tsx): `frontend/src/app/api-replay/page.tsx`
- [Webhook page](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/frontend/src/app/webhooks/page.tsx): `frontend/src/app/webhooks/page.tsx`
- [Scenario run proxy](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/frontend/src/app/api/scenarios/run/route.ts): `frontend/src/app/api/scenarios/run/route.ts`
- [API replay proxy](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/frontend/src/app/api/replay/route.ts): `frontend/src/app/api/replay/route.ts`
- [Webhook replay proxy](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/frontend/src/app/api/webhooks/replay/route.ts): `frontend/src/app/api/webhooks/replay/route.ts`

### Scenario management

- [Scenario endpoints](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/internal/scenario/handler.go): `backend/internal/scenario/handler.go`
- [Scenario logic](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/internal/scenario/service.go): `backend/internal/scenario/service.go`
- [Scenario storage](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/internal/scenario/repository.go): `backend/internal/scenario/repository.go`

### Execution and replay

- [Run coordinator](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/internal/orchestrator/service.go): `backend/internal/orchestrator/service.go`
- [Run endpoint](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/internal/orchestrator/handler.go): `backend/internal/orchestrator/handler.go`
- [API replay logic](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/internal/replay/service.go): `backend/internal/replay/service.go`
- [Webhook replay logic](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/internal/replay/webhook.go): `backend/internal/replay/webhook.go`
- [Execution endpoints](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/internal/execution/handler.go): `backend/internal/execution/handler.go`
- [Execution records](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/internal/execution/repository.go): `backend/internal/execution/repository.go`
- [HTTP client](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/pkg/httpclient/client.go): `backend/pkg/httpclient/client.go`

### Backend API

- [HTTP server](https://github.com/pratiksinha-rzp/paymentsintegrationstudio/blob/main/backend/main.go): `backend/main.go`

### Other components

- **Engineer**
- **PostgreSQL**
- **Payment API**
- **Webhook target**

## Connections

- Engineer → Scenario screens: defines scenarios
- Engineer → Execution screens: reviews runs
- Engineer → API replay page: starts replay
- Engineer → Webhook page: configures replay
- Scenario screens → Scenario endpoints: manages scenarios
- Execution screens → Execution endpoints: views executions
- API replay page → API replay proxy: posts request (evidence: `frontend/src/app/api-replay/page.tsx`)
- API replay proxy → HTTP server: forwards replay (evidence: `frontend/src/app/api/replay/route.ts`)
- Webhook page → Webhook replay proxy: starts replay
- Webhook replay proxy → HTTP server: forwards replay (evidence: `frontend/src/app/api/webhooks/replay/route.ts`)
- Scenario run proxy → HTTP server: creates execution (evidence: `frontend/src/app/api/scenarios/run/route.ts`)
- HTTP server → Scenario endpoints: routes requests (evidence: `backend/main.go`)
- HTTP server → Execution endpoints: routes requests (evidence: `backend/main.go`)
- HTTP server → Run endpoint: routes run (evidence: `backend/main.go`)
- Scenario endpoints → Scenario logic: calls logic (evidence: `backend/internal/scenario/handler.go`)
- Scenario logic → Scenario storage: uses storage
- Run endpoint → Run coordinator: starts run
- Run coordinator → Scenario logic: loads steps (evidence: `backend/internal/orchestrator/service.go`)
- Run coordinator → API replay logic: replays steps (evidence: `backend/internal/orchestrator/service.go`)
- Run coordinator → Execution endpoints: records run
- API replay proxy → API replay logic: requests replay
- Webhook replay proxy → Webhook replay logic: requests replay
- API replay logic → HTTP client: sends request (evidence: `backend/internal/replay/service.go`)
- HTTP client → Payment API: calls API (evidence: `backend/pkg/httpclient/client.go`)
- Webhook replay logic → HTTP client: sends webhook
- HTTP client → Webhook target: calls target
- Execution records → PostgreSQL: reads and writes (evidence: `backend/internal/execution/repository.go`)
