# abhilashroyal29-afk/microservices_abhilash architecture

> Architecture diagram of the GitHub repository abhilashroyal29-afk/microservices_abhilash, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abhilashroyal29-afk/microservices_abhilash
- Repository: https://github.com/abhilashroyal29-afk/microservices_abhilash

## Overview

#### Purpose and Runtime
This repository contains two independently buildable Java/Spring Boot microservices: Order Service and User Service. Each Maven module has its own wrapper, POM, application bootstrap, resources, and compiled output. There is no gateway, shared library, container configuration, or orchestration definition shown.

#### Service Entry Points
Spring Boot starts each service through:
- `Order-Service/src/main/java/com/microservice/order/OrderServiceApplication.java`
- `User-Service/src/main/java/com/microservice/user/UserServiceApplication.java`

Runtime properties are service-local:
- `Order-Service/src/main/resources/application.properties`
- `User-Service/src/main/resources/application.properties`

Maven build boundaries are `Order-Service/pom.xml` and `User-Service/pom.xml`.

#### Order API and Processing
Order-facing HTTP requests enter `Order-Service/src/main/java/com/microservice/order/controller/OrderController.java`, which delegates business operations to `Order-Service/src/main/java/com/microservice/order/service/OrderService.java`.

The order domain is represented by `Order-Service/src/main/java/com/microservice/order/entity/Order.java`; responses are shaped separately through `Order-Service/src/main/java/com/microservice/order/dto/OrderResponse.java`. This separates internal order state from the controller’s external response contract.

#### Order-to-User Dependency Boundary
Order Service explicitly models unavailability of User Service via `Order-Service/src/main/java/com/microservice/order/exception/UserServiceUnavailableException.java`. Application wiring or client-related configuration is centralized in `Order-Service/src/main/java/com/microservice/order/config/AppConfig.java`.

The intended control flow is: request → order controller → order service → user-service dependency/validation → order response or translated failure. The precise transport/client implementation is not visible in the tree, but the exception establishes a material cross-service dependency.

#### User API and Domain
User-facing requests enter `User-Service/src/main/java/com/microservice/user/controller/UserController.java` and flow into `User-Service/src/main/java/com/microservice/user/service/UserService.java`.

User persistence/domain state is modeled by `User-Service/src/main/java/com/microservice/user/entity/User.java`, while API transfer data is represented by `User-Service/src/main/java/com/microservice/user/dto/UserDto.java`. Missing-user behavior is an explicit domain boundary in `User-Service/src/main/java/com/microservice/user/exception/UserNotFoundException.java`.

#### Error and API Boundaries
Each service owns global exception translation at its HTTP boundary:
- `Order-Service/src/main/java/com/microservice/order/exception/GlobalExceptionHandler.java`
- `User-Service/src/main/java/com/microservice/user/exception/GlobalExceptionHandler.java`

This keeps controllers/services focused on normal and domain failure paths while consistently converting exceptions into client-facing responses.

#### Infrastructure Implications
The repository is a pair of separately deployed Spring Boot/Maven runtimes. User Service is an external runtime dependency of Order Service. Persistence technology, service-discovery mechanism, HTTP client choice, authentication, message broker, database schema, and deployment platform cannot be established from the provided files; any graph planner should model them as unresolved rather than inferred.

