Skip to content

Mohitmhatre32/logistics-event-streaming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌍 Real-Time Logistics Event Streaming Platform

A production-grade event-driven microservices system for real-time supply chain telemetry — inspired by architectures used at Uber, Maersk, and FedEx.

This platform showcases scalable ingestion, stream processing, and live monitoring using Kafka, Spring Boot, MongoDB, and WebSockets.


🚀 Tech Stack

Java Spring Boot Kafka MongoDB Docker


🏗️ System Architecture

The system is composed of loosely-coupled microservices communicating via Kafka and observed in real time through a WebSocket dashboard.

1. API Gateway (Port 8080)

  • Entry point for all client requests
  • Uses Spring Cloud Gateway for routing
  • Works as a reverse proxy / traffic controller

2. Tracking Service — Producer (Port 8081)

  • High-speed REST ingestion service
  • Converts telemetry into events
  • Publishes events to Kafka topics

3. Processor Service — Consumer (Port 8082)

  • Subscribes to Kafka events
  • Performs validation & processing
  • Stores history into MongoDB
  • Sends live data updates via WebSockets

4. Real-Time Dashboard

  • WebSocket-powered
  • Live cards and status indicators
  • Displays speed, temperature, fuel & location

✨ Key Features

Real-Time Visualization on WebSockets
Smart Telemetry (Temperature, Speed, Fuel)
Kafka Event Streaming to absorb traffic spikes
Polyglot Persistence (Kafka + MongoDB)
Cloud-Native Architecture using Docker Compose


🛠️ Local Setup & Installation

1. Prerequisites

  • Docker Desktop
  • Java 21
  • Maven

2. Start Infrastructure

Runs Kafka, Zookeeper, and MongoDB:

docker-compose up -d

3. Start Microservices (in order)

Service Port Command
Tracking Service 8081 Run TrackingServiceApplication
Processor Service 8082 Run TrackingProcessorApplication
API Gateway 8080 Run ApiGatewayApplication

4. Open Real-Time Dashboard

5. Send Test Telemetry

  • Use Postman or curl:
 POST http://localhost:8080/api/v1/tracking
   Content-Type: application/json
   {
 "shipmentId": "VACCINE-BOX-01",
 "latitude": 40.7128,
 "longitude": -74.0060,
 "status": "IN_TRANSIT",
 "temperature": -5.0,
 "speed": 80.0,
 "fuelLevel": 90.0
 }

📁 Project Structure

    📦 project-root
    ├── api-gateway/           # Spring Cloud Gateway
    ├── tracking-service/      # REST → Kafka producer
    ├── tracking-processor/    # Kafka consumer → Mongo/WebSocket
    ├── docker-compose.yml     # Infrastructure setup
    └── README.md

⭐ Future Enhancements

  • Add Prometheus + Grafana monitoring
  • Add distributed tracing with OpenTelemetry
  • Add GeoJSON map-based visualization

About

Real-time Event-Driven Microservices architecture for supply chain telemetry. Built with Spring Boot 3, Apache Kafka, MongoDB, API Gateway, and WebSockets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors