DEV Community

Amalia Hajarani
Amalia Hajarani

Posted on

Lokomotif: Use Case for Learning About Spring Boot, Node.js, Kafka, SQL Database, No SQL Database (Use Case Introduction)

Hi for whoever reads this post. I'm a beginner who is trying to write whatever things I've learned. Since it's going to be a long one, I would split my learning journey into several posts.

In this first post I will explain the whole picture about this Lokomotif Use Case. As you can see below, I created about 4 services.

Data Flow

But before diving deeper into those 4 services, I'd like to share a sample of the random data locomotive:

{
    "kodeLoko": "64341",
    "namaLoko": "Ecuador",
    "dimensiLoko": "03",
    "status": "8",
    "createdDate": "2023-11-20T06:32:10"
}
Enter fullscreen mode Exit fullscreen mode

And now, this what each service does:

  1. Spring Boot: Scheduler Info is a service that I use to create a random locomotive data for every 10 seconds and act as a Kafka producer to send those random data. It's a bit overkill that I use Spring Quartz as a scheduler for this service.

  2. Node.Js is a service that act as a kafka consumer and save every message of random locomotive data into the famous no-sql database: MongoDB.

  3. Spring Boot: Scheduler Report is a service that responsible to create summary from the locomotive data saved at MongoDB, that was made for the last 24 hours and send it over to Telegram (using bot, of course) and produce API for the client-side service.

  4. React-Vite is a simple user interface to see the statistic of locomotive based in its status.

And for the implementation of every service, kindly follow this series.

Top comments (0)