# manu05x/microsevicespringboot architecture

> Architecture diagram of the GitHub repository manu05x/microsevicespringboot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/manu05x/microsevicespringboot
- Repository: https://github.com/manu05x/microsevicespringboot

## Overview

##### Main Components
- Microservices:
- Food Catalogue Microservice (FoodCatalogueMicroservice): Contains controllers, DTOs, entities, mappers, services, and repositories.
- Order Microservice (OrderMS): Implements order-related logic with controllers, DTOs for orders and food items, entities, repositories, and service layers.
- User Information Microservice (UserInformation): Manages user data with its dedicated controller, DTOs, entities, mappers, and service.
- Restaurant Listing / Restaurant Microservice (restaurantListing): Handles restaurant data, structured similarly to other services.
- Service Discovery:
- Eureka: Acts as the service registry, enabling dynamic discovery and communication among the microservices.
- Frontend:
- Food Delivery Application (food-delivery-app): This Angular-based project serves as the client/user interface.
- Infrastructure/Deployment:
- Deployment scripts and configurations (deployment-folder and Notes) for AWS, Docker, and Kubernetes, which guide the containerization and orchestration of these services.

##### Relationships and Interactions Between Components
- The Angular “food-delivery-app” front end interacts with the backend microservices through REST API calls. It might use an API gateway pattern if one exists (or connect directly by consulting the Eureka service registry).
- All microservices are built using Spring Boot. They expose RESTful endpoints (e.g., FoodCatalogueController, OrderController, UserController, RestaurantController) that the front-end consumes.
- Eureka provides service registration and discovery. Each microservice registers itself with Eureka, and the client or any inter-service communication may use Eureka to locate services.
- The services internally use a layered design pattern (controller → service → repository) for business logic separation and database interaction (even if actual database configuration isn’t visible in the file structure, the presence of repository and entity directories indicate persistence layers).
- Given the separate configuration files (application-{env}.yml and properties files), each microservice is environment-aware and can be configured differently depending on the deployment environment.

##### Architectural Patterns and Design Principles
- Microservices Architecture: Each service is independently deployable; they follow a common pattern with clear separation of concerns.
- Layered (or n-tier) design: Each service contains controllers, services, repositories, and DTO layers that encapsulate presentation, business logic, data access, and data abstraction respectively.
- Containerization: Dockerfiles in each microservice and the presence of Kubernetes manifests show that these services are packaged as containers and managed through orchestration tools.
- Service Discovery: The Eureka server is key to allowing dynamic client and inter-service communication.

##### Elements
- Components:
- Angular Frontend (“food-delivery-app”)
- Food Catalogue Microservice (with its internal layers: Controller, Service, Repository, etc.)
- Order Microservice (similarly broken down)
- User Information Microservice
- Restaurant Listing Microservice
- Eureka Server (Service Discovery)
- Deployment/Infrastructure Layer (Docker, Kubernetes cluster, AWS cloud)
- Optionally, indicate intra-service communication if one microservice might directly call another (e.g., OrderMS could call FoodCatalogue).
- Visual Distinctions:
- Differentiate between frontend, backend, and infrastructural elements.
- Additional Notations:
- Annotations highlighting technologies (Spring Boot, Angular, Docker, Kubernetes, AWS) and configuration details from the deployment manifests.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Frontend Layer"
        FE["Food Delivery App (Angular)"]:::frontend
    end

    subgraph "Backend Microservices"
        FC["Food Catalogue Microservice (Spring Boot)"]:::backend
        OM["Order Microservice (Spring Boot)"]:::backend
        UI["User Information Microservice (Spring Boot)"]:::backend
        RL["Restaurant Listing Microservice (Spring Boot)"]:::backend
    end

    subgraph "Service Discovery"
        Eureka["Eureka Server (Service Registry)"]:::registry
    end

    subgraph "Infrastructure/Deployment"
        DS["Deployment Scripts (Docker,K8s,AWS)"]:::infrastructure
        NT["Deployment Notes"]:::infrastructure
    end

    %% Frontend to Backend REST calls
    FE -->|"REST"| FC
    FE -->|"REST"| OM
    FE -->|"REST"| UI
    FE -->|"REST"| RL

    %% Microservices register with Eureka (bidirectional)
    FC <-->|"Register"| Eureka
    OM <-->|"Register"| Eureka
    UI <-->|"Register"| Eureka
    RL <-->|"Register"| Eureka

    %% Intra-service communication: OrderMS calls FoodCatalogueMicroservice
    OM -->|"calls_FoodCatalogue"| FC

    %% Deployment: Deployment Scripts deploy all components
    DS -.->|"Deploys"| FE
    DS -.->|"Deploys"| FC
    DS -.->|"Deploys"| OM
    DS -.->|"Deploys"| UI
    DS -.->|"Deploys"| RL
    DS -.->|"Deploys"| Eureka

    %% Deployment Scripts connected to Deployment Notes
    DS -->|"Docs"| NT

    %% Click Events
    click FE "https://github.com/manu05x/microsevicespringboot/tree/main/food-delivery-app"
    click FC "https://github.com/manu05x/microsevicespringboot/tree/main/FoodCatalogueMicroservice"
    click OM "https://github.com/manu05x/microsevicespringboot/tree/main/OrderMS"
    click UI "https://github.com/manu05x/microsevicespringboot/tree/main/UserInformation"
    click RL "https://github.com/manu05x/microsevicespringboot/tree/main/restaurantListing"
    click Eureka "https://github.com/manu05x/microsevicespringboot/tree/main/eureka"
    click DS "https://github.com/manu05x/microsevicespringboot/tree/main/deployment-folder"
    click NT "https://github.com/manu05x/microsevicespringboot/tree/main/Notes"

    %% Styles
    classDef frontend fill:#a7d7c5,stroke:#333,stroke-width:2px;
    classDef backend fill:#f4a582,stroke:#333,stroke-width:2px;
    classDef registry fill:#91bfdb,stroke:#333,stroke-width:2px;
    classDef infrastructure fill:#d8bfd8,stroke:#333,stroke-width:2px;
```
