Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

avcaliani/kafka-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

59 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“« Kafka App

License

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 πŸš£β€β™‚οΈ

Project Structure

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.

Diagram

diagram

πŸ’‘ 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 πŸ“˜

How do I execute this project?

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.

docker-running

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