# keerthikumarn/food-ordering-portal architecture

> Architecture diagram of the GitHub repository keerthikumarn/food-ordering-portal, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/keerthikumarn/food-ordering-portal
- Repository: https://github.com/keerthikumarn/food-ordering-portal

## Overview

##### Project type and purpose
- This is a Spring-Boot and Maven-based microservices project implementing a “Food Ordering Portal.”
- It consists of four modules:
- eureka-service (service registry)
- usermanagement-service (user CRUD)
- restaurant-listing (restaurant info)
- food-menu (menu items)

##### File structure
- Each module is a standalone Spring Boot application (has its own pom.xml, src/main/java, src/main/resources/application.properties).
- Common package layering in each service: controller → dto/entity → mapper → service → repo.
- No single frontend or gateway module present; services likely expose REST APIs directly.

##### README
- Very brief: “Food ordering portal.”
- No built-in frontend or API Gateway.

##### Main components
a. eureka-service
- Acts as the Netflix Eureka server (service registry)
b. usermanagement-service
- Exposes endpoints for User operations
- Persists data to its own database
c. restaurant-listing-service
- Manages restaurant metadata
- Own database
d. food-menu-service
- Manages menu items, links to restaurants
- Own database
e. Client (e.g., Browser or Mobile App)
- Consumes REST APIs

##### Relationships and interactions
- On startup, each microservice registers itself with Eureka.
- The client discovers service instances via Eureka (or a future API Gateway).
- Client → (via load-balancer) → service’s REST controller → service layer → repository → database.
- Services may call one another for composite operations (e.g., an ordering service could call usermanagement & food-menu), but that’s out of scope.

##### Architectural patterns and principles
- Microservices pattern: small, independently deployable Spring Boot apps
- Layered (onion) architecture within each service (Controller → Service → Repository)
- Service Discovery (Eureka) for dynamic resolution and load balancing
- Each service encloses its own datastore (database-per-service) for data autonomy

##### Relevant technologies and frameworks
- Spring Boot (starter-web, spring-data-jpa)
- Netflix Eureka (spring-cloud-netflix-eureka-server / client)
- Maven for build and dependency management
- JPA/Hibernate for persistence
- RESTful APIs using Spring MVC controllers

##### Details to capture
- Service names and ports (if known, e.g., 8761 for Eureka)
- The fact that each .properties file configures its database datasource
- Future extension points: API Gateway, messaging bus, external payment service

## Diagram (Mermaid)

