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
Wafi Transaction Platform concept interface illustration
Concept interface illustration

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.

System architecture

Architecture at a glance

A simplified implementation map based on the linked repository. Arrows show the principal relationships; deployment details live in the source.

  1. clientAPI clients
    Order request
    serviceGo order service
  2. serviceGo order service
    Atomic state + event
    databasePostgres & outbox
  3. databasePostgres & outbox
    Outbox publisher
    infraKafka event bus
  4. infraKafka event bus
    Payment events
    serviceJava payment service
  5. clientAPI clients
    Catalog HTTP API
    serviceNestJS catalog
All system components (6)
  • API clientsclient
  • Go order serviceservice
  • Postgres & outboxdatabase
  • Kafka event businfra
  • Java payment serviceservice
  • NestJS catalogservice

Approach

Implementation decisions

  • Go
  • Java
  • Spring Boot
  • NestJS
  • Kafka
  • PostgreSQL
  • Terraform

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.

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.