Skip to content

feat: G4-G6 infrastructure (observability, Kafka, Temporal, Kamal)#11

Open
maurcarvalho wants to merge 1 commit into
mainfrom
feature/g4-g6-infrastructure
Open

feat: G4-G6 infrastructure (observability, Kafka, Temporal, Kamal)#11
maurcarvalho wants to merge 1 commit into
mainfrom
feature/g4-g6-infrastructure

Conversation

@maurcarvalho
Copy link
Copy Markdown
Owner

Summary

Closes the gap between thesis G4-G6 code listings and the actual Tiny Store codebase. Every file path and code listing referenced in the thesis now exists in the repo.

G6 — Observability

  • libs/shared/infrastructure/src/observability/ — module-scoped logger, metrics factory, tracer, trace propagation
  • infra/prometheus/alerts.yml — module-scoped Prometheus alert rules
  • infra/prometheus/prometheus.yml — scrape config
  • infra/grafana/dashboards/module-overview.json — 4-row per-module dashboard (request rate, error rate, p95 latency)
  • infra/grafana/provisioning/dashboards.yml

G4 — Migration Readiness

  • libs/modules/orders/src/gateways/inventory-gateway.ts — Anti-Corruption Layer pattern (InventoryGateway interface + InProcessInventoryGateway)
  • libs/modules/orders/src/workflows/ — Temporal SDK saga (order-fulfillment workflow with compensating actions)
  • libs/shared/infrastructure/src/messaging/kafka-event-publisher.ts — KafkaJS publisher with W3C trace context header injection

G5 — Deployment Strategy

  • docker-compose.yml — 11 services (api, postgres, redis, zookeeper, kafka, temporal, temporal-ui, jaeger, prometheus, grafana)
  • docker-compose.l3.yml — extended with full infra + orders-service extraction
  • .github/workflows/ci.yml — GitHub Actions with nx affected
  • apps/api/Dockerfile — production multi-stage build
  • config/deploy.yml — Kamal deployment (Traefik + Let's Encrypt SSL)
  • .kamal/secrets

Dependencies Added

  • @opentelemetry/api
  • kafkajs
  • @temporalio/client, @temporalio/worker, @temporalio/workflow, @temporalio/activity

Verification

  • 238/238 tests pass ✅
  • 9/9 lint pass ✅
  • Zero changes to domain logic, entities, events, or repositories
  • CLAUDE.md updated with G4-G6 infrastructure section

… Kamal, docker-compose)

- G6: Add observability library (module-scoped logger, metrics, tracer, trace propagation)
- G6: Add Prometheus alert rules and Grafana dashboard configs
- G4: Add InventoryGateway (Anti-Corruption Layer pattern)
- G4: Add order fulfillment workflow with Temporal SDK + compensating actions
- G4: Add KafkaEventPublisher (optional event transport)
- G5: Expand docker-compose.yml to 11 services (postgres, redis, kafka, temporal, jaeger, prometheus, grafana)
- G5: Add GitHub Actions CI workflow with nx affected
- G5: Add Kamal deployment config (config/deploy.yml)
- G5: Update docker-compose.l3.yml with full infrastructure
- G5: Add api Dockerfile

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant