# mohamed-imran-12/microservices-demo architecture

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

- Interactive diagram: https://gitdiagram.com/mohamed-imran-12/microservices-demo
- Repository: https://github.com/mohamed-imran-12/microservices-demo

## Overview

This repository is a React storefront and admin console backed by Spring Boot microservices. The main customer workflow is browsing products, managing a cart, checking out, and viewing orders; the admin area manages products, inventory, orders, users, and sales reports. The README documents the backend service topology and service-to-service calls. Frontend routing and selected API/context behavior are supported by excerpts and the source index; unsampled frontend details are represented at subsystem level.

Main entry points: [`APIGateway`](https://github.com/mohamed-imran-12/microservices-demo/tree/main/APIGateway) (API Gateway), [`OrderService`](https://github.com/mohamed-imran-12/microservices-demo/tree/main/OrderService) (Order service), [`frontend/src/pages`](https://github.com/mohamed-imran-12/microservices-demo/tree/main/frontend/src/pages) (Customer storefront), [`frontend/src/api/client.ts`](https://github.com/mohamed-imran-12/microservices-demo/blob/main/frontend/src/api/client.ts) (HTTP client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["Route application<br/>[App.tsx]"]
  node_customer["Customer storefront"]
  node_admin["Admin console"]
  node_auth["Authentication state<br/>[AuthContext.tsx]"]
  node_cart["Cart state<br/>[CartContext.tsx]"]
  node_user_api["User API<br/>[userApi.ts]"]
  node_product_api["Product API<br/>[productApi.ts]"]
  node_order_api["Order API<br/>[orderApi.ts]"]
  node_analytics_api["Analytics API<br/>[analyticsApi.ts]"]
  node_http_client["HTTP client<br/>[client.ts]"]
end

subgraph group_access["Gateway and discovery"]
  node_gateway{{"API Gateway"}}
  node_registry["Eureka registry"]
end

subgraph group_commerce["Commerce services"]
  node_users["User service"]
  node_products["Product service"]
  node_orders["Order service"]
  node_users_db[("Users database")]
  node_products_db[("Products database")]
  node_orders_db[("Orders database")]
end

subgraph group_insights["Analytics"]
  node_analytics["Analytics service"]
  node_analytics_db[("Analytics database")]
end

node_browser(("Browser"))

node_browser -->|"uses"| node_app
node_app -->|"routes to"| node_customer
node_app -->|"routes to"| node_admin
node_customer -->|"updates"| node_cart
node_customer -->|"submits checkout"| node_order_api
node_customer -->|"loads products"| node_product_api
node_customer -->|"updates profile"| node_user_api
node_admin -->|"manages inventory"| node_product_api
node_admin -->|"loads orders"| node_order_api
node_admin -->|"loads metrics"| node_analytics_api
node_user_api -->|"sends requests"| node_http_client
node_product_api -->|"sends requests"| node_http_client
node_order_api -->|"sends requests"| node_http_client
node_analytics_api -->|"sends requests"| node_http_client
node_http_client -->|"calls"| node_gateway
node_gateway -->|"routes requests"| node_users
node_gateway -->|"routes requests"| node_products
node_gateway -->|"routes requests"| node_orders
node_gateway -->|"routes requests"| node_analytics
node_orders -->|"calls via Feign"| node_users
node_orders -->|"calls via Feign"| node_products
node_orders -->|"calls via Feign"| node_analytics
node_users -->|"persists users"| node_users_db
node_products -->|"persists catalog"| node_products_db
node_orders -->|"persists orders"| node_orders_db
node_analytics -->|"persists reports"| node_analytics_db
node_gateway -->|"discovers services"| node_registry
node_users -->|"registers with"| node_registry
node_products -->|"registers with"| node_registry
node_orders -->|"registers with"| node_registry
node_analytics -->|"registers with"| node_registry

click node_app "https://github.com/mohamed-imran-12/microservices-demo/blob/main/frontend/src/App.tsx"
click node_customer "https://github.com/mohamed-imran-12/microservices-demo/tree/main/frontend/src/pages"
click node_admin "https://github.com/mohamed-imran-12/microservices-demo/tree/main/frontend/src/pages/admin"
click node_auth "https://github.com/mohamed-imran-12/microservices-demo/blob/main/frontend/src/context/AuthContext.tsx"
click node_cart "https://github.com/mohamed-imran-12/microservices-demo/blob/main/frontend/src/context/CartContext.tsx"
click node_user_api "https://github.com/mohamed-imran-12/microservices-demo/blob/main/frontend/src/api/userApi.ts"
click node_product_api "https://github.com/mohamed-imran-12/microservices-demo/blob/main/frontend/src/api/productApi.ts"
click node_order_api "https://github.com/mohamed-imran-12/microservices-demo/blob/main/frontend/src/api/orderApi.ts"
click node_analytics_api "https://github.com/mohamed-imran-12/microservices-demo/blob/main/frontend/src/api/analyticsApi.ts"
click node_http_client "https://github.com/mohamed-imran-12/microservices-demo/blob/main/frontend/src/api/client.ts"
click node_gateway "https://github.com/mohamed-imran-12/microservices-demo/tree/main/APIGateway"
click node_registry "https://github.com/mohamed-imran-12/microservices-demo/tree/main/ServiceRegistry"
click node_users "https://github.com/mohamed-imran-12/microservices-demo/tree/main/UserService"
click node_products "https://github.com/mohamed-imran-12/microservices-demo/tree/main/ProductService"
click node_orders "https://github.com/mohamed-imran-12/microservices-demo/tree/main/OrderService"
click node_analytics "https://github.com/mohamed-imran-12/microservices-demo/tree/main/AnalyticsService"

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_customer,node_admin,node_auth,node_cart,node_user_api,node_product_api,node_order_api,node_analytics_api,node_http_client,node_browser toneBlue
class node_gateway,node_registry toneAmber
class node_users,node_products,node_orders,node_users_db,node_products_db,node_orders_db toneMint
class node_analytics,node_analytics_db toneRose
```

## Components

### Web application

- [Route application](https://github.com/mohamed-imran-12/microservices-demo/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Customer storefront](https://github.com/mohamed-imran-12/microservices-demo/tree/main/frontend/src/pages): `frontend/src/pages`
- [Admin console](https://github.com/mohamed-imran-12/microservices-demo/tree/main/frontend/src/pages/admin): `frontend/src/pages/admin`
- [Authentication state](https://github.com/mohamed-imran-12/microservices-demo/blob/main/frontend/src/context/AuthContext.tsx): `frontend/src/context/AuthContext.tsx`
- [Cart state](https://github.com/mohamed-imran-12/microservices-demo/blob/main/frontend/src/context/CartContext.tsx): `frontend/src/context/CartContext.tsx`
- [User API](https://github.com/mohamed-imran-12/microservices-demo/blob/main/frontend/src/api/userApi.ts): `frontend/src/api/userApi.ts`
- [Product API](https://github.com/mohamed-imran-12/microservices-demo/blob/main/frontend/src/api/productApi.ts): `frontend/src/api/productApi.ts`
- [Order API](https://github.com/mohamed-imran-12/microservices-demo/blob/main/frontend/src/api/orderApi.ts): `frontend/src/api/orderApi.ts`
- [Analytics API](https://github.com/mohamed-imran-12/microservices-demo/blob/main/frontend/src/api/analyticsApi.ts): `frontend/src/api/analyticsApi.ts`
- [HTTP client](https://github.com/mohamed-imran-12/microservices-demo/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### Gateway and discovery

- [API Gateway](https://github.com/mohamed-imran-12/microservices-demo/tree/main/APIGateway): `APIGateway`
- [Eureka registry](https://github.com/mohamed-imran-12/microservices-demo/tree/main/ServiceRegistry): `ServiceRegistry`

### Commerce services

- [User service](https://github.com/mohamed-imran-12/microservices-demo/tree/main/UserService): `UserService`
- [Product service](https://github.com/mohamed-imran-12/microservices-demo/tree/main/ProductService): `ProductService`
- [Order service](https://github.com/mohamed-imran-12/microservices-demo/tree/main/OrderService): `OrderService`
- **Users database**
- **Products database**
- **Orders database**

### Analytics

- [Analytics service](https://github.com/mohamed-imran-12/microservices-demo/tree/main/AnalyticsService): `AnalyticsService`
- **Analytics database**

### Other components

- **Browser**

## Connections

- Browser → Route application: uses (evidence: `README.md`)
- Route application → Customer storefront: routes to (evidence: `frontend/src/App.tsx`)
- Route application → Admin console: routes to (evidence: `frontend/src/App.tsx`)
- Customer storefront → Cart state: updates (evidence: `frontend/src/pages/CartPage.tsx`)
- Customer storefront → Order API: submits checkout (evidence: `frontend/src/pages/CheckoutPage.tsx`)
- Customer storefront → Product API: loads products (evidence: `frontend/src/pages/ProductsPage.tsx`)
- Customer storefront → User API: updates profile (evidence: `frontend/src/pages/ProfilePage.tsx`)
- Admin console → Product API: manages inventory (evidence: `frontend/src/pages/admin/AdminInventoryPage.tsx`)
- Admin console → Order API: loads orders (evidence: `frontend/src/pages/admin/AdminOrdersPage.tsx`)
- Admin console → Analytics API: loads metrics (evidence: `frontend/src/pages/admin/AdminDashboardPage.tsx`)
- User API → HTTP client: sends requests (evidence: `frontend/src/api/userApi.ts`)
- Product API → HTTP client: sends requests (evidence: `frontend/src/api/productApi.ts`)
- Order API → HTTP client: sends requests
- Analytics API → HTTP client: sends requests (evidence: `frontend/src/api/analyticsApi.ts`)
- HTTP client → API Gateway: calls (evidence: `README.md`)
- API Gateway → User service: routes requests (evidence: `README.md`)
- API Gateway → Product service: routes requests (evidence: `README.md`)
- API Gateway → Order service: routes requests (evidence: `README.md`)
- API Gateway → Analytics service: routes requests (evidence: `README.md`)
- Order service → User service: calls via Feign (evidence: `README.md`)
- Order service → Product service: calls via Feign (evidence: `README.md`)
- Order service → Analytics service: calls via Feign (evidence: `README.md`)
- User service → Users database: persists users (evidence: `README.md`)
- Product service → Products database: persists catalog (evidence: `README.md`)
- Order service → Orders database: persists orders (evidence: `README.md`)
- Analytics service → Analytics database: persists reports (evidence: `README.md`)
- API Gateway → Eureka registry: discovers services (evidence: `README.md`)
- User service → Eureka registry: registers with (evidence: `README.md`)
- Product service → Eureka registry: registers with (evidence: `README.md`)
- Order service → Eureka registry: registers with (evidence: `README.md`)
- Analytics service → Eureka registry: registers with (evidence: `README.md`)
