How cypher682/nexuspay-platform works
NexusPay is a four-service payment platform. Clients enter through the API gateway, which routes requests to identity, payment, and notification capabilities. Payments support an idempotent lifecycle, ledger, provider webhooks, and reconciliation; payment and auth events feed asynchronous notification delivery. The graph preserves these documented capabilities and separates service-owned data stores. Source excerpts substantiate several internal calls; broader service routing and event flows are documented in the README, so unsampled implementation details are not inferred.
Main entry points: payments.service.ts Payment lifecycle and ledger · app.ts API gateway · notifications.service.ts Notification delivery · auth.service.ts Identity and IAM
Components 22
API entry
- API gateway
services/api-gateway/src/app.ts - Gateway controls
services/api-gateway/src/middleware
Identity and access
- Auth API
services/auth-service/src/api/routes/auth.routes.ts - Identity and IAM
services/auth-service/src/services/auth.service.ts - Auth database
Payment processing
- Payments API
services/payments-service/src/api/routes/payments.routes.ts - Payment lifecycle and ledger
services/payments-service/src/services/payments.service.ts - Payment state machine
services/payments-service/src/services/payment-state-machine.ts - Payment worker
services/payments-service/src/workers/payment.worker.ts - Reconciliation
services/payments-service/src/services/reconciliation.service.ts - Provider webhooks
services/payments-service/src/services/provider-webhooks.service.ts - Payments database
Notifications
- Notifications API
services/notifications-service/src/api/routes/notifications.routes.ts - Notification delivery
services/notifications-service/src/services/notifications.service.ts - Notification workers
services/notifications-service/src/workers - Templates and senders
services/notifications-service/src/lib - Notification database
Other components
- Client
- Redis
- Simulated payment provider
- RabbitMQ
- Email and SMS transports
Connections 25
- Client → API gateway: sends requests
- API gateway → Gateway controls: applies controls
services/api-gateway/src/app.ts - API gateway → Auth API: routes requests
- API gateway → Payments API: routes requests
- API gateway → Notifications API: routes requests
- Auth API → Identity and IAM: invokes
services/auth-service/src/api/routes/auth.routes.ts - Identity and IAM → Auth database: reads and writes
services/auth-service/src/services/auth.service.ts - Identity and IAM → Redis: uses
services/auth-service/src/services/auth.service.ts - Identity and IAM → RabbitMQ: publishes auth events
services/auth-service/src/services/auth.service.ts - Payments API → Payment lifecycle and ledger: invokes
services/payments-service/src/api/routes/payments.routes.ts - Payment lifecycle and ledger → Payments database: reads and writes
services/payments-service/src/services/payments.service.ts - Payment lifecycle and ledger → Payment state machine: checks transitions
services/payments-service/src/services/payments.service.ts - Payment lifecycle and ledger → Payment worker: enqueues work
services/payments-service/src/services/payments.service.ts - Payment worker → Payment lifecycle and ledger: processes payments
- Payment lifecycle and ledger → RabbitMQ: publishes outcomes
services/payments-service/src/services/payments.service.ts - Payments API → Reconciliation: routes reconciliation
- Provider webhooks → Payment lifecycle and ledger: handles provider events
- Simulated payment provider → Provider webhooks: sends webhooks
- RabbitMQ → Notification workers: delivers events
- Notification workers → Notification delivery: dispatches delivery
services/notifications-service/src/main.ts - Notifications API → Notification delivery: invokes
services/notifications-service/src/services/notifications.service.ts - Notification delivery → Notification database: reads and writes
services/notifications-service/src/services/notifications.service.ts - Notification delivery → RabbitMQ: publishes notification jobs
services/notifications-service/src/services/notifications.service.ts - Notification delivery → Templates and senders: renders and selects
services/notifications-service/src/services/notifications.service.ts - Templates and senders → Email and SMS transports: sends messages