# shaileshajabe/spring-microservices-demo architecture

> Architecture diagram of the GitHub repository shaileshajabe/spring-microservices-demo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shaileshajabe/spring-microservices-demo
- Repository: https://github.com/shaileshajabe/spring-microservices-demo

## Overview

This repository is a Spring microservices demo. The apparent user workflow enters through an API gateway and reaches order, product, or user capabilities; the tree also shows service discovery, S3/SQS integrations, and an order Lambda demo. Source excerpts cover only application startup and CORS, while the README gives no routing or service-call details, so inter-service and integration links are marked unverified rather than asserted.

Main entry points: [`api-gateway/src/main/java/com.example.gatewayservice/GatewayServiceApplication.java`](https://github.com/shaileshajabe/spring-microservices-demo/blob/main/api-gateway/src/main/java/com.example.gatewayservice/GatewayServiceApplication.java) (API gateway), [`order-service/src/main/java/com/example/orderservice`](https://github.com/shaileshajabe/spring-microservices-demo/tree/main/order-service/src/main/java/com/example/orderservice) (Order service), [`product-service/src/main/java/com/example/productservice`](https://github.com/shaileshajabe/spring-microservices-demo/tree/main/product-service/src/main/java/com/example/productservice) (Product service), [`Eureka-Server/src/main/java/com.example.eurekaserver/EurekaServerApplication.java`](https://github.com/shaileshajabe/spring-microservices-demo/blob/main/Eureka-Server/src/main/java/com.example.eurekaserver/EurekaServerApplication.java) (Eureka server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_edge["Entry and discovery"]
  node_gateway["API gateway"]
  node_cors["CORS filter"]
  node_discovery["Eureka server"]
end

subgraph group_commerce["Commerce services"]
  node_orders["Order service"]
  node_products["Product service"]
  node_users["User service"]
end

subgraph group_cloud["Cloud integrations"]
  node_lambda["Order Lambda"]
  node_sqs["SQS"]
  node_s3[("S3")]
end

node_client(("API client"))

node_client -.->|"sends requests"| node_gateway
node_gateway -.->|"routes to"| node_orders
node_gateway -.->|"routes to"| node_products
node_gateway -.->|"routes to"| node_users
node_gateway -.->|"applies filter"| node_cors
node_orders -.->|"registers with"| node_discovery
node_products -.->|"registers with"| node_discovery
node_users -.->|"registers with"| node_discovery
node_orders -.->|"uses queue"| node_sqs
node_lambda -.->|"handles messages"| node_sqs
node_products -.->|"uses storage"| node_s3

click node_gateway "https://github.com/shaileshajabe/spring-microservices-demo/blob/main/api-gateway/src/main/java/com.example.gatewayservice/GatewayServiceApplication.java"
click node_cors "https://github.com/shaileshajabe/spring-microservices-demo/blob/main/api-gateway/src/main/java/com.example.gatewayservice/CorsGlobalConfiguration.java"
click node_discovery "https://github.com/shaileshajabe/spring-microservices-demo/blob/main/Eureka-Server/src/main/java/com.example.eurekaserver/EurekaServerApplication.java"
click node_orders "https://github.com/shaileshajabe/spring-microservices-demo/tree/main/order-service/src/main/java/com/example/orderservice"
click node_products "https://github.com/shaileshajabe/spring-microservices-demo/tree/main/product-service/src/main/java/com/example/productservice"
click node_users "https://github.com/shaileshajabe/spring-microservices-demo/tree/main/user-service/src/main/java/com/example/userservice"
click node_lambda "https://github.com/shaileshajabe/spring-microservices-demo/blob/main/java-lambda-demo/src/main/java/com/example/lambdademo/OrderLambdaHandler.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_gateway,node_cors,node_discovery,node_client toneBlue
class node_orders,node_products,node_users toneAmber
class node_lambda,node_sqs,node_s3 toneMint
```

## Components

### Entry and discovery

- [API gateway](https://github.com/shaileshajabe/spring-microservices-demo/blob/main/api-gateway/src/main/java/com.example.gatewayservice/GatewayServiceApplication.java): `api-gateway/src/main/java/com.example.gatewayservice/GatewayServiceApplication.java`
- [CORS filter](https://github.com/shaileshajabe/spring-microservices-demo/blob/main/api-gateway/src/main/java/com.example.gatewayservice/CorsGlobalConfiguration.java): `api-gateway/src/main/java/com.example.gatewayservice/CorsGlobalConfiguration.java`
- [Eureka server](https://github.com/shaileshajabe/spring-microservices-demo/blob/main/Eureka-Server/src/main/java/com.example.eurekaserver/EurekaServerApplication.java): `Eureka-Server/src/main/java/com.example.eurekaserver/EurekaServerApplication.java`

### Commerce services

- [Order service](https://github.com/shaileshajabe/spring-microservices-demo/tree/main/order-service/src/main/java/com/example/orderservice): `order-service/src/main/java/com/example/orderservice`
- [Product service](https://github.com/shaileshajabe/spring-microservices-demo/tree/main/product-service/src/main/java/com/example/productservice): `product-service/src/main/java/com/example/productservice`
- [User service](https://github.com/shaileshajabe/spring-microservices-demo/tree/main/user-service/src/main/java/com/example/userservice): `user-service/src/main/java/com/example/userservice`

### Cloud integrations

- [Order Lambda](https://github.com/shaileshajabe/spring-microservices-demo/blob/main/java-lambda-demo/src/main/java/com/example/lambdademo/OrderLambdaHandler.java): `java-lambda-demo/src/main/java/com/example/lambdademo/OrderLambdaHandler.java`
- **SQS**
- **S3**

### Other components

- **API client**

## Connections

- API client → API gateway: sends requests
- API gateway → Order service: routes to
- API gateway → Product service: routes to
- API gateway → User service: routes to
- API gateway → CORS filter: applies filter
- Order service → Eureka server: registers with
- Product service → Eureka server: registers with
- User service → Eureka server: registers with
- Order service → SQS: uses queue
- Order Lambda → SQS: handles messages
- Product service → S3: uses storage
