How mohamedtantawey/payops works
PayOps is a payment-orchestration demo with a React control center, Express API, Redis-backed worker, PostgreSQL state, and simulated PSPs. The main flow is merchant/API client → authenticated payment-intent route → vault and routing/connector execution → persisted payment state; the control center also exposes hosted checkout, routing, invoices, webhooks, billing, and administration. Background jobs handle webhook delivery, invoice generation, billing, and analytics. Edges reflect shown imports/calls or README statements; several unsampled route and worker details are represented only at subsystem level.
Main entry points: App.jsx Control center · server.js Express API · payments.js Payments routes · api.js API client
Components 34
Control center
- Control center
frontend/src/App.jsx - API client
frontend/src/api.js - Hosted checkout UI
frontend/src/components/HostedCheckout.jsx - Payments table
frontend/src/components/PaymentsTable.jsx - Routing editor
frontend/src/components/RoutingEditor.jsx - Invoice list
frontend/src/components/InvoiceList.jsx - Webhook log
frontend/src/components/WebhookLog.jsx - RBAC manager
frontend/src/components/RbacManager.jsx - Status banner
frontend/src/components/StatusBanner.jsx
API and payments
- Express API
backend/src/server.js - API-key RBAC
backend/src/middleware/authRbac.js - Payments routes
backend/src/routes/payments.js - Routing routes
backend/src/routes/routing.js - Administration
backend/src/routes/admin.js - Invoice routes
backend/src/routes/invoices.js - Billing routes
backend/src/routes/billing.js - Webhook routes
backend/src/routes/webhooks.js - Status routes
backend/src/routes/status.js - Payment orchestration
backend/src/core/routingEngine.js - Payment state machine
backend/src/core/paymentStateMachine.js - Vault tokenization
backend/src/core/vaultClient.js - PSP connector adapter
backend/src/core/connectorAdapter.js - Checkout service
backend/src/core/hostedCheckout.js
Background jobs
- Redis job queue
backend/src/queue/jobQueue.js - Job worker
worker/src/worker.js - Webhook delivery
worker/src/handlers/webhookHandler.js - Invoice generation
worker/src/handlers/invoiceHandler.js - Billing runs
worker/src/handlers/billingHandler.js - Analytics consumer
worker/src/handlers/analyticsConsumer.js
State and integrations
- PostgreSQL
backend/src/shared/db.js - Redis services
backend/src/shared/redis.js - Simulated PSP
mock-psp/src/server.js
Other components
- Merchant / operator
- Webhook receiver
Connections 48
- Merchant / operator → Control center: operates
README.md - Merchant / operator → API client: calls
README.md - Control center → Payments table: renders
frontend/src/App.jsx - Control center → Routing editor: renders
frontend/src/App.jsx - Control center → Invoice list: renders
frontend/src/App.jsx - Control center → Webhook log: renders
frontend/src/App.jsx - Control center → RBAC manager: renders
frontend/src/App.jsx - Control center → Status banner: renders
frontend/src/App.jsx - Control center → Hosted checkout UI: renders
frontend/src/App.jsx - Payments table → API client: requests
frontend/src/components/PaymentsTable.jsx - Routing editor → API client: requests
frontend/src/components/RoutingEditor.jsx - Invoice list → API client: requests
frontend/src/components/InvoiceList.jsx - Webhook log → API client: requests
frontend/src/components/WebhookLog.jsx - RBAC manager → API client: requests
frontend/src/components/RbacManager.jsx - API client → Express API: sends requests
README.md - Express API → Payments routes: routes to
backend/src/server.js - Express API → Routing routes: routes to
backend/src/server.js - Express API → Administration: routes to
backend/src/server.js - Express API → Invoice routes: routes to
backend/src/server.js - Express API → Billing routes: routes to
backend/src/server.js - Express API → Webhook routes: routes to
backend/src/server.js - Express API → Status routes: routes to
backend/src/server.js - Payments routes → API-key RBAC: authenticates with
backend/src/routes/payments.js - Routing routes → API-key RBAC: authenticates with
backend/src/routes/routing.js - Administration → API-key RBAC: authorizes with
backend/src/routes/admin.js - Payments routes → Payment orchestration: executes
backend/src/routes/payments.js - Payments routes → Payment state machine: transitions
backend/src/routes/payments.js - Payments routes → Vault tokenization: tokenizes with
backend/src/routes/payments.js - Payments routes → Checkout service: uses
backend/src/routes/payments.js - Payment orchestration → Payment state machine: transitions
backend/src/core/routingEngine.js - Payment orchestration → Vault tokenization: detokenizes with
backend/src/core/routingEngine.js - Payment orchestration → PSP connector adapter: authorizes through
backend/src/core/routingEngine.js - PSP connector adapter → PostgreSQL: reads credentials
backend/src/core/connectorAdapter.js - PSP connector adapter → Simulated PSP: calls PSP
- Payments routes → Redis job queue: enqueues jobs
backend/src/routes/payments.js - Invoice routes → Redis job queue: enqueues generation
backend/src/routes/invoices.js - Billing routes → Redis job queue: enqueues runs
backend/src/routes/billing.js - Webhook routes → Redis job queue: enqueues dispatch
backend/src/routes/webhooks.js - Redis job queue → Redis services: pushes jobs
backend/src/queue/jobQueue.js - Job worker → Redis job queue: consumes queue
worker/src/worker.js - Job worker → Webhook delivery: dispatches to
worker/src/worker.js - Job worker → Invoice generation: dispatches to
worker/src/worker.js - Job worker → Billing runs: dispatches to
worker/src/worker.js - Job worker → Analytics consumer: dispatches to
worker/src/worker.js - Webhook delivery → PostgreSQL: records deliveries
worker/src/handlers/webhookHandler.js - Webhook delivery → Webhook receiver: posts signed events
worker/src/handlers/webhookHandler.js - Invoice generation → PostgreSQL: reads and writes
worker/src/handlers/invoiceHandler.js - Billing runs → Payment orchestration: executes payments
worker/src/handlers/billingHandler.js