Skip to content

Conversation

@IanAleksandr
Copy link

General solution

  • Added two NestJS microservices: transaction-service (REST + PostgreSQL/Prisma + outbox) and anti-fraud-service (Kafka worker).
  • Implement Hexagonal architecture, shared Avro contracts, and Docker-based infrastructure (Postgres, Redpanda, Schema Registry) with multi-stage builds that bundle compiled code, Prisma artifacts, and contracts.
  • Ensure end-to-end flow: REST creation → outbox publish → Kafka message → anti-fraud decision → status update + secondary publish.

Highlights
Transaction Service

  • REST API with validation, Swagger docs, Prisma repositories, and outbox publisher.
  • Kafka publisher + schema registry integration; Prisma migrations and scripts for Docker runtime.
  • Comprehensive unit/e2e tests for domain logic, services, persistence, and messaging.

Anti-Fraud Service
Kafka consumer evaluating transactions with deterministic decision engine.
Publishes status-change events via schema registry, exposes health logging, and wires Logger/DI.
Unit tests for decision process and service behavior.

Platform & Tooling
Shared contracts/avro folder copied into both images.
README documents architecture, Docker workflows, troubleshooting, and manual verification steps.

Testing
cd transaction-service && npm test
cd anti-fraud-service && npm test
Also I made a manual end-to-end verification via docker compose build --no-cache && docker compose up, POST transaction from container, observe anti-fraud logs.

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