How sansukumar57-dev/saloonmicroservice works
Purpose and topology
This is a salon-domain microservice system. Independent Maven/Spring Boot applications own users/authentication, salons, categories, service offerings, bookings, payments, API ingress, and service discovery. Each deployable has its own pom.xml, application entry class, and application.yml; orchestration is present at docker-compose/default/docker-compose.yaml.
Entry points and edge boundary
The primary client-facing boundary is the gateway, started by gateway-server/src/main/java/com/xyz/gateway_server/GatewayServerApplication.java. Its security layer is defined in gateway-server/src/main/java/com/xyz/gateway_server/config/SecurityConfig.java and maps Keycloak identity/roles through gateway-server/src/main/java/com/xyz/gateway_server/config/KeyCloakConverter.java. Domain services expose REST controllers rather than sharing a single application process.
Discovery and runtime infrastructure
eureka-server/src/main/java/com/xyz/eureka_server/EurekaServerApplication.java is the service-discovery runtime. Service-specific runtime wiring resides in each service’s src/main/resources/application.yml, including eureka-server/src/main/resources/application.yml and gateway-server/src/main/resources/application.yml. The repository is Java/Maven based, with Spring Boot application entry points, and uses Docker Compose for local multi-service deployment.
Identity and user ownership
The service project is the user/authentication service. service/src/main/java/com/Salone/service/controller/AuthController.java handles authentication-facing endpoints, while service/src/main/java/com/Salone/service/service/iml/AuthServiceImpl.java implements auth behavior and service/src/main/java/com/Salone/service/service/KeycloackService.java marks an external Keycloak integration boundary. User persistence is owned by service/src/main/java/com/Salone/service/model/User.java and service/src/main/java/com/Salone/service/repository/UserRepository.java.
Salon catalog domains
Salon ownership is isolated in salonService, with API/service/persistence layers at salonService/src/main/java/com/xyz/salonService/controller/SalonController.java, salonService/src/main/java/com/xyz/salonService/service/impl/SalonServiceImpl.java, and salonService/src/main/java/com/xyz/salonService/repository/SalonRepository.java. It has an explicit synchronous user-service client at salonService/src/main/java/com/xyz/salonService/service/client/UserFeignClient.java.
Categories and offered services are separate bounded services: category management is centered on catagory_microservice/src/main/java/com/xyz/catagory_microservice/controller/CategoryController.java and catagory_microservice/src/main/java/com/xyz/catagory_microservice/model/Category.java; service offerings on service-offering/src/main/java/com/xyz/service_offering/controller/ServiceOfferingController.java and service-offering/src/main/java/com/xyz/service_offering/model/ServiceOffering.java. Their salon-specific controllers indicate associations are managed at each domain boundary.
Booking workflow
booking-service owns booking records and lifecycle state: booking-service/src/main/java/com/xyz/booking_service/controller/BookingController.java, booking-service/src/main/java/com/xyz/booking_service/service/impl/BookingServiceImpl.java, and booking-service/src/main/java/com/xyz/booking_service/model/Booking.java. booking-service/src/main/java/com/xyz/booking_service/domain/BookingStatus.java defines booking state, while request/response translation is separated through booking-service/src/main/java/com/xyz/booking_service/dto/BookingRequest.java and booking-service/src/main/java/com/xyz/booking_service/mapper/BookingMapper.java. DTOs for salons, users, categories, and offerings imply cross-service data is exchanged as representations rather than shared entities.
Payment workflow
payment-service owns payment-order persistence and status: payment-service/src/main/java/com/xyz/payment_service/controller/PaymentController.java, payment-service/src/main/java/com/xyz/payment_service/model/PaymentOrder.java, and payment-service/src/main/java/com/xyz/payment_service/repository/PaymentOrderRepository.java. Its service implementation, payment-service/src/main/java/com/xyz/payment_service/service/impl/PaymemtServiceImpl.java, produces payment-service/src/main/java/com/xyz/payment_service/payload/response/PaymentLinkResponse.java, indicating a payment-link handoff boundary. Payment methods and order state are modeled independently in payment-service/src/main/java/com/xyz/payment_service/domain/PaymentMethod.java and payment-service/src/main/java/com/xyz/payment_service/domain/PaymentOrderStatus.java.
Main entry points: GatewayServerApplication.java API Gateway · BookingServiceImpl.java Booking Lifecycle · AuthController.java Auth API · AuthServiceImpl.java Auth Service
Components 20
Edge & Discovery
- API Gateway · Primary client-facing API boundary.
gateway-server/src/main/java/com/xyz/gateway_server/GatewayServerApplication.java - Gateway Security · Applies Keycloak identity and role mapping.
gateway-server/src/main/java/com/xyz/gateway_server/config/SecurityConfig.java - Keycloak Converter
gateway-server/src/main/java/com/xyz/gateway_server/config/KeyCloakConverter.java - Eureka Server
eureka-server/src/main/java/com/xyz/eureka_server/EurekaServerApplication.java
Identity
- Auth API
service/src/main/java/com/Salone/service/controller/AuthController.java - Auth Service
service/src/main/java/com/Salone/service/service/iml/AuthServiceImpl.java - Keycloak
service/src/main/java/com/Salone/service/service/KeycloackService.java - Users · User ownership and repository boundary.
service/src/main/java/com/Salone/service/repository/UserRepository.java
Salon Catalog
- Salon API
salonService/src/main/java/com/xyz/salonService/controller/SalonController.java - Salon Service
salonService/src/main/java/com/xyz/salonService/service/impl/SalonServiceImpl.java - Salons
salonService/src/main/java/com/xyz/salonService/repository/SalonRepository.java - Categories · Owns category associations.
catagory_microservice/src/main/java/com/xyz/catagory_microservice/controller/CategoryController.java - Service Offerings · Owns offered-service associations.
service-offering/src/main/java/com/xyz/service_offering/controller/ServiceOfferingController.java
Booking & Payments
- Booking API
booking-service/src/main/java/com/xyz/booking_service/controller/BookingController.java - Booking Lifecycle · Maps booking requests and manages booking status.
booking-service/src/main/java/com/xyz/booking_service/service/impl/BookingServiceImpl.java - Bookings
booking-service/src/main/java/com/xyz/booking_service/model/Booking.java - Payment API
payment-service/src/main/java/com/xyz/payment_service/controller/PaymentController.java - Payment Service · Creates payment-link handoffs and manages order status.
payment-service/src/main/java/com/xyz/payment_service/service/impl/PaymemtServiceImpl.java - Payment Orders
payment-service/src/main/java/com/xyz/payment_service/repository/PaymentOrderRepository.java
Other components
- Docker Compose · Runs the multi-service stack locally.
docker-compose/default/docker-compose.yaml
Connections 25
- Docker Compose → API Gateway: runs
- Docker Compose → Eureka Server: runs
- API Gateway → Gateway Security: enforces
- Gateway Security → Keycloak Converter: uses
- API Gateway → Eureka Server: discovers services via
- API Gateway → Auth API: routes to
- API Gateway → Salon API: routes to
- API Gateway → Categories: routes to
- API Gateway → Service Offerings: routes to
- API Gateway → Booking API: routes to
- API Gateway → Payment API: routes to
- Auth API → Auth Service: delegates to
- Auth Service → Keycloak: integrates with
- Auth Service → Users: owns
- Salon API → Salon Service: delegates to
- Salon Service → Salons: persists
- Salon Service → Auth API: user lookup · Synchronous Feign client call.
- Booking API → Booking Lifecycle: delegates to
- Booking Lifecycle → Bookings: persists
- Booking Lifecycle → Salon API: exchanges salon representation
- Booking Lifecycle → Service Offerings: exchanges offering representation
- Booking Lifecycle → Categories: exchanges category representation
- Booking Lifecycle → Auth API: exchanges user representation
- Payment API → Payment Service: delegates to
- Payment Service → Payment Orders: persists