# rishirajpal01/webhook-delivery-platform architecture

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

- Interactive diagram: https://gitdiagram.com/rishirajpal01/webhook-delivery-platform
- Repository: https://github.com/rishirajpal01/webhook-delivery-platform

## Overview

This is a self-hostable webhook delivery service. A product sends an event through the HTTP API; the service persists it and fans out deliveries to subscribed endpoints. Dispatchers claim work, send signed HTTP requests, and record attempts and retry/health state in Postgres. The graph also preserves replay, endpoint management, the Go SDK and CLI, and receiver-side verification. Edges are limited to README statements and sampled source references; unsampled internals are represented only where the README supports the capability.

Main entry points: [`internal/dispatcher/dispatcher.go`](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/dispatcher/dispatcher.go) (Dispatcher), [`internal/api/handlers.go`](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/api/handlers.go) (HTTP API), [`internal/postgres/store.go`](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/postgres/store.go) (Postgres store), [`webhooks/client.go`](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/webhooks/client.go) (Go API SDK)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and management"]
  node_http_api["HTTP API<br/>[handlers.go]"]
  node_ops_api["Ops endpoints<br/>[api.go]"]
  node_apps_endpoints["Apps and endpoints<br/>[handlers.go]"]
  node_event_ingest["Event ingest<br/>[handlers.go]"]
  node_replay["Delivery replay<br/>[handlers.go]"]
end

subgraph group_delivery["Delivery runtime"]
  node_dispatcher["Dispatcher<br/>[dispatcher.go]"]
  node_retry_health["Retry and health<br/>[dispatcher.go]"]
  node_request_signing["Request signing<br/>[signing.go]"]
  node_ssrf_guard["SSRF guard<br/>[ssrf.go]"]
  node_service_runtime["Service runtime<br/>[main.go]"]
end

subgraph group_persistence["Persistence"]
  node_postgres[("Postgres store<br/>[store.go]")]
  node_delivery_queue[("Delivery queue<br/>[queue.go]")]
  node_attempt_log[("Attempt log<br/>[queue.go]")]
end

subgraph group_developer["Developer interfaces"]
  node_go_sdk["Go API SDK<br/>[client.go]"]
  node_sdk_types["SDK types<br/>[types.go]"]
  node_cli["Webhook CLI<br/>[main.go]"]
end

subgraph group_receiver["Receiver tools"]
  node_receiver_sdk["Receiver verification<br/>[verify.go]"]
  node_mock_receiver["Mock receiver<br/>[main.go]"]
end

node_product(("Product application"))
node_receiver(("Webhook receiver"))

node_product -->|"sends events"| node_http_api
node_http_api -->|"routes requests"| node_apps_endpoints
node_http_api -->|"routes requests"| node_event_ingest
node_http_api -->|"routes requests"| node_replay
node_apps_endpoints -->|"stores config"| node_postgres
node_event_ingest -->|"stores and fans out"| node_postgres
node_replay -->|"resets deliveries"| node_postgres
node_service_runtime -->|"starts API"| node_http_api
node_service_runtime -->|"starts dispatcher"| node_dispatcher
node_dispatcher -->|"claims work"| node_delivery_queue
node_dispatcher -->|"signs requests"| node_request_signing
node_dispatcher -->|"guards dialing"| node_ssrf_guard
node_dispatcher -->|"decides outcomes"| node_retry_health
node_retry_health -->|"records outcome"| node_delivery_queue
node_retry_health -->|"records attempts"| node_attempt_log
node_delivery_queue -->|"reads and updates"| node_postgres
node_attempt_log -->|"persists attempts"| node_postgres
node_dispatcher -->|"sends webhooks"| node_receiver
node_cli -->|"calls API"| node_go_sdk
node_go_sdk -->|"calls HTTP API"| node_http_api
node_go_sdk -->|"uses types"| node_sdk_types
node_receiver -->|"verifies requests"| node_receiver_sdk
node_receiver_sdk -->|"checks signatures"| node_request_signing
node_mock_receiver -->|"verifies signatures"| node_request_signing