```mermaid
flowchart TD
    Client["Client (Browser/Mobile App)"]:::client

    subgraph "Service Registry (Eureka) (8761)"
        EurekaApp["EurekaServiceApplication"]:::infra
        EurekaConfig["application.properties"]:::infra
        EurekaPom["pom.xml"]:::infra
    end

    subgraph "User Management Service"
        UMApp["UsermanagementServiceApplication"]:::user
        UMController["UserController"]:::user
        UMDTO["UserDTO"]:::user
        UMEntity["User (Entity)"]:::user
        UMMapper["UserMapper"]:::user
        UMService["UserService"]:::user
        UMServiceImpl["UserServiceImpl"]:::user
        UMRepo["UserRepository"]:::user
        UMConfig["application.properties"]:::user
        UMPom["pom.xml"]:::user
    end
    UserDB["UserDB"]:::db

    subgraph "Restaurant Listing Service"
        RLApp["RestaurantListingServiceApplication"]:::rest
        RLController["RestaurantListingController"]:::rest
        RLDTO["RestaurantDTO"]:::rest
        RLEntity["Restaurant (Entity)"]:::rest
        RLMapper["RestaurantMapper"]:::rest
        RLService["RestaurantService"]:::rest
        RLServiceImpl["RestaurantServiceImpl"]:::rest
        RLRepo["RestaurantRepository"]:::rest
        RLConfig["application.properties"]:::rest
        RLPom["pom.xml"]:::rest
    end
    RestaurantDB["RestaurantDB"]:::db

    subgraph "Food Menu Service"
        FMApp["FoodMenuApplication"]:::menu
        FMController["FoodMenuController"]:::menu
        FMDTO1["FoodItemDTO"]:::menu
        FMDTO2["FoodMenuDTO"]:::menu
        FMDTO3["RestaurantDTO"]:::menu
        FMEntity["FoodItem (Entity)"]:::menu
        FMMapper["FoodItemMapper"]:::menu
        FMService["FoodMenuService"]:::menu
        FMRepo["FoodItemRepository"]:::menu
        FMConfig["application.properties"]:::menu
        FMPom["pom.xml"]:::menu
    end
    FoodMenuDB["FoodMenuDB"]:::db

    Client -->|"Service Lookup"| EurekaApp
    Client -->|"REST"| UMApp
    Client -->|"REST"| RLApp
    Client -->|"REST"| FMApp

    EurekaApp -->|"Service Registration"| UMApp
    EurekaApp -->|"Service Registration"| RLApp
    EurekaApp -->|"Service Registration"| FMApp

    UMApp -->|"calls"| UMController
    UMController -->|"calls"| UMService
    UMService -->|"calls"| UMServiceImpl
    UMServiceImpl -->|"uses"| UMRepo
    UMRepo -->|"JPA"| UserDB

    RLApp -->|"calls"| RLController
    RLController -->|"calls"| RLService
    RLService -->|"calls"| RLServiceImpl
    RLServiceImpl -->|"uses"| RLRepo
    RLRepo -->|"JPA"| RestaurantDB

    FMApp -->|"calls"| FMController
    FMController -->|"calls"| FMService
    FMService -->|"uses"| FMRepo
    FMRepo -->|"JPA"| FoodMenuDB

    click EurekaApp "https://github.com/keerthikumarn/food-ordering-portal/blob/main/eureka-service/src/main/java/com/eureka/service/EurekaServiceApplication.java"
    click EurekaConfig "https://github.com/keerthikumarn/food-ordering-portal/blob/main/eureka-service/src/main/resources/application.properties"
    click EurekaPom "https://github.com/keerthikumarn/food-ordering-portal/blob/main/eureka-service/pom.xml"

    click UMApp "https://github.com/keerthikumarn/food-ordering-portal/blob/main/usermanagement-service/src/main/java/com/user/management/UsermanagementServiceApplication.java"
    click UMController "https://github.com/keerthikumarn/food-ordering-portal/blob/main/usermanagement-service/src/main/java/com/user/management/controller/UserController.java"
    click UMDTO "https://github.com/keerthikumarn/food-ordering-portal/blob/main/usermanagement-service/src/main/java/com/user/management/dto/UserDTO.java"
    click UMEntity "https://github.com/keerthikumarn/food-ordering-portal/blob/main/usermanagement-service/src/main/java/com/user/management/entity/User.java"
    click UMMapper "https://github.com/keerthikumarn/food-ordering-portal/blob/main/usermanagement-service/src/main/java/com/user/management/mapper/UserMapper.java"
    click UMService "https://github.com/keerthikumarn/food-ordering-portal/blob/main/usermanagement-service/src/main/java/com/user/management/service/UserService.java"
    click UMServiceImpl "https://github.com/keerthikumarn/food-ordering-portal/blob/main/usermanagement-service/src/main/java/com/user/management/service/impl/UserServiceImpl.java"
    click UMRepo "https://github.com/keerthikumarn/food-ordering-portal/blob/main/usermanagement-service/src/main/java/com/user/management/repo/UserRepository.java"
    click UMConfig "https://github.com/keerthikumarn/food-ordering-portal/blob/main/usermanagement-service/src/main/resources/application.properties"
    click UMPom "https://github.com/keerthikumarn/food-ordering-portal/blob/main/usermanagement-service/pom.xml"

    click RLApp "https://github.com/keerthikumarn/food-ordering-portal/blob/main/restaurant-listing/src/main/java/com/restaurant/listing/RestaurantListingServiceApplication.java"
    click RLController "https://github.com/keerthikumarn/food-ordering-portal/blob/main/restaurant-listing/src/main/java/com/restaurant/listing/controller/RestaurantListingController.java"
    click RLDTO "https://github.com/keerthikumarn/food-ordering-portal/blob/main/restaurant-listing/src/main/java/com/restaurant/listing/dto/RestaurantDTO.java"
    click RLEntity "https://github.com/keerthikumarn/food-ordering-portal/blob/main/restaurant-listing/src/main/java/com/restaurant/listing/entity/Restaurant.java"
    click RLMapper "https://github.com/keerthikumarn/food-ordering-portal/blob/main/restaurant-listing/src/main/java/com/restaurant/listing/mapper/RestaurantMapper.java"
    click RLService "https://github.com/keerthikumarn/food-ordering-portal/blob/main/restaurant-listing/src/main/java/com/restaurant/listing/service/RestaurantService.java"
    click RLServiceImpl "https://github.com/keerthikumarn/food-ordering-portal/blob/main/restaurant-listing/src/main/java/com/restaurant/listing/service/impl/RestaurantServiceImpl.java"
    click RLRepo "https://github.com/keerthikumarn/food-ordering-portal/blob/main/restaurant-listing/src/main/java/com/restaurant/listing/repo/RestaurantRepository.java"
    click RLConfig "https://github.com/keerthikumarn/food-ordering-portal/blob/main/restaurant-listing/src/main/resources/application.properties"
    click RLPom "https://github.com/keerthikumarn/food-ordering-portal/blob/main/restaurant-listing/pom.xml"

    click FMApp "https://github.com/keerthikumarn/food-ordering-portal/blob/main/food-menu/src/main/java/com/food/menu/FoodMenuApplication.java"
    click FMController "https://github.com/keerthikumarn/food-ordering-portal/blob/main/food-menu/src/main/java/com/food/menu/controller/FoodMenuController.java"
    click FMDTO1 "https://github.com/keerthikumarn/food-ordering-portal/blob/main/food-menu/src/main/java/com/food/menu/dto/FoodItemDTO.java"
    click FMDTO2 "https://github.com/keerthikumarn/food-ordering-portal/blob/main/food-menu/src/main/java/com/food/menu/dto/FoodMenuDTO.java"
    click FMDTO3 "https://github.com/keerthikumarn/food-ordering-portal/blob/main/food-menu/src/main/java/com/food/menu/dto/RestaurantDTO.java"
    click FMEntity "https://github.com/keerthikumarn/food-ordering-portal/blob/main/food-menu/src/main/java/com/food/menu/entity/FoodItem.java"
    click FMMapper "https://github.com/keerthikumarn/food-ordering-portal/blob/main/food-menu/src/main/java/com/food/menu/mapper/FoodItemMapper.java"
    click FMService "https://github.com/keerthikumarn/food-ordering-portal/blob/main/food-menu/src/main/java/com/food/menu/service/FoodMenuService.java"
    click FMRepo "https://github.com/keerthikumarn/food-ordering-portal/blob/main/food-menu/src/main/java/com/food/menu/repo/FoodItemRepository.java"
    click FMConfig "https://github.com/keerthikumarn/food-ordering-portal/blob/main/food-menu/src/main/resources/application.properties"
    click FMPom "https://github.com/keerthikumarn/food-ordering-portal/blob/main/food-menu/pom.xml"

    classDef infra fill:#f9f,stroke:#333,stroke-width:1px;
    classDef client fill:#bbf,stroke:#333,stroke-width:1px;
    classDef user fill:#bfb,stroke:#333,stroke-width:1px;
    classDef rest fill:#ffb,stroke:#333,stroke-width:1px;
    classDef menu fill:#fbf,stroke:#333,stroke-width:1px;
    classDef db fill:#eee,stroke:#333,stroke-width:1px;
```
