How devxsb/spring-boot-microservices works
Main Components Identified
• Config Server: Centralized configuration management (located in the “config-server” directory).
• Eureka Server: Service discovery/registry (located in the “eureka-server” directory).
• API Gateway: Acts as the entry point for client requests and routes them to the appropriate microservice (found in the “gateway” directory).
• Auth Service: Handles registration, login, and JWT-based authentication/authorization (in the “auth-service” directory).
• User Service: Manages user-related operations (in the “user-service” directory).
• Job Service: Manages job, advert, and offer related functionalities (in the “job-service” directory).
• Notification Service: Handles notifications using Kafka messaging (in the “notification-service” directory).
• File Storage: Manages file upload/download functionalities for file handling (in the “file-storage” directory).
• Additional supporting components such as Kafka, Redis, PostgreSQL, Docker Compose configuration (docker-compose.yml) and additional configuration files.
Relationships and Interactions
• The API Gateway routes incoming HTTP requests to the appropriate services (e.g., auth, user, job, etc.). All external calls pass through this gateway.
• Service Discovery is handled by the Eureka Server, allowing microservices to register on startup and discover each other dynamically.
• The Config Server provides services with a centralized configuration, ensuring consistency across all services.
• Authentication and Authorization are handled via JWT tokens — services check these tokens (e.g., auth-service, gateway, user-service) to secure endpoints.
• Messaging integration exists (e.g., Kafka in the Notification Service) to send and process asynchronous notifications.
• File Storage is a dedicated service that manages file/content-related operations and integrates with other services via Feign clients.
Architectural Patterns and Design Principles
• Microservices architecture: Each major domain function is isolated as its own service.
• API Gateway pattern: The gateway centralizes entry, authentication, and routing concerns.
• Service Discovery and Centralized Configuration: Eureka and Config Server manage service registrations and settings.
• Client-to-Server Communication: Use of Feign Clients (as seen in multiple service directories) to enable inter-service REST calls.
• Asynchronous Communication: Use of Kafka for messaging in the notification service.
• Security is implemented via Spring Security and JWT for both authentication and authorization.
• Containerization and orchestration: Docker Compose is used to launch services concurrently.
Technologies and Frameworks Impacting the Design
• Spring Boot and Spring Cloud technologies for building the microservices.
• Netflix Eureka for service discovery.
• Spring Cloud Gateway to act as the API Gateway.
• Spring Cloud Config for centralized configurations.
• PostgreSQL as the relational database.
• Kafka for message brokering (notification service).
• Redis for caching (as mentioned in the README).
• Docker for containerization.
• Clear labels for each microservice with its name (e.g., “Auth Service”, “User Service”, etc.).
• To include any relevant middleware (Kafka, Redis) alongside their connecting microservice(s).