click node_http_api "https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/api/handlers.go"
click node_ops_api "https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/api/api.go"
click node_apps_endpoints "https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/api/handlers.go"
click node_event_ingest "https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/api/handlers.go"
click node_replay "https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/api/handlers.go"
click node_dispatcher "https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/dispatcher/dispatcher.go"
click node_retry_health "https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/dispatcher/dispatcher.go"
click node_request_signing "https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/signing/signing.go"
click node_ssrf_guard "https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/ssrf/ssrf.go"
click node_postgres "https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/postgres/store.go"
click node_delivery_queue "https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/postgres/queue.go"
click node_attempt_log "https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/postgres/queue.go"
click node_service_runtime "https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/cmd/webhookd/main.go"
click node_go_sdk "https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/webhooks/client.go"
click node_sdk_types "https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/webhooks/types.go"
click node_cli "https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/cmd/webhookctl/main.go"
click node_receiver_sdk "https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/webhooks/verify.go"
click node_mock_receiver "https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/cmd/mockreceiver/main.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_http_api,node_ops_api,node_apps_endpoints,node_event_ingest,node_replay toneBlue
class node_dispatcher,node_retry_health,node_request_signing,node_ssrf_guard,node_service_runtime toneAmber
class node_postgres,node_delivery_queue,node_attempt_log,node_receiver toneMint
class node_go_sdk,node_sdk_types,node_cli toneRose
class node_receiver_sdk,node_mock_receiver,node_product toneIndigo
```

## Components

### API and management

- [HTTP API](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/api/handlers.go): `internal/api/handlers.go`
- [Ops endpoints](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/api/api.go): `internal/api/api.go`
- [Apps and endpoints](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/api/handlers.go): `internal/api/handlers.go`
- [Event ingest](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/api/handlers.go): `internal/api/handlers.go`
- [Delivery replay](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/api/handlers.go): `internal/api/handlers.go`

### Delivery runtime

- [Dispatcher](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/dispatcher/dispatcher.go): `internal/dispatcher/dispatcher.go`
- [Retry and health](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/dispatcher/dispatcher.go): `internal/dispatcher/dispatcher.go`
- [Request signing](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/signing/signing.go): `internal/signing/signing.go`
- [SSRF guard](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/ssrf/ssrf.go): `internal/ssrf/ssrf.go`
- [Service runtime](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/cmd/webhookd/main.go): `cmd/webhookd/main.go`

### Persistence

- [Postgres store](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/postgres/store.go): `internal/postgres/store.go`
- [Delivery queue](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/postgres/queue.go): `internal/postgres/queue.go`
- [Attempt log](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/internal/postgres/queue.go): `internal/postgres/queue.go`

### Developer interfaces

- [Go API SDK](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/webhooks/client.go): `webhooks/client.go`
- [SDK types](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/webhooks/types.go): `webhooks/types.go`
- [Webhook CLI](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/cmd/webhookctl/main.go): `cmd/webhookctl/main.go`

### Receiver tools

- [Receiver verification](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/webhooks/verify.go): `webhooks/verify.go`
- [Mock receiver](https://github.com/rishirajpal01/webhook-delivery-platform/blob/main/cmd/mockreceiver/main.go): `cmd/mockreceiver/main.go`

### Other components

- **Product application**
- **Webhook receiver**

## Connections

- Product application → HTTP API: sends events (evidence: `README.md`)
- HTTP API → Apps and endpoints: routes requests (evidence: `internal/api/handlers.go`)
- HTTP API → Event ingest: routes requests (evidence: `internal/api/handlers.go`)
- HTTP API → Delivery replay: routes requests (evidence: `internal/api/handlers.go`)
- Apps and endpoints → Postgres store: stores config (evidence: `internal/api/handlers.go`)
- Event ingest → Postgres store: stores and fans out (evidence: `README.md`)
- Delivery replay → Postgres store: resets deliveries (evidence: `internal/postgres/store.go`)
- Service runtime → HTTP API: starts API (evidence: `cmd/webhookd/main.go`)
- Service runtime → Dispatcher: starts dispatcher (evidence: `cmd/webhookd/main.go`)
- Dispatcher → Delivery queue: claims work (evidence: `README.md`)
- Dispatcher → Request signing: signs requests (evidence: `README.md`)
- Dispatcher → SSRF guard: guards dialing (evidence: `internal/dispatcher/dispatcher.go`)
- Dispatcher → Retry and health: decides outcomes (evidence: `internal/dispatcher/dispatcher.go`)
- Retry and health → Delivery queue: records outcome (evidence: `internal/postgres/queue.go`)
- Retry and health → Attempt log: records attempts (evidence: `internal/postgres/queue.go`)
- Delivery queue → Postgres store: reads and updates (evidence: `internal/postgres/queue.go`)
- Attempt log → Postgres store: persists attempts (evidence: `internal/postgres/queue.go`)
- Dispatcher → Webhook receiver: sends webhooks (evidence: `README.md`)
- Webhook CLI → Go API SDK: calls API (evidence: `cmd/webhookctl/main.go`)
- Go API SDK → HTTP API: calls HTTP API (evidence: `README.md`)
- Go API SDK → SDK types: uses types (evidence: `webhooks/client.go`)
- Webhook receiver → Receiver verification: verifies requests (evidence: `README.md`)
- Receiver verification → Request signing: checks signatures (evidence: `webhooks/verify.go`)
- Mock receiver → Request signing: verifies signatures (evidence: `cmd/mockreceiver/main.go`)
