How udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms works
Purpose and runtime
This repository is a Java/Spring Boot restaurant-listing microservice. It exposes restaurant data through a REST controller, applies service-layer logic, and persists entities through a Spring Data repository. The application entry point is src/main/java/com/codeddecode/restaurantlisting/RestaurantListingApplication.java.
API boundary
src/main/java/com/codeddecode/restaurantlisting/controller/RestaurantController.java is the inbound HTTP boundary. It accepts requests and returns API-facing restaurant representations rather than directly exposing persistence objects. This is the primary integration surface for callers.
Service orchestration
src/main/java/com/codeddecode/restaurantlisting/service/RestaurantService.java owns the application flow between controller, mapper, and repository. It is the appropriate boundary for business rules, lookup/create/update behavior, and translating persistence failures into API-level outcomes.
API and persistence models
The service separates transport and database representations:
• src/main/java/com/codeddecode/restaurantlisting/dto/RestaurantDTO.java defines the controller-facing data contract.
• src/main/java/com/codeddecode/restaurantlisting/entity/Restaurant.java is the persistence-domain model.
• src/main/java/com/codeddecode/restaurantlisting/mapper/RestaurantMapper.java converts between those representations.
Primary flow is HTTP request → controller → service → repository/entity persistence → mapper → DTO response.
Persistence boundary
src/main/java/com/codeddecode/restaurantlisting/repo/RestaurantRepo.java is the data-access abstraction, likely backed by the database configuration supplied through Spring Boot. The entity/repository boundary keeps storage concerns outside the HTTP and service layers.
Configuration and deployment
Spring environment configuration is split across:
• src/main/resources/application.yml
• src/main/resources/application-local.yml
• src/main/resources/application-dev.yml
The service is containerized by Dockerfile and deployed to Kubernetes through k8s/restaurantdepl.yml; k8s/azureingress.yml defines Azure-oriented ingress exposure. CI/CD infrastructure includes .github/workflows/ci.yml and Jenkinsfile, enabling either GitHub Actions or Jenkins pipelines.
Material dependencies and operational shape
The Maven build (pom.xml) governs the Java/Spring Boot runtime and dependency graph. At runtime, Spring manages controller/service/repository beans, profile-specific configuration, HTTP serving, and the external database connection implied by the persistence layer. Kubernetes and Azure ingress form the production hosting and traffic-entry boundary.
Main entry points: RestaurantListingApplication.java Application entry point · RestaurantService.java Restaurant service · RestaurantRepo.java Restaurant repository · RestaurantController.java Restaurant controller
Components 17
Spring Boot application
- Application entry point · Starts the managed HTTP and persistence runtime.
src/main/java/com/codeddecode/restaurantlisting/RestaurantListingApplication.java - Restaurant controller · Inbound HTTP boundary for restaurant APIs.
src/main/java/com/codeddecode/restaurantlisting/controller/RestaurantController.java - Restaurant service · Orchestrates API flow and business behavior.
src/main/java/com/codeddecode/restaurantlisting/service/RestaurantService.java - Restaurant DTO · Controller-facing restaurant representation.
src/main/java/com/codeddecode/restaurantlisting/dto/RestaurantDTO.java - Restaurant mapper · Converts API and persistence representations.
src/main/java/com/codeddecode/restaurantlisting/mapper/RestaurantMapper.java - Restaurant repository · Data-access abstraction for restaurants.
src/main/java/com/codeddecode/restaurantlisting/repo/RestaurantRepo.java - Restaurant entity · Database-domain restaurant model.
src/main/java/com/codeddecode/restaurantlisting/entity/Restaurant.java - Base configuration
src/main/resources/application.yml - Local profile config
src/main/resources/application-local.yml - Dev profile config
src/main/resources/application-dev.yml
Build and deployment
- Maven build · Defines Java and Spring Boot dependencies.
pom.xml - Container image
Dockerfile - Restaurant deployment
k8s/restaurantdepl.yml - Azure ingress · Production traffic entry boundary.
k8s/azureingress.yml - GitHub Actions CI
.github/workflows/ci.yml - Jenkins pipeline
Jenkinsfile
Other components
- External database · Storage reached through the Spring Data repository.
Connections 22
- Application entry point → Restaurant controller: manages
- Application entry point → Restaurant service: manages
- Application entry point → Restaurant repository: manages
- Base configuration → Application entry point: configures
- Local profile config → Application entry point: local profile
- Dev profile config → Application entry point: dev profile
- Restaurant controller → Restaurant service: delegates requests
- Restaurant controller → Restaurant DTO: accepts and returns
- Restaurant service → Restaurant repository: persists and queries
- Restaurant service → Restaurant mapper: maps models
- Restaurant mapper → Restaurant DTO: maps to/from
- Restaurant mapper → Restaurant entity: maps to/from
- Restaurant repository → Restaurant entity: manages
- Restaurant repository → External database: reads and writes
- Maven build → Application entry point: builds
- Container image → Application entry point: packages
- Restaurant deployment → Container image: runs
- Azure ingress → Restaurant deployment: routes traffic
- GitHub Actions CI → Maven build: builds
- Jenkins pipeline → Maven build: builds
- GitHub Actions CI → Container image: can publish
- Jenkins pipeline → Restaurant deployment: can deploy