A production-grade event-driven microservices project inspired by Uber, built with Spring Boot, Kafka, Eureka, Gateway, Zipkin, Prometheus/Grafana, Redis, and Postgres.
- API Gateway (Spring Cloud Gateway + JWT Security + Resilience4j)
- Discovery Server (Eureka Service Registry)
- User Service (Postgres + JPA)
- Driver Service (Postgres + JPA)
- Ride Service (Postgres + Kafka producer/consumer)
- Matching Service (Kafka consumer/producer for driver assignment)
- Payment Service (Postgres + Kafka consumer/producer)
- Tracking Service (Redis for live driver tracking)
- Notification Service (Kafka consumer, logs notifications)
- Ride requested → published by ride-service
- Consumed by matching-service → driver assigned
- Driver assignment consumed by ride-service → ride started
- Ride completed → published by ride-service
- Consumed by payment-service → payment created
- Consumed by notification-service → notification sent
✅ Microservices with service discovery & load balancing
✅ Secure Gateway with JWT Authentication
✅ Kafka event-driven communication between services
✅ Distributed tracing with Zipkin (traceId across HTTP + Kafka)
✅ Metrics & monitoring with Prometheus + Grafana
✅ Resilience4j Circuit Breakers & fallback in API Gateway
✅ Redis caching for driver tracking
✅ PostgreSQL persistence with JPA + Flyway migrations
✅ Centralized logging & observability
- Spring Boot 3, Spring Cloud
- Postgres, Redis
- Apache Kafka
- Zipkin, Micrometer, Prometheus, Grafana
- Resilience4j
- Docker (optional, can run locally)
- JUnit/Testcontainers for integration tests
Make sure you have:
- Postgres running on:
- user-service →
5432 - driver-service →
5433 - ride-service →
5434 - payment-service →
5435
- user-service →
- Redis on
localhost:6379 - Kafka broker on
localhost:29092 - Zipkin on
http://localhost:9411 - Prometheus on
http://localhost:9090 - Grafana on
http://localhost:3000
These can be started with
docker-compose -f infra/docker-compose.yml up.
One command 🚀:
./run-all.sh
---Create User
curl -X POST http://localhost:8080/api/users \
-H "Content-Type: application/json" \
-d '{"name":"Alice","email":"alice@mail.com"}'Request Ride
curl -X POST http://localhost:8080/api/rides \
-H "Authorization: Bearer <JWT>" \
-H "Content-Type: application/json" \
-d '{"userId":1,"startLocation":"A","endLocation":"B"}'Kafka Event Flow
ride-service → matching-service → ride-service → payment-service → notification-serviceComplete Ride
curl -X PATCH http://localhost:8080/api/rides/{id}/complete \
-H "Authorization: Bearer <JWT>"- Kafka UnknownHost → use
localhost:29092(host) vskafka:9092(Docker) - JWT Weak Key → use
Keys.secretKeyFor(SignatureAlgorithm.HS256) - DB Connection Refused → check Postgres container ports +
spring.datasource.url - Prometheus scrape errors → verify
/actuator/prometheusendpoint
Shows all services (user, driver, ride, payment, matching, tracking, notification) registered with discovery.
Custom dashboards for API latency, Kafka throughput, and JVM metrics.
Scraping from all microservices via /actuator/prometheus.
End-to-end trace of a ride request across Gateway → Ride → Matching → Payment → Notification.








