# vamsikrishna308/ecommerce-multi-filter-app architecture

> Architecture diagram of the GitHub repository vamsikrishna308/ecommerce-multi-filter-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vamsikrishna308/ecommerce-multi-filter-app
- Repository: https://github.com/vamsikrishna308/ecommerce-multi-filter-app

## Overview

This marketplace lets shoppers adjust category, price, rating, and sort controls; the React app re-queries the Spring API, which validates criteria, filters and sorts inventory, and returns products for the grid. A separate category lookup populates the sidebar. The backend also centralizes API errors and seeds demo inventory. The README documents MySQL persistence and the major layers; several frontend/backend connections are evidenced by the README and indexed references rather than sampled call sites.

Main entry points: [`backend/src/main/java/com/ecommerce/filter/service/impl/ProductServiceImpl.java`](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/service/impl/ProductServiceImpl.java) (Product Service), [`frontend/src/App.jsx`](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/frontend/src/App.jsx) (Browse State), [`frontend/src/components/ProductGrid/ProductGrid.jsx`](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/frontend/src/components/ProductGrid/ProductGrid.jsx) (Product Grid), [`backend/src/main/java/com/ecommerce/filter/controller/ProductController.java`](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/controller/ProductController.java) (Product Controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browse["Marketplace UI"]
  node_app["Browse State<br/>[App.jsx]"]
  node_sidebar["Filter Sidebar<br/>[Sidebar.jsx]"]
  node_filter_controls["Filter Controls"]
  node_grid["Product Grid<br/>[ProductGrid.jsx]"]
  node_card["Product Card<br/>[ProductCard.jsx]"]
  node_empty["Empty State<br/>[EmptyState.jsx]"]
  node_sort_ui["Sort Selector<br/>[SortDropdown.jsx]"]
  node_api_client["API Client<br/>[productApi.js]"]
end

subgraph group_api["Catalog API"]
  node_controller["Product Controller"]
  node_error_handler["Error Handler"]
end

subgraph group_domain["Catalog Logic"]
  node_service["Product Service"]
  node_spec_builder["Filter Specification"]
  node_sort_options["Sort Options<br/>[SortOption.java]"]
  node_filter_request["Filter Request"]
  node_product_response["Product Responses"]
  node_list_response["List Response"]
end

subgraph group_storage["Inventory Data"]
  node_repository["Product Repository"]
  node_product["Product Entity<br/>[Product.java]"]
  node_mysql[("MySQL")]
  node_seeder["Demo Seeder<br/>[DataSeeder.java]"]
end

node_shopper(("Shopper"))

node_shopper -->|"uses"| node_app
node_app -->|"renders"| node_sidebar
node_app -->|"renders"| node_grid
node_app -->|"requests data"| node_api_client
node_sidebar -->|"renders"| node_filter_controls
node_grid -->|"renders"| node_card
node_grid -->|"renders"| node_empty
node_grid -->|"renders"| node_sort_ui
node_api_client -->|"HTTP requests"| node_controller
node_controller -->|"builds"| node_filter_request
node_controller -->|"delegates"| node_service
node_controller -->|"handles failures"| node_error_handler
node_service -->|"builds predicate"| node_spec_builder
node_service -->|"resolves sorting"| node_sort_options
node_service -->|"queries inventory"| node_repository
node_service -->|"maps results"| node_product_response
node_service -->|"returns results"| node_list_response
node_repository -->|"persists"| node_product
node_repository -->|"reads and writes"| node_mysql
node_seeder -->|"seeds inventory"| node_repository

click node_app "https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/frontend/src/App.jsx"
click node_sidebar "https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/frontend/src/components/Sidebar/Sidebar.jsx"
click node_filter_controls "https://github.com/vamsikrishna308/ecommerce-multi-filter-app/tree/main/frontend/src/components/Sidebar"
click node_grid "https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/frontend/src/components/ProductGrid/ProductGrid.jsx"
click node_card "https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/frontend/src/components/ProductGrid/ProductCard.jsx"
click node_empty "https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/frontend/src/components/ProductGrid/EmptyState.jsx"
click node_sort_ui "https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/frontend/src/components/SortDropdown.jsx"
click node_api_client "https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/frontend/src/api/productApi.js"
click node_controller "https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/controller/ProductController.java"
click node_error_handler "https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/exception/GlobalExceptionHandler.java"
click node_service "https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/service/impl/ProductServiceImpl.java"
click node_spec_builder "https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/service/ProductSpecificationBuilder.java"
click node_sort_options "https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/enums/SortOption.java"
click node_filter_request "https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/dto/ProductFilterRequest.java"
click node_product_response "https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/dto/ProductResponse.java"
click node_list_response "https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/dto/ProductListResponse.java"
click node_repository "https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/repository/ProductRepository.java"
click node_product "https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/entity/Product.java"
click node_seeder "https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/config/DataSeeder.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_app,node_sidebar,node_filter_controls,node_grid,node_card,node_empty,node_sort_ui,node_api_client toneBlue
class node_controller,node_error_handler toneAmber
class node_service,node_spec_builder,node_sort_options,node_filter_request,node_product_response,node_list_response toneMint
class node_repository,node_product,node_mysql,node_seeder toneRose
class node_shopper toneIndigo
```

## Components

### Marketplace UI

- [Browse State](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Filter Sidebar](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/frontend/src/components/Sidebar/Sidebar.jsx): `frontend/src/components/Sidebar/Sidebar.jsx`
- [Filter Controls](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/tree/main/frontend/src/components/Sidebar): `frontend/src/components/Sidebar`
- [Product Grid](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/frontend/src/components/ProductGrid/ProductGrid.jsx): `frontend/src/components/ProductGrid/ProductGrid.jsx`
- [Product Card](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/frontend/src/components/ProductGrid/ProductCard.jsx): `frontend/src/components/ProductGrid/ProductCard.jsx`
- [Empty State](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/frontend/src/components/ProductGrid/EmptyState.jsx): `frontend/src/components/ProductGrid/EmptyState.jsx`
- [Sort Selector](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/frontend/src/components/SortDropdown.jsx): `frontend/src/components/SortDropdown.jsx`
- [API Client](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/frontend/src/api/productApi.js): `frontend/src/api/productApi.js`

### Catalog API

- [Product Controller](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/controller/ProductController.java): `backend/src/main/java/com/ecommerce/filter/controller/ProductController.java`
- [Error Handler](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/exception/GlobalExceptionHandler.java): `backend/src/main/java/com/ecommerce/filter/exception/GlobalExceptionHandler.java`

### Catalog Logic

- [Product Service](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/service/impl/ProductServiceImpl.java): `backend/src/main/java/com/ecommerce/filter/service/impl/ProductServiceImpl.java`
- [Filter Specification](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/service/ProductSpecificationBuilder.java): `backend/src/main/java/com/ecommerce/filter/service/ProductSpecificationBuilder.java`
- [Sort Options](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/enums/SortOption.java): `backend/src/main/java/com/ecommerce/filter/enums/SortOption.java`
- [Filter Request](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/dto/ProductFilterRequest.java): `backend/src/main/java/com/ecommerce/filter/dto/ProductFilterRequest.java`
- [Product Responses](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/dto/ProductResponse.java): `backend/src/main/java/com/ecommerce/filter/dto/ProductResponse.java`
- [List Response](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/dto/ProductListResponse.java): `backend/src/main/java/com/ecommerce/filter/dto/ProductListResponse.java`

### Inventory Data

- [Product Repository](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/repository/ProductRepository.java): `backend/src/main/java/com/ecommerce/filter/repository/ProductRepository.java`
- [Product Entity](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/entity/Product.java): `backend/src/main/java/com/ecommerce/filter/entity/Product.java`
- **MySQL**
- [Demo Seeder](https://github.com/vamsikrishna308/ecommerce-multi-filter-app/blob/main/backend/src/main/java/com/ecommerce/filter/config/DataSeeder.java): `backend/src/main/java/com/ecommerce/filter/config/DataSeeder.java`

### Other components

- **Shopper**

## Connections

- Shopper → Browse State: uses (evidence: `README.md`)
- Browse State → Filter Sidebar: renders (evidence: `frontend/src/App.jsx`)
- Browse State → Product Grid: renders (evidence: `frontend/src/App.jsx`)
- Browse State → API Client: requests data (evidence: `frontend/src/App.jsx`)
- Filter Sidebar → Filter Controls: renders (evidence: `frontend/src/components/Sidebar/Sidebar.jsx`)
- Product Grid → Product Card: renders (evidence: `frontend/src/components/ProductGrid/ProductGrid.jsx`)
- Product Grid → Empty State: renders (evidence: `frontend/src/components/ProductGrid/ProductGrid.jsx`)
- Product Grid → Sort Selector: renders (evidence: `frontend/src/components/ProductGrid/ProductGrid.jsx`)
- API Client → Product Controller: HTTP requests (evidence: `README.md`)
- Product Controller → Filter Request: builds (evidence: `backend/src/main/java/com/ecommerce/filter/controller/ProductController.java`)
- Product Controller → Product Service: delegates (evidence: `backend/src/main/java/com/ecommerce/filter/controller/ProductController.java`)
- Product Controller → Error Handler: handles failures (evidence: `backend/src/main/java/com/ecommerce/filter/exception/GlobalExceptionHandler.java`)
- Product Service → Filter Specification: builds predicate (evidence: `backend/src/main/java/com/ecommerce/filter/service/impl/ProductServiceImpl.java`)
- Product Service → Sort Options: resolves sorting (evidence: `backend/src/main/java/com/ecommerce/filter/service/impl/ProductServiceImpl.java`)
- Product Service → Product Repository: queries inventory (evidence: `backend/src/main/java/com/ecommerce/filter/service/impl/ProductServiceImpl.java`)
- Product Service → Product Responses: maps results (evidence: `backend/src/main/java/com/ecommerce/filter/service/impl/ProductServiceImpl.java`)
- Product Service → List Response: returns results (evidence: `backend/src/main/java/com/ecommerce/filter/service/impl/ProductServiceImpl.java`)
- Product Repository → Product Entity: persists (evidence: `backend/src/main/java/com/ecommerce/filter/repository/ProductRepository.java`)
- Product Repository → MySQL: reads and writes (evidence: `README.md`)
- Demo Seeder → Product Repository: seeds inventory (evidence: `backend/src/main/java/com/ecommerce/filter/config/DataSeeder.java`)
