A Microservices-Based Ride-Hailing Platform Built with Spring Cloud
Architecture | Quick Start | Modules | Docs | Contributing
- Overview
- Architecture
- Service Breakdown
- Tech Stack
- Prerequisites
- Getting Started
- Service Ports
- Project Structure
- Sequence Diagrams
- Demo Screenshots
- Security Notes
- Contributing
- License
Rydr is a complete online taxi ordering system demonstrating enterprise-grade Spring Cloud microservices architecture. The platform supports the full ride-hailing workflow:
- Passenger: Registration, ride ordering, real-time tracking, payment
- Driver: Order listening, acceptance, dispatch, income tracking
- Platform: Pricing engine, SMS notifications, order management, monitoring
This project serves as a comprehensive reference for building microservices-based applications with Spring Cloud.
The system follows a three-layer microservices architecture:
┌──────────────────────────────────────────────────────────────┐
│ API Gateway (Zuul :9100) │
├──────────────┬───────────────┬───────────────────────────────┤
│ api-passenger│ api-driver │ api-listen-order │ ← API Layer
│ :9011 │ :9002-9003 │ :8084 │
├──────────────┴───────────────┴───────────────────────────────┤
│ service-order │ service-sms │ service-valuation │ ... │ ← Service Layer
│ :8004-8005 │ :8002-8003 │ :8060-8061 │ │
├──────────────────────────────────────────────────────────────┤
│ Eureka :7900 │ Config :6001 │ Admin :6010 │ Zipkin :9411 │ ← Infrastructure
└──────────────────────────────────────────────────────────────┘
│ │ │ │
┌────┴────┐ ┌────┴────┐ ┌────┴────┐ ┌────┴────┐
│ MySQL │ │ Redis │ │RabbitMQ │ │ActiveMQ │
└─────────┘ └─────────┘ └─────────┘ └─────────┘
| Pattern | Technology | Use Case |
|---|---|---|
| Declarative HTTP | OpenFeign + Hystrix | api-passenger → service-valuation |
| Load-balanced HTTP | RestTemplate + Ribbon | api-driver → service-sms |
| Service Discovery | Netflix Eureka | All services register and discover |
| Real-time Push | WebSocket | Driver order listening |
| Async Messaging | ActiveMQ (JMS) | Background task processing |
| Config Refresh | RabbitMQ (Spring Cloud Bus) | Dynamic configuration updates |
| Module | Project Name | Port | Description |
|---|---|---|---|
| Passenger API | api-passenger |
9011 | Passenger-facing endpoints (orders, auth, profile) |
| Driver API | api-driver |
9002-9003 | Driver-facing endpoints (grab orders, status) |
| Order Listener | api-listen-order |
8084 | Real-time order events via WebSocket |
| Module | Project Name | Port | Description |
|---|---|---|---|
| Order | service-order |
8004-8005 | Order lifecycle & distributed locking |
| Dispatch | service-order-dispatch |
8005 | Driver-order matching algorithm |
| Passenger | service-passenger-user |
8012 | Registration, profiles, addresses |
| SMS | service-sms |
8002-8003 | SMS notification delivery |
| Valuation | service-valuation |
8060-8061 | Ride pricing & fare calculation |
| Verification | service-verification-code |
8011 | Login verification codes |
| Wallet | service-wallet |
8006 | Balance management |
| Module | Project Name | Port | Description |
|---|---|---|---|
| Service Registry | eureka |
7900 | Netflix Eureka |
| Config Server | rydr-config-server |
6001 | Centralized configuration |
| API Gateway | rydr-zuul |
9100 | Zuul routing & filtering |
| Circuit Breaker | hystrix-dashboard |
6101 | Hystrix monitoring |
| Admin Monitor | cloud-admin |
6010 | Spring Boot Admin |
| Module | Project Name | Description |
|---|---|---|
| Common | rydr-common |
DTOs, constants, JWT utilities, validation |
| Category | Technology |
|---|---|
| Framework | Spring Boot 2.1.7 + Spring Cloud Greenwich |
| Service Discovery | Netflix Eureka |
| API Gateway | Netflix Zuul |
| Load Balancing | Netflix Ribbon |
| Circuit Breaker | Netflix Hystrix |
| Inter-Service Calls | OpenFeign |
| Database | MySQL 5.7+ with Druid Connection Pool |
| ORM | MyBatis |
| Caching | Redis (with Sentinel support) |
| Messaging | ActiveMQ (JMS) |
| Config Management | Spring Cloud Config + RabbitMQ Bus |
| Distributed Tracing | Spring Cloud Sleuth + Zipkin |
| Authentication | JWT |
| Real-time | WebSocket |
| Build Tool | Maven 3.x |
- Java 8+
- Maven 3.x
- MySQL 5.7+
- Redis 4.0+
- ActiveMQ (optional, for JMS features)
- RabbitMQ (optional, for config bus)
git clone https://github.com/OiPunk/Rydr.git
cd Rydrcp .env.example .env
# Edit .env with your valuesKey variables:
| Variable | Description | Default |
|---|---|---|
DB_HOST |
MySQL host | localhost |
DB_PORT |
MySQL port | 3306 |
DB_USER |
MySQL username | root |
DB_PASSWORD |
MySQL password | changeme |
REDIS_HOST |
Redis host | 127.0.0.1 |
EUREKA_USER |
Eureka auth username | admin |
EUREKA_PASSWORD |
Eureka auth password | changeme |
JWT_SECRET |
JWT signing secret | (generate one) |
See
.env.examplefor the full list of configurable variables.
mysql -u root -p < rydr-sql.sqlThe SQL file creates 108 tables covering orders, passengers, drivers, payments, configuration, and more.
# 1. Service Registry
cd rydr/eureka && mvn spring-boot:run -Dspring.profiles.active=7900
# 2. Config Server (optional)
cd rydr/rydr-config-server && mvn spring-boot:run
# 3. Business Services
cd rydr/service-passenger-user && mvn spring-boot:run
cd rydr/service-sms && mvn spring-boot:run -Dspring.profiles.active=8002
cd rydr/service-verification-code && mvn spring-boot:run
cd rydr/service-order && mvn spring-boot:run -Dspring.profiles.active=8004
cd rydr/service-valuation && mvn spring-boot:run -Dspring.profiles.active=8060
# 4. API Layer
cd rydr/api-passenger && mvn spring-boot:run
cd rydr/api-driver && mvn spring-boot:run -Dspring.profiles.active=9002
# 5. API Gateway
cd rydr/rydr-zuul && mvn spring-boot:run| Service | Port(s) |
|---|---|
| Eureka Registry | 7900 |
| Config Server | 6001 |
| Cloud Admin | 6010 |
| API Gateway (Zuul) | 9100 |
| API Passenger | 9011 |
| API Driver | 9002, 9003 |
| API Listen Order | 8084 |
| Service Passenger User | 8012 |
| Service SMS | 8002, 8003 |
| Service Order | 8004, 8005 |
| Service Valuation | 8060, 8061 |
| Service Verification | 8011 |
| Service Wallet | 8006 |
| Service Order Dispatch | 8005 |
| Demo App | 8083 |
| Hystrix Dashboard | 6101 |
Rydr/
├── rydr/ # Maven parent project
│ ├── api-driver/ # Driver API
│ ├── api-listen-order/ # Order listener API
│ ├── api-passenger/ # Passenger API
│ ├── cloud-admin/ # Spring Boot Admin
│ ├── config-client/ # Config client example
│ ├── config-client-diy/ # Custom config client
│ ├── eureka/ # Eureka service registry
│ ├── hystrix-dashboard/ # Hystrix dashboard
│ ├── rydr-common/ # Shared library
│ ├── rydr-config-server/ # Config server
│ ├── rydr-demo-app/ # Demo application
│ ├── rydr-zuul/ # API gateway
│ ├── service-jms-consumer/ # JMS consumer example
│ ├── service-jms-produce/ # JMS producer example
│ ├── service-order/ # Order service
│ ├── service-order-dispatch/ # Dispatch service
│ ├── service-passenger-user/ # Passenger service
│ ├── service-sms/ # SMS service
│ ├── service-valuation/ # Valuation service
│ ├── service-verification-code/ # Verification service
│ └── service-wallet/ # Wallet service
├── README/ # Documentation images
├── docs/ # Additional documentation
├── rydr-sql.sql # Database schema (108 tables)
├── .env.example # Environment config template
├── .gitignore # Git ignore rules
├── CONTRIBUTING.md # Contribution guidelines
├── LICENSE # MIT License
└── README.md # This file
- All sensitive credentials are externalized via environment variables
- Never commit
.envfiles or any file containing real credentials - The JWT secret must be changed from the default in production
- Eureka endpoints are protected with basic authentication
- Review
management.endpoints.web.exposuresettings before deploying to production - See
.env.examplefor the complete list of security-related variables
Contributions are welcome! Please read the Contributing Guide before submitting a pull request.
This project is licensed under the MIT License.












