How safak/microservices-kafka works
This repository compares three versions of a cart-checkout demo: a single Express backend, then service-based versions using Kafka. The visible user workflow is cart page → checkout request; in the microservice clients, checkout posts to the payment-service endpoint. The monolith route invokes authentication and then payment, analytics, order creation, and email helpers. Service implementations and Kafka consumers are represented as distinct components, but their event links are not shown by the available excerpts or SOURCE INDEX. The README is empty, so capability coverage is based on the source tree and index.
Main entry points: index.js Order API · app/page.jsx Cart Page · app/page.jsx Cart Page · Pay.jsx Checkout UI
Components 22
Monolith Version
- Cart Page
1-without-microservices/frontend/src/app/page.jsx - Checkout UI
1-without-microservices/frontend/src/components/Pay.jsx - Order API
1-without-microservices/backend/index.js - Auth Middleware
1-without-microservices/backend/middleware/auth.js - Order Operations
1-without-microservices/backend/db.js
Single Kafka Version
- Cart Page
2-microservices-single-kafka-server/services/client/src/app/page.jsx - Checkout UI
2-microservices-single-kafka-server/services/client/src/components/Pay.jsx - Payment Service
2-microservices-single-kafka-server/services/payment-service/index.js - Order Service
2-microservices-single-kafka-server/services/order-service/index.js - Email Service
2-microservices-single-kafka-server/services/email-service/index.js - Analytics Service
2-microservices-single-kafka-server/services/analytic-service/index.js - Topic Admin
2-microservices-single-kafka-server/services/kafka/admin.js - Kafka Broker
Kafka Cluster Version
- Cart Page
3-microservices-kafka-cluster/services/client/src/app/page.jsx - Checkout UI
3-microservices-kafka-cluster/services/client/src/components/Pay.jsx - Payment Service
3-microservices-kafka-cluster/services/payment-service/index.js - Order Service
3-microservices-kafka-cluster/services/order-service/index.js - Email Service
3-microservices-kafka-cluster/services/email-service/index.js - Analytics Service
3-microservices-kafka-cluster/services/analytic-service/index.js - Topic Admin
3-microservices-kafka-cluster/services/kafka/admin.js - Kafka Broker
Other components
- Shopper
Connections 12
- Shopper → Cart Page: views
- Cart Page → Checkout UI: renders
1-without-microservices/frontend/src/app/page.jsx - Order API → Auth Middleware: authenticates
1-without-microservices/backend/index.js - Order API → Order Operations: invokes operations
1-without-microservices/backend/index.js - Shopper → Cart Page: views
- Cart Page → Checkout UI: renders
- Checkout UI → Payment Service: posts cart
2-microservices-single-kafka-server/services/client/src/components/Pay.jsx - Topic Admin → Kafka Broker: creates topics
2-microservices-single-kafka-server/services/kafka/admin.js - Shopper → Cart Page: views
- Cart Page → Checkout UI: renders
- Checkout UI → Payment Service: posts cart
3-microservices-kafka-cluster/services/client/src/components/Pay.jsx - Topic Admin → Kafka Broker: creates topics
3-microservices-kafka-cluster/services/kafka/admin.js