How thiagogenez/labflow works
LabFlow is an event-driven shop application, currently implementing checkout, order storage, payments, and a simulated card provider. The primary workflow is browser tokenization, order checkout and payment, then publishing an order event through an outbox to a broker. The README also describes future reconciliation and event consumers; those are shown as planned or target-design components, not inspected implementations. Edges reflect the excerpts and explicit README relationships; some documented target-flow links are marked dashed because they are not yet implemented.
Main entry points: order-api/main.go Order API · outbox.go Outbox Relay · handler.go Order Routes · payment-api/main.go Payment API
Components 23
Checkout and Orders
- Order API
services/order-api/main.go - Order Routes
services/order-api/internal/order/handler.go - Catalogue and Pricing
services/order-api/internal/order/pricing.go - Order Service
services/order-api/internal/order/service.go - Order Store
services/order-api/internal/order/store.go - Order Access Tokens
services/order-api/internal/order/token.go - Shipping Quotes
services
Payments
- Payment API
services/payment-api/main.go - Payment Service
services/payment-api/internal/payment/service.go - Provider Client
services/payment-api/internal/payment/provider.go - Payment Store
services/payment-api/internal/payment/store.go - PSP Simulator
services/psp-simulator/main.go - PSP API and Cards
services/psp-simulator/internal/psp/handler.go - PSP Store
services/psp-simulator/internal/psp/store.go - Payment Reconciliation
services/order-api
Events and Consumers
- Outbox Relay
libs/go/outbox/outbox.go - RabbitMQ Broker
- Event Contracts
contracts/events - Inventory, Email, Analytics
services
Shared Runtime
- HTTP Server
libs/go/httpserver/httpserver.go - Idempotency Middleware
libs/go/idempotency/idempotency.go - PostgreSQL
Other components
- Shopper / Browser
Connections 30
- Shopper / Browser → PSP Simulator: requests token
README.md - Shopper / Browser → Order API: submits checkout
README.md - Order API → Order Routes: registers routes
services/order-api/main.go - Order Routes → Order Service: handles orders
- Order Service → Catalogue and Pricing: prices items
- Order Service → Order Store: stores orders
- Order Routes → Order Access Tokens: validates access
- Order API → HTTP Server: serves routes
services/order-api/main.go - Order API → PostgreSQL: connects database
services/order-api/main.go - Order API → Idempotency Middleware: creates store
services/order-api/main.go - Order Routes → Idempotency Middleware: uses middleware
- Order API → Payment API: charges order
README.md - Order API → Shipping Quotes: requests quote
README.md - Order API → Payment Reconciliation: reconciles charges
README.md - Order API → Outbox Relay: starts relay
services/order-api/main.go - Order Store → Outbox Relay: writes events
services/order-api/internal/order/store.go - Outbox Relay → RabbitMQ Broker: publishes events
libs/go/outbox/outbox.go - Outbox Relay → PostgreSQL: reads pending events
libs/go/outbox/outbox.go - Outbox Relay → Event Contracts: publishes order event
README.md - RabbitMQ Broker → Inventory, Email, Analytics: delivers events
README.md - Payment API → Payment Service: constructs service
services/payment-api/main.go - Payment API → HTTP Server: serves routes
services/payment-api/main.go - Payment API → PostgreSQL: connects database
services/payment-api/main.go - Payment Service → Provider Client: calls provider
- Payment Service → Payment Store: stores payments
- Provider Client → PSP Simulator: charges token
README.md - PSP Simulator → PSP API and Cards: registers API
services/psp-simulator/main.go - PSP API and Cards → PSP Store: creates charges
- PSP API and Cards → PostgreSQL: persists provider state
- PSP API and Cards → Shopper / Browser: returns token
README.md