|
55 | 55 |
|
56 | 56 | </p> |
57 | 57 |
|
| 58 | +# Spring Dynamic Microservices |
58 | 59 |
|
59 | | -#<h1 align="center">Spring Dynamic Microservices</h1># |
60 | 60 |
|
| 61 | +This is a comprehensive **Java-based microservices system** built with Spring Boot 3.x and Spring Cloud. It demonstrates dynamic service registration, routing, and payment processing using a modular architecture. The project includes CI integration with GitHub Actions and code quality checks with SonarCloud and JaCoCo. |
61 | 62 |
|
62 | | -**Project under construction** |
| 63 | +### Modules |
| 64 | + |
| 65 | +- `common-api` – Shared domain objects, constants, and utilities. |
| 66 | +- `eureka-server` – Service discovery server powered by Netflix Eureka. |
| 67 | +- `gateway-service` – Spring Cloud Gateway for dynamic routing and API exposure. |
| 68 | +- `payment-service-paypal` – PayPal-specific payment microservice. |
| 69 | +- `payment-service-stripe` – Stripe-specific payment microservice. |
| 70 | + |
| 71 | +### DevOps, CI/CD & Quality Tools |
| 72 | +``` |
| 73 | +
|
| 74 | +| Tool | Purpose | |
| 75 | +|---------------|--------------------------------| |
| 76 | +| GitHub Actions| CI/CD pipeline | |
| 77 | +| Docker | Containerization | |
| 78 | +| Docker Compose| Multi-container orchestration | |
| 79 | +| JaCoCo | Test coverage reports | |
| 80 | +| SonarCloud | Code quality, static analysis | |
| 81 | +``` |
| 82 | + |
| 83 | +### Testing |
| 84 | + |
| 85 | +- Unit testing with JUnit 5 |
| 86 | +- Controller testing using Spring’s `MockMvc` |
| 87 | +- Code coverage with JaCoCo (`target/site/jacoco/index.html`) |
| 88 | +- Test reports pushed to SonarCloud |
| 89 | + |
| 90 | +### Run Locally with Docker Compose |
| 91 | + |
| 92 | +##### Requirements: |
| 93 | +- Java 17 |
| 94 | +- Maven 3.x |
| 95 | +- Docker & Docker Compose |
| 96 | + |
| 97 | +##### Steps: |
| 98 | + |
| 99 | +```bash |
| 100 | +mvn clean install |
| 101 | +docker-compose up --build |
| 102 | +``` |
| 103 | + |
| 104 | +#### Service Access URLs |
| 105 | + |
| 106 | +Here are the main endpoints for accessing services in this dynamic microservices project: |
| 107 | + |
| 108 | +``` |
| 109 | +| Purpose | URL | |
| 110 | +|----------------------------------|------------------------------------------------------------------| |
| 111 | +| Eureka Dashboard | [http://localhost:8761](http://localhost:8761) | |
| 112 | +| PayPal Service (Direct Access) | [http://localhost:8082/hello](http://localhost:8082/hello) | |
| 113 | +| PayPal via Gateway | [http://localhost:8090/payment-service-paypal/hello] | |
| 114 | +| | (http://localhost:8090/payment-service-paypal/hello) | |
| 115 | +| Stripe Service (Direct Access) | [http://localhost:8083/hello](http://localhost:8083/hello) | |
| 116 | +| Stripe via Gateway | [http://localhost:8090/payment-service-stripe/hello] | |
| 117 | +| | (http://localhost:8090/payment-service-stripe/hello) | |
| 118 | +| Gateway Test Route | [http://localhost:8090/test/get](http://localhost:8090/test/get) | |
| 119 | +``` |
| 120 | + |
| 121 | +#### CI Workflow |
| 122 | + |
| 123 | +CI is triggered on push to `main`: |
| 124 | +- Builds all modules |
| 125 | +- Runs tests |
| 126 | +- Sends coverage to SonarCloud |
| 127 | +- Builds Docker images |
| 128 | +- Pushes to DockerHub (if configured) |
| 129 | + |
| 130 | +CI file: `.github/workflows/ci-all.yml` |
| 131 | + |
| 132 | +#### SonarCloud Dashboard |
| 133 | + |
| 134 | +View real-time static analysis and code coverage: |
| 135 | + |
| 136 | +- [Coverage Report](https://sonarcloud.io/summary/overall?id=vijayagopalsb_spring-dynamic-microservices) |
| 137 | +- [Code Quality](https://sonarcloud.io/summary/overall?id=vijayagopalsb_spring-dynamic-microservices) |
| 138 | + |
| 139 | +#### Author |
| 140 | + |
| 141 | +**Vijayagopal S** |
| 142 | +[GitHub](https://github.com/vijayagopalsb) |
| 143 | + |
| 144 | +#### License |
| 145 | + |
| 146 | +This project is licensed under the [MIT License](LICENSE). |
63 | 147 |
|
64 | | -This project contains a Spring Boot based microservices architecture with Eureka service discovery and Spring Cloud Gateway for dynamic routing. |
|
0 commit comments