Main entry points: [`Order-Service/src/main/java/com/microservice/order/service/OrderService.java`](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/src/main/java/com/microservice/order/service/OrderService.java) (Order processing), [`User-Service/src/main/java/com/microservice/user/service/UserService.java`](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/User-Service/src/main/java/com/microservice/user/service/UserService.java) (User processing), [`User-Service/src/main/java/com/microservice/user/controller/UserController.java`](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/User-Service/src/main/java/com/microservice/user/controller/UserController.java) (User API), [`Order-Service/src/main/java/com/microservice/order/OrderServiceApplication.java`](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/src/main/java/com/microservice/order/OrderServiceApplication.java) (Spring Boot app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_order["Order Service"]
  node_order_build["Maven build<br/>Maven module<br/>[pom.xml]"]
  node_order_app{{"Spring Boot app<br/>bootstrap"}}
  node_order_properties["Runtime properties<br/>configuration"]
  node_order_controller["Order API<br/>HTTP controller"]
  node_order_service["Order processing<br/>service layer<br/>[OrderService.java]"]
  node_order_domain["Order domain<br/>entity<br/>[Order.java]"]
  node_order_response["Order response<br/>API DTO<br/>[OrderResponse.java]"]
  node_order_config["Client wiring<br/>application config<br/>[AppConfig.java]"]
  node_order_errors["Order error translation<br/>exception handler"]
  node_order_user_unavailable["User unavailable<br/>dependency exception"]
end

subgraph group_user["User Service"]
  node_user_build["Maven build<br/>Maven module<br/>[pom.xml]"]
  node_user_app{{"Spring Boot app<br/>bootstrap"}}
  node_user_properties["Runtime properties<br/>configuration"]
  node_user_controller["User API<br/>HTTP controller"]
  node_user_service["User processing<br/>service layer<br/>[UserService.java]"]
  node_user_domain["User domain<br/>entity<br/>[User.java]"]
  node_user_dto["User DTO<br/>API DTO<br/>[UserDto.java]"]
  node_user_errors["User error translation<br/>exception handler"]
  node_user_not_found["User not found<br/>domain exception"]
end

node_order_build -->|"builds"| node_order_app
node_order_properties -->|"configures"| node_order_app
node_order_app -->|"serves"| node_order_controller
node_order_controller -->|"delegates"| node_order_service
node_order_service -->|"uses"| node_order_domain
node_order_service -->|"shapes"| node_order_response
node_order_config -->|"wires dependency"| node_order_service
node_order_service -.->|"validates user via unresolved transport"| node_user_controller
node_order_service -->|"on unavailability"| node_order_user_unavailable
node_order_user_unavailable -->|"translated by"| node_order_errors
node_order_errors -->|"HTTP error response"| node_order_controller
node_user_build -->|"builds"| node_user_app
node_user_properties -->|"configures"| node_user_app
node_user_app -->|"serves"| node_user_controller
node_user_controller -->|"delegates"| node_user_service
node_user_service -->|"uses"| node_user_domain
node_user_service -->|"maps to"| node_user_dto
node_user_service -->|"when absent"| node_user_not_found
node_user_not_found -->|"translated by"| node_user_errors
node_user_errors -->|"HTTP error response"| node_user_controller

click node_order_build "https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/pom.xml"
click node_order_app "https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/src/main/java/com/microservice/order/OrderServiceApplication.java"
click node_order_properties "https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/src/main/resources/application.properties"
click node_order_controller "https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/src/main/java/com/microservice/order/controller/OrderController.java"
click node_order_service "https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/src/main/java/com/microservice/order/service/OrderService.java"
click node_order_domain "https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/src/main/java/com/microservice/order/entity/Order.java"
click node_order_response "https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/src/main/java/com/microservice/order/dto/OrderResponse.java"
click node_order_config "https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/src/main/java/com/microservice/order/config/AppConfig.java"
click node_order_errors "https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/src/main/java/com/microservice/order/exception/GlobalExceptionHandler.java"
click node_order_user_unavailable "https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/src/main/java/com/microservice/order/exception/UserServiceUnavailableException.java"
click node_user_build "https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/User-Service/pom.xml"
click node_user_app "https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/User-Service/src/main/java/com/microservice/user/UserServiceApplication.java"
click node_user_properties "https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/User-Service/src/main/resources/application.properties"
click node_user_controller "https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/User-Service/src/main/java/com/microservice/user/controller/UserController.java"
click node_user_service "https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/User-Service/src/main/java/com/microservice/user/service/UserService.java"
click node_user_domain "https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/User-Service/src/main/java/com/microservice/user/entity/User.java"
click node_user_dto "https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/User-Service/src/main/java/com/microservice/user/dto/UserDto.java"
click node_user_errors "https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/User-Service/src/main/java/com/microservice/user/exception/GlobalExceptionHandler.java"
click node_user_not_found "https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/User-Service/src/main/java/com/microservice/user/exception/UserNotFoundException.java"

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_order_build,node_order_app,node_order_properties,node_order_controller,node_order_service,node_order_domain,node_order_response,node_order_config,node_order_errors,node_order_user_unavailable toneBlue
class node_user_build,node_user_app,node_user_properties,node_user_controller,node_user_service,node_user_domain,node_user_dto,node_user_errors,node_user_not_found toneAmber
```

## Components

### Order Service

Independent Spring Boot/Maven runtime.

- [Maven build](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/pom.xml): Maven module · `Order-Service/pom.xml`
- [Spring Boot app](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/src/main/java/com/microservice/order/OrderServiceApplication.java): bootstrap · `Order-Service/src/main/java/com/microservice/order/OrderServiceApplication.java`
- [Runtime properties](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/src/main/resources/application.properties): configuration · `Order-Service/src/main/resources/application.properties`
- [Order API](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/src/main/java/com/microservice/order/controller/OrderController.java): HTTP controller · `Order-Service/src/main/java/com/microservice/order/controller/OrderController.java`
- [Order processing](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/src/main/java/com/microservice/order/service/OrderService.java): service layer · `Order-Service/src/main/java/com/microservice/order/service/OrderService.java`
- [Order domain](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/src/main/java/com/microservice/order/entity/Order.java): entity · `Order-Service/src/main/java/com/microservice/order/entity/Order.java`
- [Order response](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/src/main/java/com/microservice/order/dto/OrderResponse.java): API DTO · `Order-Service/src/main/java/com/microservice/order/dto/OrderResponse.java`
- [Client wiring](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/src/main/java/com/microservice/order/config/AppConfig.java): application config · Centralizes application or client-related wiring. · `Order-Service/src/main/java/com/microservice/order/config/AppConfig.java`
- [Order error translation](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/src/main/java/com/microservice/order/exception/GlobalExceptionHandler.java): exception handler · Translates service failures into HTTP responses. · `Order-Service/src/main/java/com/microservice/order/exception/GlobalExceptionHandler.java`
- [User unavailable](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/Order-Service/src/main/java/com/microservice/order/exception/UserServiceUnavailableException.java): dependency exception · `Order-Service/src/main/java/com/microservice/order/exception/UserServiceUnavailableException.java`

### User Service

Independent Spring Boot/Maven runtime.

- [Maven build](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/User-Service/pom.xml): Maven module · `User-Service/pom.xml`
- [Spring Boot app](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/User-Service/src/main/java/com/microservice/user/UserServiceApplication.java): bootstrap · `User-Service/src/main/java/com/microservice/user/UserServiceApplication.java`
- [Runtime properties](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/User-Service/src/main/resources/application.properties): configuration · `User-Service/src/main/resources/application.properties`
- [User API](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/User-Service/src/main/java/com/microservice/user/controller/UserController.java): HTTP controller · `User-Service/src/main/java/com/microservice/user/controller/UserController.java`
- [User processing](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/User-Service/src/main/java/com/microservice/user/service/UserService.java): service layer · `User-Service/src/main/java/com/microservice/user/service/UserService.java`
- [User domain](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/User-Service/src/main/java/com/microservice/user/entity/User.java): entity · `User-Service/src/main/java/com/microservice/user/entity/User.java`
- [User DTO](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/User-Service/src/main/java/com/microservice/user/dto/UserDto.java): API DTO · `User-Service/src/main/java/com/microservice/user/dto/UserDto.java`
- [User error translation](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/User-Service/src/main/java/com/microservice/user/exception/GlobalExceptionHandler.java): exception handler · Translates domain failures into HTTP responses. · `User-Service/src/main/java/com/microservice/user/exception/GlobalExceptionHandler.java`
- [User not found](https://github.com/abhilashroyal29-afk/microservices_abhilash/blob/main/User-Service/src/main/java/com/microservice/user/exception/UserNotFoundException.java): domain exception · `User-Service/src/main/java/com/microservice/user/exception/UserNotFoundException.java`

## Connections

- Maven build → Spring Boot app: builds
- Runtime properties → Spring Boot app: configures
- Spring Boot app → Order API: serves
- Order API → Order processing: delegates
- Order processing → Order domain: uses
- Order processing → Order response: shapes
- Client wiring → Order processing: wires dependency
- Order processing → User API: validates user via unresolved transport · The client implementation is not established.
- Order processing → User unavailable: on unavailability
- User unavailable → Order error translation: translated by
- Order error translation → Order API: HTTP error response
- Maven build → Spring Boot app: builds
- Runtime properties → Spring Boot app: configures
- Spring Boot app → User API: serves
- User API → User processing: delegates
- User processing → User domain: uses
- User processing → User DTO: maps to
- User processing → User not found: when absent
- User not found → User error translation: translated by
- User error translation → User API: HTTP error response
