Ride Tracking using Kafka banner

Ride Tracking using Kafka

5 devlogs
20h 1m 12s

This is my experimental project using Kafka, and to make it a real-world use case, I am implementing it for ride tracking with real-time monitoring from the admin portal.
My aim behind working on this is to get hands-on experience with Kafka arch…

This is my experimental project using Kafka, and to make it a real-world use case, I am implementing it for ride tracking with real-time monitoring from the admin portal.
My aim behind working on this is to get hands-on experience with Kafka architecture, producers implementation in different techs, along with consumers and topic-partition distribution.

Demo Repository

Loading README...

Darshan

After much much errors, now things are getting functional
For many days, i was struggling with websockets + async functions + kafka producers/consumers + deployment issues.
The issue was things worked well on localhost with ws:// but when deployed on railway or render.
So i switched from flask to fastapi in python and use create_task() for background tasks

Attachment
0
Darshan

ITS TIME FOR DEVLOG
Update : Completed the producer and consumer part of kafka from react native app and admin webpage.
.
.
Journey:

  • I faced a struggle in figuring out the actual and correct architecture for producer and consumer, but at last, after going to multiple YouTube videos and articles, I implemented websockets in Python Flask and a separate room for producing events, and a separate room for consuming location events
  • New challenge which arose later was running producer and consumer loop simultaneously and asynchronously… but later I switched to creating a separate thread for each consumer
  • At last, I created an admin dashboard to select a particular topic and consume events from it
Attachment
0
Darshan

Finally completed with both screens, i.e., “NEW RIDE” and “ACTIVE RIDE” in the app, So my next task is to keep producing events from driver app and monitor those from admin dashboard

Attachment
Attachment
0
Darshan

––UPDATION IN WORKFLOW––
Earlier, I decided to directly produce location events from the driver’s app (in react native) to kafka topic and then directly consume it into the admin portal (webpage) to monitor and track
BUT BUT BUT, I didn’t get any working module of Kafka which will be compatible with React Native.
So I went through 2-3 articles and found out the correct architecture, and accordingly I revised my plan,
Now the following is my work flow
Driver app(react native) —–connects, joins and sends loc events—> python–>websocket room–>kafka-topic—–stream events—>admin portal

Attachment
Attachment
0
Darshan

Due to new version release of Expo, I struggled a lot with project setup. I had to debug and research to solve many module version mismatches.
And the most time consuming and boring part is app prebuilding and bundling….Its always took long to assembleDebug and installDebug…
But after long, finally the project is free from all version mismatches and now runs smoothly

Attachment
0