DocsArchitectureServices
Back to Architecture

Services Reference

Every service in the OpenPay stack — what it does, how to configure it, and what ports it uses.

Infrastructure

Traefik

Traefik is the reverse proxy that sits in front of all services. It handles TLS termination, rate limiting, load balancing, and routes incoming requests to the correct backend container.

Ports
  • 80 — HTTP (redirects to HTTPS)
  • 8080 — Dashboard
  • 443 — HTTPS
Config
  • traefik.yml — static config
  • docker-compose.yml — labels
  • Rate limiting: 100 req/s per IP
Core

Hyperswitch

The payment orchestration engine. Routes payments to connectors, handles retries, stores payment records, and exposes the REST API. Built in Rust for high throughput and low latency.

Ports
  • 8080 — API server
  • 8081 — Admin API
Data
  • PostgreSQL — payments, refunds, customers
  • Redis — session cache, rate limiting
  • NATS — event publishing
Billing

Kill Bill

Handles subscription billing, product catalog management, invoicing, and dunning. Integrates with Hyperswitch for payment processing and NATS for event synchronization.

Ports
  • 8082 — REST API
  • 8083 — Admin API
Features
  • Product & plan management
  • Subscription lifecycle
  • Invoice generation
  • Dunning & retry logic
Fraud

Tazama

Real-time fraud detection engine. Evaluates each transaction against configurable rules (amount thresholds, velocity checks, geo-blocking by BIN country). Produces risk scores and triggers alerts.

Rules
  • Amount threshold (e.g., > 500,000 NGN)
  • Velocity (e.g., > 5 transactions in 10 minutes)
  • Geo-blocking (BIN country != NG)
Data
  • NATS — consumes payment events
  • Redis — velocity tracking cache
  • PostgreSQL — alert history
Infrastructure

NATS JetStream

The event bus that connects all services. Uses JetStream for persistent, ordered event delivery. Events are published by Hyperswitch and consumed by Tazama, the NATS-KB Bridge, and your webhooks.

Ports
  • 4222 — client connections
  • 8222 — monitoring
Streams
  • payments — payment events
  • refunds — refund events
  • fraud_alerts — Tazama alerts
Infrastructure

PostgreSQL

Shared database used by Hyperswitch, Kill Bill, and Tazama. Each service uses its own schema within the same PostgreSQL instance. The database persists all payment records, subscription data, and fraud alert history.

Port

5432 — not exposed externally (only accessible via Docker network)