# udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms architecture

> Architecture diagram of the GitHub repository udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms
- Repository: https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms

## Overview

#### 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: [`src/main/java/com/codeddecode/restaurantlisting/RestaurantListingApplication.java`](https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/java/com/codeddecode/restaurantlisting/RestaurantListingApplication.java) (Application entry point), [`src/main/java/com/codeddecode/restaurantlisting/service/RestaurantService.java`](https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/java/com/codeddecode/restaurantlisting/service/RestaurantService.java) (Restaurant service), [`src/main/java/com/codeddecode/restaurantlisting/repo/RestaurantRepo.java`](https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/java/com/codeddecode/restaurantlisting/repo/RestaurantRepo.java) (Restaurant repository), [`src/main/java/com/codeddecode/restaurantlisting/controller/RestaurantController.java`](https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/java/com/codeddecode/restaurantlisting/controller/RestaurantController.java) (Restaurant controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Spring Boot application"]
  node_app{{"Application entry point<br/>Spring Boot bootstrap"}}
  node_controller["Restaurant controller<br/>REST controller"]
  node_service["Restaurant service<br/>application service"]
  node_dto["Restaurant DTO<br/>API contract<br/>[RestaurantDTO.java]"]
  node_mapper["Restaurant mapper<br/>model mapper"]
  node_repository["Restaurant repository<br/>Spring Data repository"]
  node_entity["Restaurant entity<br/>persistence model<br/>[Restaurant.java]"]
  node_base_config["Base configuration<br/>Spring configuration<br/>[application.yml]"]
  node_local_config["Local profile config<br/>Spring profile configuration"]
  node_dev_config["Dev profile config<br/>Spring profile configuration"]
end

subgraph group_delivery["Build and deployment"]
  node_maven["Maven build<br/>build definition<br/>[pom.xml]"]
  node_container["Container image<br/>Docker build"]
  node_kubernetes{{"Restaurant deployment<br/>Kubernetes deployment<br/>[restaurantdepl.yml]"}}
  node_ingress{{"Azure ingress<br/>Kubernetes ingress<br/>[azureingress.yml]"}}
  node_github_ci["GitHub Actions CI<br/>CI pipeline<br/>[ci.yml]"]
  node_jenkins["Jenkins pipeline<br/>CI/CD pipeline"]
end

node_database[("External database")]

node_app -->|"manages"| node_controller
node_app -->|"manages"| node_service
node_app -->|"manages"| node_repository
node_base_config -->|"configures"| node_app
node_local_config -.->|"local profile"| node_app
node_dev_config -.->|"dev profile"| node_app
node_controller -->|"delegates requests"| node_service
node_controller -->|"accepts and returns"| node_dto
node_service -->|"persists and queries"| node_repository
node_service -->|"maps models"| node_mapper
node_mapper -->|"maps to/from"| node_dto
node_mapper -->|"maps to/from"| node_entity
node_repository -->|"manages"| node_entity
node_repository -->|"reads and writes"| node_database
node_maven -->|"builds"| node_app
node_container -->|"packages"| node_app
node_kubernetes -->|"runs"| node_container
node_ingress -->|"routes traffic"| node_kubernetes
node_github_ci -.->|"builds"| node_maven
node_jenkins -.->|"builds"| node_maven
node_github_ci -.->|"can publish"| node_container
node_jenkins -.->|"can deploy"| node_kubernetes

