https://github.com/dassudip2001/micro-services
Spring Cloud Microservices Demo
https://github.com/dassudip2001/micro-services
angular java microservice springboot
Last synced: 6 days ago
JSON representation
Spring Cloud Microservices Demo
- Host: GitHub
- URL: https://github.com/dassudip2001/micro-services
- Owner: dassudip2001
- Created: 2025-01-20T05:52:23.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2026-05-04T05:15:10.000Z (about 2 months ago)
- Last Synced: 2026-05-04T07:20:03.467Z (about 2 months ago)
- Topics: angular, java, microservice, springboot
- Language: HTML
- Homepage:
- Size: 122 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Spring Cloud Microservices Demo
This repository contains a small Spring Boot microservices sample with:
- `api-eureka` — Eureka service registry
- `api-application` — REST API service registered as `user-service`
- `api-gateway` — Spring Cloud Gateway routing requests to `user-service`
## Architecture
1. `api-eureka` runs on port `8761` and provides service discovery.
2. `api-application` registers with Eureka and exposes user endpoints on port `8081`.
3. `api-gateway` runs on port `8080` and forwards `/users/**` traffic to `user-service`.
## Prerequisites
- Java 17
- Maven (the project includes Maven wrappers)
- Internet access to download Spring Boot and Spring Cloud dependencies
## Run the services
Start the services in this order:
1. Start Eureka:
cd api-eureka
./mvnw spring-boot:run
2. Start the API application:
cd ../api-application
./mvnw spring-boot:run
3. Start the gateway:
cd ../api-gateway
./mvnw spring-boot:run
> On Windows, use `mvnw.cmd` instead of `./mvnw`.
## Accessing the services
- Eureka dashboard: `http://localhost:8761`
- Gateway endpoint: `http://localhost:8080/users`
- Application endpoint: `http://localhost:8081`
## Build
From the repo root, you can build each module separately:
```bash
cd api-eureka && ./mvnw clean package
cd ../api-application && ./mvnw clean package
cd ../api-gateway && ./mvnw clean package
```
Or build a single module from its folder.
## Tests
Run unit tests per module:
```bash
cd api-eureka && ./mvnw test
cd ../api-application && ./mvnw test
cd ../api-gateway && ./mvnw test
```
## Notes
- `api-gateway` uses Spring Cloud Gateway with a route to `lb://USER-SERVICE`.
- `api-application` registers as `user-service`, matching the gateway route.
- `api-eureka` is configured as a standalone Eureka server and does not register itself.
## Repository layout
- `api-eureka/` — Eureka registry service
- `api-gateway/` — gateway service
- `api-application/` — backend user service