EXPERT◫ Full-Stack6-8hMilan
Event-Driven Payment Processor
Build a complete event-driven payment processing system: on-chain events trigger domain workflows, which update state, emit domain events, and project read models. Combines blockchain indexing with DDD and event-driven architecture. This is the closest project to Gnosis Pay's actual backend architecture.
Tech Stack
GoPostgreSQLEvent sourcingCQRSgo-ethereumMessage queue (channels/NATS)
What You'll Learn
- →Event-driven architecture with domain events
- →Event sourcing for payment state reconstruction
- →CQRS with separate read/write stores
- →Saga pattern for distributed transaction coordination
- →Exactly-once processing with outbox pattern
Milestones (0/6)
M2On-chain event ingestion
M3Read model projections
M4Saga: payment authorization flow
M5Outbox pattern & exactly-once delivery
M6Integration tests & observability
Architecture Hints
Architecture
This is the Gnosis Pay backend pattern:
- On-chain events (card swipes) trigger domain workflows
- Event sourcing provides complete audit trail (compliance)
- CQRS separates read performance from write consistency
- Sagas coordinate multi-step payment flows
- Outbox pattern ensures no events are lost
Gnosis Chain
│
▼
┌──────────────┐ ┌─────────────┐ ┌──────────────┐
│ Chain │───▶│ Command │───▶│ Event │
│ Listener │ │ Handler │ │ Store (PG) │
└──────────────┘ └─────────────┘ └──────┬───────┘
│
┌─────────────┐ ┌───────▼──────┐
│ Outbox │◀───│ Outbox │
│ Publisher │ │ Table │
└──────┬──────┘ └──────────────┘
│
┌────────────┼────────────┐
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│Projection│ │ Saga │ │ Notif │
│(read DB) │ │ Engine │ │ Service │
└──────────┘ └──────────┘ └──────────┘
│
▼
┌──────────┐
│ REST API │
└──────────┘Interview Talking Points
- ▸Walk through how a card payment flows through this system end-to-end
- ▸Explain event sourcing trade-offs: why it's worth the complexity for payments
- ▸Discuss the outbox pattern and why it's superior to dual-write (event store + message queue)
- ▸Talk about saga compensation — what happens when step 3 of 5 fails?
- ▸Explain how this architecture enables compliance auditing and event replay