During Alura's Kafka learning path, I developed some simple "e-commerce" modules in order to put into practice the Kafka learnings.
π‘ It's important to mention the focus here is to learn about Kafka, which means that you won't find very complicated business logic, okay?
So, let's navigate in this project π£ββοΈ
In this project I'm using a "monorepo" structure with the following components...
projects
ββ π§ kafka-core : Module that contains all kafka common code and dependencies.
ββ π¦ order-service : Orders service.
ββ π΅οΈββοΈ fraud-service : Fraud detector service.
ββ π§ email-service : Email service.
ββ π log-service : Service responsible for logging every message that happens in the system.
ββ βοΈ user-service : User service, responsible for storing the users.
Each component is a sub-project in this repository, also this structure enables us to isolate the modules, but also lets us reuse common code, which is what I did creating the kafka-core
.
π‘ Monorepo Inspiration
To create this project structure I used the "python-monorepo" repository as a reference, which is an amazing repository with very clear and didactic examples.
I do recommend you to have a look at @ya-mori's work.
π‘ Note
I did not create all the resources in the Alura Course, but I did the course until the end.
So I created a document containing the diagram with the rest of the architecture, new learnings and notes.
Document at Google Docs π
You just need to execute the services π
# Add the "-d" flag if you want to execute the services in background.
docker compose up
Then, to trigger the services, you have to do a HTTP POST request to the order service.
To shutdown the services, you just need to execute...
docker compose down
Development Guide
First of all, check the π Dev Setup π document.
There you will find all the instructions to prepare your machine.
π§ββοΈ "If in doubt Meriadoc, always follow your nose." - Gandalf