This project demonstrates a microservices architecture using Spring Boot. It consists of the following core services:
- API Gateway: Handles routing of client requests to the appropriate microservice.
- Discovery Server: Service registry for dynamic discovery of microservices (typically using Eureka).
- Order Service: Manages order-related operations.
- User Service: Manages user-related operations.
- Spring Boot is used for rapid application development.
- Eureka Discovery Server enables service registration and discovery.
- API Gateway (Spring Cloud Gateway or Zuul) routes requests to backend services.
- Each service is a separate Gradle project/module.
api-gateway/ # API Gateway service
order-service/ # Order management microservice
user-service/ # User management microservice
discovery-server/ # Eureka Discovery Server
- Java 17 or later
- Gradle 7.x or later
- Clone the repository
git clone <your-repo-url> cd springboot-microservices
- Build all services
./gradlew build
- Run the Discovery Server first
cd discovery-server ./gradlew bootRun - Run the API Gateway
cd ../api-gateway ./gradlew bootRun - Run the Order and User Services
cd ../order-service ./gradlew bootRun # In a new terminal: cd ../user-service ./gradlew bootRun
- Access the API Gateway at
http://localhost:<gateway-port> - Eureka dashboard is available at
http://localhost:<eureka-port>/ - Update
application.propertiesorapplication.ymlin each service to configure ports and service names as needed.
- Fork the repository
- Create a new branch (
git checkout -b feature/your-feature) - Commit your changes
- Push to your branch
- Open a pull request
This project is licensed under the MIT License.