# tyagishubhangam/project-micromart architecture

> Architecture diagram of the GitHub repository tyagishubhangam/project-micromart, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tyagishubhangam/project-micromart
- Repository: https://github.com/tyagishubhangam/project-micromart

## Overview

Micromart is a Spring Boot e-commerce backend organized as independently implemented services, with a React client entering through an API gateway. The documented user journey spans authentication, product discovery, cart operations, order placement and PayPal payment; reviews and category management are additional product capabilities. The excerpts show detailed cart, order, review and payment boundaries, but do not expose most implementations or gateway routing configuration, so those broader links are documented at README level or left unasserted.

Main entry points: [`Gateway-Microservice/src/main/java/com/micromart/Gateway_Microservice/GatewayMicroserviceApplication.java`](https://github.com/tyagishubhangam/project-micromart/blob/main/Gateway-Microservice/src/main/java/com/micromart/Gateway_Microservice/GatewayMicroserviceApplication.java) (API gateway), [`CartMicroservice/src/main/java/com/micromart/CartMicroservice/Controllers/TestController.java`](https://github.com/tyagishubhangam/project-micromart/blob/main/CartMicroservice/src/main/java/com/micromart/CartMicroservice/Controllers/TestController.java) (Cart API), [`ProductMicroservice/ProductMicroservice/src/main/java/com/micromart/ProductMicroservice/Controllers/ProductController.java`](https://github.com/tyagishubhangam/project-micromart/blob/main/ProductMicroservice/ProductMicroservice/src/main/java/com/micromart/ProductMicroservice/Controllers/ProductController.java) (Product catalog), [`UserMicroservice/src/main/java/com/micromart/UserMicroservice/controllers/UserController.java`](https://github.com/tyagishubhangam/project-micromart/blob/main/UserMicroservice/src/main/java/com/micromart/UserMicroservice/controllers/UserController.java) (User API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Client and gateway"]
  node_frontend["React frontend"]
  node_gateway["API gateway"]
  node_jwtfilter["JWT user filter"]
end

subgraph group_identity["Identity"]
  node_userapi["User API"]
  node_userauth["Authentication"]
  node_userprofile["User profiles<br/>[UserService.java]"]
end

subgraph group_catalog["Catalog and reviews"]
  node_productapi["Product catalog"]
  node_productservice["Product operations"]
  node_categories["Categories"]
  node_reviews["Review API"]
  node_reviewservice["Review operations"]
  node_reviewstore[("Review records<br/>[ReviewRepo.java]")]
end

subgraph group_shopping["Cart and orders"]
  node_cartapi["Cart API"]
  node_cartservice["Cart operations"]
  node_cartdata["Cart contents"]
  node_orders["Order API"]
  node_orderservice["Order operations<br/>[OrderService.java]"]
  node_orderstore[("Order records<br/>[OrdersRepo.java]")]
end

subgraph group_payments["Payments"]
  node_paymentapi["Payment API"]
  node_paypal["PayPal service<br/>[PaypalService.java]"]
  node_paymentservice["Transaction operations"]
  node_paymentstore[("Payment records<br/>[PaymentRepo.java]")]
end

node_shopper(("Shopper"))
node_paypalexternal["PayPal"]

node_shopper -->|"uses"| node_frontend
node_frontend -->|"sends requests"| node_gateway
node_gateway -->|"routes to"| node_userapi
node_gateway -->|"routes to"| node_productapi
node_gateway -->|"routes to"| node_reviews
node_gateway -->|"routes to"| node_cartapi
node_gateway -->|"routes to"| node_orders
node_gateway -->|"routes to"| node_paymentapi
node_userapi -.->|"authenticates"| node_userauth
node_userapi -.->|"manages profiles"| node_userprofile
node_productapi -.->|"delegates to"| node_productservice
node_productapi -.->|"manages categories"| node_categories
node_reviews -->|"calls"| node_reviewservice
node_reviewservice -->|"reads and writes"| node_reviewstore
node_cartapi -->|"calls"| node_cartservice
node_cartapi -->|"validates user"| node_userprofile
node_cartapi -->|"checks product"| node_productapi
node_cartservice -.->|"returns cart"| node_cartdata
node_orders -->|"calls"| node_orderservice
node_orderservice -.->|"persists orders"| node_orderstore
node_paymentapi -->|"creates or executes payment"| node_paypal
node_paymentapi -->|"records transactions"| node_paymentservice
node_paymentservice -.->|"persists transactions"| node_paymentstore
node_paypal -.->|"calls"| node_paypalexternal

click node_gateway "https://github.com/tyagishubhangam/project-micromart/blob/main/Gateway-Microservice/src/main/java/com/micromart/Gateway_Microservice/GatewayMicroserviceApplication.java"
click node_jwtfilter "https://github.com/tyagishubhangam/project-micromart/blob/main/Gateway-Microservice/src/main/java/com/micromart/Gateway_Microservice/filters/JWTUserIdFilter.java"
click node_userapi "https://github.com/tyagishubhangam/project-micromart/blob/main/UserMicroservice/src/main/java/com/micromart/UserMicroservice/controllers/UserController.java"
click node_userauth "https://github.com/tyagishubhangam/project-micromart/blob/main/UserMicroservice/src/main/java/com/micromart/UserMicroservice/config/SecurityConfig.java"
click node_userprofile "https://github.com/tyagishubhangam/project-micromart/blob/main/UserMicroservice/src/main/java/com/micromart/UserMicroservice/services/UserService.java"
click node_productapi "https://github.com/tyagishubhangam/project-micromart/blob/main/ProductMicroservice/ProductMicroservice/src/main/java/com/micromart/ProductMicroservice/Controllers/ProductController.java"
click node_productservice "https://github.com/tyagishubhangam/project-micromart/blob/main/ProductMicroservice/ProductMicroservice/src/main/java/com/micromart/ProductMicroservice/services/ProductService/ProductService.java"
click node_categories "https://github.com/tyagishubhangam/project-micromart/blob/main/ProductMicroservice/ProductMicroservice/src/main/java/com/micromart/ProductMicroservice/services/categoryservice/CategoryService.java"
click node_reviews "https://github.com/tyagishubhangam/project-micromart/blob/main/ReviewMicroservice/src/main/java/com/micromart/ReviewMicroservice/Controllers/ReviewController.java"
click node_reviewservice "https://github.com/tyagishubhangam/project-micromart/blob/main/ReviewMicroservice/src/main/java/com/micromart/ReviewMicroservice/ReviewService/ReviewServiceImpl.java"
click node_reviewstore "https://github.com/tyagishubhangam/project-micromart/blob/main/ReviewMicroservice/src/main/java/com/micromart/ReviewMicroservice/Repositories/ReviewRepo.java"
click node_cartapi "https://github.com/tyagishubhangam/project-micromart/blob/main/CartMicroservice/src/main/java/com/micromart/CartMicroservice/Controllers/TestController.java"
click node_cartservice "https://github.com/tyagishubhangam/project-micromart/blob/main/CartMicroservice/src/main/java/com/micromart/CartMicroservice/CartService/TestCartService.java"
click node_cartdata "https://github.com/tyagishubhangam/project-micromart/blob/main/CartMicroservice/src/main/java/com/micromart/CartMicroservice/Cart/TestDisplayCart.java"
click node_orders "https://github.com/tyagishubhangam/project-micromart/blob/main/OrderMicroservice/src/main/java/com/micromart/OrderMicroservice/controllers/OrderController.java"
click node_orderservice "https://github.com/tyagishubhangam/project-micromart/blob/main/OrderMicroservice/src/main/java/com/micromart/OrderMicroservice/services/OrderService.java"
click node_orderstore "https://github.com/tyagishubhangam/project-micromart/blob/main/OrderMicroservice/src/main/java/com/micromart/OrderMicroservice/repositories/OrdersRepo.java"
click node_paymentapi "https://github.com/tyagishubhangam/project-micromart/blob/main/PaymentMicroservice/src/main/java/com/micromart/PaymentMicroservice/controllers/PaymentController.java"
click node_paypal "https://github.com/tyagishubhangam/project-micromart/blob/main/PaymentMicroservice/src/main/java/com/micromart/PaymentMicroservice/service/PaypalService.java"
click node_paymentservice "https://github.com/tyagishubhangam/project-micromart/blob/main/PaymentMicroservice/src/main/java/com/micromart/PaymentMicroservice/service/admin/PaymentService.java"
click node_paymentstore "https://github.com/tyagishubhangam/project-micromart/blob/main/PaymentMicroservice/src/main/java/com/micromart/PaymentMicroservice/repository/PaymentRepo.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_frontend,node_gateway,node_jwtfilter toneBlue
class node_userapi,node_userauth,node_userprofile toneAmber
class node_productapi,node_productservice,node_categories,node_reviews,node_reviewservice,node_reviewstore toneMint
class node_cartapi,node_cartservice,node_cartdata,node_orders,node_orderservice,node_orderstore toneRose
class node_paymentapi,node_paypal,node_paymentservice,node_paymentstore,node_shopper,node_paypalexternal toneIndigo
```

## Components

### Client and gateway

- **React frontend**
- [API gateway](https://github.com/tyagishubhangam/project-micromart/blob/main/Gateway-Microservice/src/main/java/com/micromart/Gateway_Microservice/GatewayMicroserviceApplication.java): `Gateway-Microservice/src/main/java/com/micromart/Gateway_Microservice/GatewayMicroserviceApplication.java`
- [JWT user filter](https://github.com/tyagishubhangam/project-micromart/blob/main/Gateway-Microservice/src/main/java/com/micromart/Gateway_Microservice/filters/JWTUserIdFilter.java): `Gateway-Microservice/src/main/java/com/micromart/Gateway_Microservice/filters/JWTUserIdFilter.java`

### Identity

- [User API](https://github.com/tyagishubhangam/project-micromart/blob/main/UserMicroservice/src/main/java/com/micromart/UserMicroservice/controllers/UserController.java): `UserMicroservice/src/main/java/com/micromart/UserMicroservice/controllers/UserController.java`
- [Authentication](https://github.com/tyagishubhangam/project-micromart/blob/main/UserMicroservice/src/main/java/com/micromart/UserMicroservice/config/SecurityConfig.java): `UserMicroservice/src/main/java/com/micromart/UserMicroservice/config/SecurityConfig.java`
- [User profiles](https://github.com/tyagishubhangam/project-micromart/blob/main/UserMicroservice/src/main/java/com/micromart/UserMicroservice/services/UserService.java): `UserMicroservice/src/main/java/com/micromart/UserMicroservice/services/UserService.java`

### Catalog and reviews

- [Product catalog](https://github.com/tyagishubhangam/project-micromart/blob/main/ProductMicroservice/ProductMicroservice/src/main/java/com/micromart/ProductMicroservice/Controllers/ProductController.java): `ProductMicroservice/ProductMicroservice/src/main/java/com/micromart/ProductMicroservice/Controllers/ProductController.java`
- [Product operations](https://github.com/tyagishubhangam/project-micromart/blob/main/ProductMicroservice/ProductMicroservice/src/main/java/com/micromart/ProductMicroservice/services/ProductService/ProductService.java): `ProductMicroservice/ProductMicroservice/src/main/java/com/micromart/ProductMicroservice/services/ProductService/ProductService.java`
- [Categories](https://github.com/tyagishubhangam/project-micromart/blob/main/ProductMicroservice/ProductMicroservice/src/main/java/com/micromart/ProductMicroservice/services/categoryservice/CategoryService.java): `ProductMicroservice/ProductMicroservice/src/main/java/com/micromart/ProductMicroservice/services/categoryservice/CategoryService.java`
- [Review API](https://github.com/tyagishubhangam/project-micromart/blob/main/ReviewMicroservice/src/main/java/com/micromart/ReviewMicroservice/Controllers/ReviewController.java): `ReviewMicroservice/src/main/java/com/micromart/ReviewMicroservice/Controllers/ReviewController.java`
- [Review operations](https://github.com/tyagishubhangam/project-micromart/blob/main/ReviewMicroservice/src/main/java/com/micromart/ReviewMicroservice/ReviewService/ReviewServiceImpl.java): `ReviewMicroservice/src/main/java/com/micromart/ReviewMicroservice/ReviewService/ReviewServiceImpl.java`
- [Review records](https://github.com/tyagishubhangam/project-micromart/blob/main/ReviewMicroservice/src/main/java/com/micromart/ReviewMicroservice/Repositories/ReviewRepo.java): `ReviewMicroservice/src/main/java/com/micromart/ReviewMicroservice/Repositories/ReviewRepo.java`

### Cart and orders

- [Cart API](https://github.com/tyagishubhangam/project-micromart/blob/main/CartMicroservice/src/main/java/com/micromart/CartMicroservice/Controllers/TestController.java): `CartMicroservice/src/main/java/com/micromart/CartMicroservice/Controllers/TestController.java`
- [Cart operations](https://github.com/tyagishubhangam/project-micromart/blob/main/CartMicroservice/src/main/java/com/micromart/CartMicroservice/CartService/TestCartService.java): `CartMicroservice/src/main/java/com/micromart/CartMicroservice/CartService/TestCartService.java`
- [Cart contents](https://github.com/tyagishubhangam/project-micromart/blob/main/CartMicroservice/src/main/java/com/micromart/CartMicroservice/Cart/TestDisplayCart.java): `CartMicroservice/src/main/java/com/micromart/CartMicroservice/Cart/TestDisplayCart.java`
- [Order API](https://github.com/tyagishubhangam/project-micromart/blob/main/OrderMicroservice/src/main/java/com/micromart/OrderMicroservice/controllers/OrderController.java): `OrderMicroservice/src/main/java/com/micromart/OrderMicroservice/controllers/OrderController.java`
- [Order operations](https://github.com/tyagishubhangam/project-micromart/blob/main/OrderMicroservice/src/main/java/com/micromart/OrderMicroservice/services/OrderService.java): `OrderMicroservice/src/main/java/com/micromart/OrderMicroservice/services/OrderService.java`
- [Order records](https://github.com/tyagishubhangam/project-micromart/blob/main/OrderMicroservice/src/main/java/com/micromart/OrderMicroservice/repositories/OrdersRepo.java): `OrderMicroservice/src/main/java/com/micromart/OrderMicroservice/repositories/OrdersRepo.java`

### Payments

- [Payment API](https://github.com/tyagishubhangam/project-micromart/blob/main/PaymentMicroservice/src/main/java/com/micromart/PaymentMicroservice/controllers/PaymentController.java): `PaymentMicroservice/src/main/java/com/micromart/PaymentMicroservice/controllers/PaymentController.java`
- [PayPal service](https://github.com/tyagishubhangam/project-micromart/blob/main/PaymentMicroservice/src/main/java/com/micromart/PaymentMicroservice/service/PaypalService.java): `PaymentMicroservice/src/main/java/com/micromart/PaymentMicroservice/service/PaypalService.java`
- [Transaction operations](https://github.com/tyagishubhangam/project-micromart/blob/main/PaymentMicroservice/src/main/java/com/micromart/PaymentMicroservice/service/admin/PaymentService.java): `PaymentMicroservice/src/main/java/com/micromart/PaymentMicroservice/service/admin/PaymentService.java`
- [Payment records](https://github.com/tyagishubhangam/project-micromart/blob/main/PaymentMicroservice/src/main/java/com/micromart/PaymentMicroservice/repository/PaymentRepo.java): `PaymentMicroservice/src/main/java/com/micromart/PaymentMicroservice/repository/PaymentRepo.java`

### Other components

- **Shopper**
- **PayPal**

## Connections

- Shopper → React frontend: uses
- React frontend → API gateway: sends requests
- API gateway → User API: routes to
- API gateway → Product catalog: routes to
- API gateway → Review API: routes to
- API gateway → Cart API: routes to
- API gateway → Order API: routes to
- API gateway → Payment API: routes to
- User API → Authentication: authenticates
- User API → User profiles: manages profiles (evidence: `UserMicroservice/src/main/java/com/micromart/UserMicroservice/controllers/UserController.java`)
- Product catalog → Product operations: delegates to (evidence: `ProductMicroservice/ProductMicroservice/src/main/java/com/micromart/ProductMicroservice/Controllers/ProductController.java`)
- Product catalog → Categories: manages categories
- Review API → Review operations: calls (evidence: `ReviewMicroservice/src/main/java/com/micromart/ReviewMicroservice/Controllers/ReviewController.java`)
- Review operations → Review records: reads and writes (evidence: `ReviewMicroservice/src/main/java/com/micromart/ReviewMicroservice/ReviewService/ReviewServiceImpl.java`)
- Cart API → Cart operations: calls (evidence: `CartMicroservice/src/main/java/com/micromart/CartMicroservice/Controllers/TestController.java`)
- Cart API → User profiles: validates user (evidence: `CartMicroservice/src/main/java/com/micromart/CartMicroservice/Controllers/TestController.java`)
- Cart API → Product catalog: checks product (evidence: `CartMicroservice/src/main/java/com/micromart/CartMicroservice/Controllers/TestController.java`)
- Cart operations → Cart contents: returns cart (evidence: `CartMicroservice/src/main/java/com/micromart/CartMicroservice/CartService/TestCartService.java`)
- Order API → Order operations: calls (evidence: `OrderMicroservice/src/main/java/com/micromart/OrderMicroservice/controllers/OrderController.java`)
- Order operations → Order records: persists orders
- Payment API → PayPal service: creates or executes payment (evidence: `PaymentMicroservice/src/main/java/com/micromart/PaymentMicroservice/controllers/PaymentController.java`)
- Payment API → Transaction operations: records transactions (evidence: `PaymentMicroservice/src/main/java/com/micromart/PaymentMicroservice/controllers/PaymentController.java`)
- Transaction operations → Payment records: persists transactions
- PayPal service → PayPal: calls
