The reference Firefly Framework Go service. Demonstrates:
- The five-package layout (
interfaces,models,core,web,sdk) startercore.New(...)one-call composition- CQRS dispatch with validation + query caching
- Idempotency replay on
POST /api/v1/orders - RFC 7807
application/problem+jsonerror rendering - Correlation-id propagation
- Startup banner
go run ./samples/orders/webcurl -X POST http://localhost:8080/api/v1/orders \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: order-1' \
-d '{"customer":"alice","sku":"SKU-1","quantity":2,"total":19.99}'Repeat the same request — the server returns Idempotent-Replay: true
with the originally captured response.
curl http://localhost:8080/api/v1/orders/<id>The first hit goes to the handler; subsequent reads within 30 s are
served from the CQRS query cache (GetOrderQuery.CacheTTL()).
cd samples/orders && go test ./...Boots the full stack via BuildHandler() against httptest.NewServer
and asserts on the wire shape.
docker build -t orders-web -f samples/orders/web/Dockerfile .
docker run -p 8080:8080 orders-web