How shabbirdwd53/springboot-3-microservices works
Project Type and Purpose
• This is a Spring Boot 3 microservices system demonstrating a typical cloud-native architecture.
• It consists of:
• Service Registry (Eureka) for discovery
• Config Server for centralized configuration
• API Gateway for request routing
• Two domain services: Department Service & Employee Service
Main Components
a. Service Registry (service-registry)
b. Config Server (config-server)
c. API Gateway (api-gateway)
d. Department Service (department-service)
e. Employee Service (employee-service)
f. Databases (one per domain service)
g. External Client (e.g., Web UI or Postman)
Relationships and Data Flows
• On startup, all microservices register themselves with Eureka (service-registry).
• Config Server fetches its YAML files from its local “config” repo and serves config over HTTP.
• The API Gateway exposes REST endpoints to external clients, discovers backends via Eureka, and forwards requests.
→ Client → API Gateway (Route) → Department or Employee Service.
• Department Service calls Employee Service using a WebClient-based client.
• Each domain service persists data to its own database (e.g., MySQL or H2).
Architectural Patterns and Design Principles
• Service Discovery pattern (Eureka)
• Externalized Configuration (Spring Cloud Config)
• API Gateway pattern (Spring Cloud Gateway)
• Client-side load balancing (via DiscoveryClient in gateway and WebClient in services)
• Single Responsibility per microservice
• Decentralized Data Management (one database per service)
Key Technologies and Frameworks
• Spring Boot 3
• Spring Cloud Netflix Eureka (Service Registry)
• Spring Cloud Config Server (Centralized Config)
• Spring Cloud Gateway (API Gateway)
• Spring WebFlux / WebClient (Inter-service calls)
• Spring Data JPA (Repository layer)
• YAML configuration files
• Maven for build
Layered View (optional)
• Top Layer: External Client
• Edge Layer: API Gateway
• Service Layer: Department Service, Employee Service
• Infrastructure Layer: Service Registry, Config Server
• Data Layer: Department DB, Employee DB
Detail to Capture
• Startup sequence: how services discover and fetch config
• Runtime request flow: client → gateway → service → service → database
• Configuration paths (e.g., “/department-service/default” from Config Server)
• Inter-service dependency: Department Service’s EmployeeClient