Backend & Data / Reference implementation
Wafi Transaction Platform
A polyglot transaction platform exploring reliable order and payment workflows through Kafka, sagas, and a transactional outbox.
- Focus
- Application engineering
- Project type
- Reference implementation
- Core technologies
- Go · Java · Spring Boot · NestJS

Context
The engineering problem
An order can span multiple services. A database update followed by a failed event publication creates a consistency gap that synchronous request chains alone cannot solve.
Architecture at a glance
A simplified implementation map based on the linked repository. Arrows show the principal relationships; deployment details live in the source.
- clientAPI clientsOrder requestserviceGo order service
- serviceGo order serviceAtomic state + eventdatabasePostgres & outbox
- databasePostgres & outboxOutbox publisherinfraKafka event bus
- infraKafka event busPayment eventsserviceJava payment service
- clientAPI clientsCatalog HTTP APIserviceNestJS catalog
All system components (6)
- API clientsclient
- Go order serviceservice
- Postgres & outboxdatabase
- Kafka event businfra
- Java payment serviceservice
- NestJS catalogservice
Approach
Implementation decisions
Publish from an outbox
The order service persists state changes and an outgoing event in the same transaction. A separate publisher moves events to Kafka.
Coordinate a saga
Payment handlers advance or cancel order state. The inventory step needs integration validation: the payment-confirmed handler currently emits a reservation event before a catalog confirmation.
Give services clear ownership
Go handles orders, Java handles payments, and NestJS provides the catalog service. Shared event contracts describe their integration.
Explore the implementation
Start with the source.
These entry points connect the architecture to the implementation.
- Saga orchestration ↗apps/order-service/internal/saga/orchestrator.go
- Outbox publisher ↗apps/order-service/internal/outbox/publisher.go
- Event contracts ↗libs/proto/order_events.proto
- Local environment ↗scripts/local-setup/docker-compose.yml
Implementation scope
Reference implementation with local Docker infrastructure, an order outbox and saga handlers. Payment defaults are demonstrations, money values use floating-point fields, and catalog event publishing needs integration. The source is an engineering reference for further testing.