click node_app "https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/java/com/codeddecode/restaurantlisting/RestaurantListingApplication.java"
click node_controller "https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/java/com/codeddecode/restaurantlisting/controller/RestaurantController.java"
click node_service "https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/java/com/codeddecode/restaurantlisting/service/RestaurantService.java"
click node_dto "https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/java/com/codeddecode/restaurantlisting/dto/RestaurantDTO.java"
click node_mapper "https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/java/com/codeddecode/restaurantlisting/mapper/RestaurantMapper.java"
click node_repository "https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/java/com/codeddecode/restaurantlisting/repo/RestaurantRepo.java"
click node_entity "https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/java/com/codeddecode/restaurantlisting/entity/Restaurant.java"
click node_base_config "https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/resources/application.yml"
click node_local_config "https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/resources/application-local.yml"
click node_dev_config "https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/resources/application-dev.yml"
click node_maven "https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/pom.xml"
click node_container "https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/Dockerfile"
click node_kubernetes "https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/k8s/restaurantdepl.yml"
click node_ingress "https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/k8s/azureingress.yml"
click node_github_ci "https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/.github/workflows/ci.yml"
click node_jenkins "https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/Jenkinsfile"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_controller,node_service,node_dto,node_mapper,node_repository,node_entity,node_base_config,node_local_config,node_dev_config toneBlue
class node_maven,node_container,node_kubernetes,node_ingress,node_github_ci,node_jenkins toneAmber
class node_database toneNeutral
```

## Components

### Spring Boot application

- [Application entry point](https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/java/com/codeddecode/restaurantlisting/RestaurantListingApplication.java): Spring Boot bootstrap · Starts the managed HTTP and persistence runtime. · `src/main/java/com/codeddecode/restaurantlisting/RestaurantListingApplication.java`
- [Restaurant controller](https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/java/com/codeddecode/restaurantlisting/controller/RestaurantController.java): REST controller · Inbound HTTP boundary for restaurant APIs. · `src/main/java/com/codeddecode/restaurantlisting/controller/RestaurantController.java`
- [Restaurant service](https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/java/com/codeddecode/restaurantlisting/service/RestaurantService.java): application service · Orchestrates API flow and business behavior. · `src/main/java/com/codeddecode/restaurantlisting/service/RestaurantService.java`
- [Restaurant DTO](https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/java/com/codeddecode/restaurantlisting/dto/RestaurantDTO.java): API contract · Controller-facing restaurant representation. · `src/main/java/com/codeddecode/restaurantlisting/dto/RestaurantDTO.java`
- [Restaurant mapper](https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/java/com/codeddecode/restaurantlisting/mapper/RestaurantMapper.java): model mapper · Converts API and persistence representations. · `src/main/java/com/codeddecode/restaurantlisting/mapper/RestaurantMapper.java`
- [Restaurant repository](https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/java/com/codeddecode/restaurantlisting/repo/RestaurantRepo.java): Spring Data repository · Data-access abstraction for restaurants. · `src/main/java/com/codeddecode/restaurantlisting/repo/RestaurantRepo.java`
- [Restaurant entity](https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/java/com/codeddecode/restaurantlisting/entity/Restaurant.java): persistence model · Database-domain restaurant model. · `src/main/java/com/codeddecode/restaurantlisting/entity/Restaurant.java`
- [Base configuration](https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/resources/application.yml): Spring configuration · `src/main/resources/application.yml`
- [Local profile config](https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/resources/application-local.yml): Spring profile configuration · `src/main/resources/application-local.yml`
- [Dev profile config](https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/src/main/resources/application-dev.yml): Spring profile configuration · `src/main/resources/application-dev.yml`

### Build and deployment

- [Maven build](https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/pom.xml): build definition · Defines Java and Spring Boot dependencies. · `pom.xml`
- [Container image](https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/Dockerfile): Docker build · `Dockerfile`
- [Restaurant deployment](https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/k8s/restaurantdepl.yml): Kubernetes deployment · `k8s/restaurantdepl.yml`
- [Azure ingress](https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/k8s/azureingress.yml): Kubernetes ingress · Production traffic entry boundary. · `k8s/azureingress.yml`
- [GitHub Actions CI](https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/.github/workflows/ci.yml): CI pipeline · `.github/workflows/ci.yml`
- [Jenkins pipeline](https://github.com/udemy-dev-withk8s-aws-codedecode/restaurant-listing-ms/blob/master/Jenkinsfile): CI/CD pipeline · `Jenkinsfile`

### Other components

- **External database**: database · Storage reached through the Spring Data repository.

## Connections

- 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
