# shrutibale/business-entity-resolution_amazon architecture

> Architecture diagram of the GitHub repository shrutibale/business-entity-resolution_amazon, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shrutibale/business-entity-resolution_amazon
- Repository: https://github.com/shrutibale/business-entity-resolution_amazon

## Overview

EntityResolve is a read-only judge-facing demo for exploring business entity-resolution results; it does not run the production matching pipeline. A user browses or selects an S1 entity, the frontend requests its trace from the API, and the backend combines loaded entity, candidate, and decision data with a deterministic explanation. Separate screens present metrics, experiment runs, showcase shortcuts, and methodology. The README documents normalization, retrieval, matching, thresholding, and validation as methodology, not implemented runtime stages here. Unsampled page implementations are represented by their documented roles; their internal wiring is not inferred.

Main entry points: [`frontend/src/App.jsx`](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/frontend/src/App.jsx) (Page router), [`frontend/src/api.js`](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/frontend/src/api.js) (API client), [`backend/data_loader.py`](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/data_loader.py) (In-memory data store), [`backend/main.py`](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/main.py) (FastAPI endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_app["Page router<br/>[App.jsx]"]
  node_browser["Entity browser<br/>[EntityBrowser.jsx]"]
  node_detail["Entity detail<br/>[EntityDetail.jsx]"]
  node_home["Home showcase<br/>[Home.jsx]"]
  node_metrics_ui["Metrics dashboard"]
  node_experiments_ui["Experiment comparison<br/>[Experiments.jsx]"]
  node_client_api["API client<br/>[api.js]"]
end

subgraph group_backend["API and explanation"]
  node_http_api["FastAPI endpoints<br/>[main.py]"]
  node_explain["Explanation generator"]
  node_loader["Startup data loader<br/>[data_loader.py]"]
  node_schemas["Response schemas<br/>[models.py]"]
end

subgraph group_data["Loaded demo data"]
  node_store["In-memory data store<br/>[data_loader.py]"]
  node_entities["S1 entities<br/>[s1_entities.json]"]
  node_candidates["Candidate evidence<br/>[candidates.json]"]
  node_decisions["Match decisions<br/>[decisions.json]"]
  node_metric_data["Precomputed metrics<br/>[metrics.json]"]
  node_run_data["Experiment runs"]
end

subgraph group_domain["Methodology display"]
  node_method_ui["Methodology page<br/>[Methodology.jsx]"]
end

node_visitor(("Judge / user"))

node_visitor -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_browser
node_app -->|"routes to"| node_detail
node_app -->|"routes to"| node_metrics_ui
node_app -->|"routes to"| node_experiments_ui
node_app -->|"routes to"| node_method_ui
node_browser -->|"requests entities"| node_client_api
node_detail -->|"requests detail and showcase"| node_client_api
node_home -->|"requests showcase"| node_client_api
node_metrics_ui -->|"requests metrics"| node_client_api
node_experiments_ui -->|"requests runs"| node_client_api
node_client_api -->|"HTTP requests"| node_http_api
node_http_api -->|"gets store"| node_loader
node_loader -->|"creates"| node_store
node_entities -->|"loaded into"| node_store
node_candidates -->|"loaded into"| node_store
node_decisions -->|"loaded into"| node_store
node_metric_data -->|"loaded into"| node_store
node_run_data -->|"loaded into"| node_store
node_http_api -->|"generates detail explanation"| node_explain
node_http_api -->|"returns API data"| node_client_api

click node_app "https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/frontend/src/App.jsx"
click node_browser "https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/frontend/src/pages/EntityBrowser.jsx"
click node_detail "https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/frontend/src/pages/EntityDetail.jsx"
click node_home "https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/frontend/src/pages/Home.jsx"
click node_metrics_ui "https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/frontend/src/pages/MetricsDashboard.jsx"
click node_experiments_ui "https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/frontend/src/pages/Experiments.jsx"
click node_method_ui "https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/frontend/src/pages/Methodology.jsx"
click node_client_api "https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/frontend/src/api.js"
click node_http_api "https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/main.py"
click node_explain "https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/services/explanation_service.py"
click node_loader "https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/data_loader.py"
click node_schemas "https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/models.py"
click node_store "https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/data_loader.py"
click node_entities "https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/data/s1_entities.json"
click node_candidates "https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/data/candidates.json"
click node_decisions "https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/data/decisions.json"
click node_metric_data "https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/data/metrics.json"
click node_run_data "https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/data/experiment_runs.json"

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_browser,node_detail,node_home,node_metrics_ui,node_experiments_ui,node_client_api,node_visitor toneBlue
class node_http_api,node_explain,node_loader,node_schemas toneAmber
class node_store,node_entities,node_candidates,node_decisions,node_metric_data,node_run_data toneMint
class node_method_ui toneRose
```

## Components

### Frontend experience

- [Page router](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Entity browser](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/frontend/src/pages/EntityBrowser.jsx): `frontend/src/pages/EntityBrowser.jsx`
- [Entity detail](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/frontend/src/pages/EntityDetail.jsx): `frontend/src/pages/EntityDetail.jsx`
- [Home showcase](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Metrics dashboard](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/frontend/src/pages/MetricsDashboard.jsx): `frontend/src/pages/MetricsDashboard.jsx`
- [Experiment comparison](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/frontend/src/pages/Experiments.jsx): `frontend/src/pages/Experiments.jsx`
- [API client](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/frontend/src/api.js): `frontend/src/api.js`

### API and explanation

- [FastAPI endpoints](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/main.py): `backend/main.py`
- [Explanation generator](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/services/explanation_service.py): `backend/services/explanation_service.py`
- [Startup data loader](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/data_loader.py): `backend/data_loader.py`
- [Response schemas](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/models.py): `backend/models.py`

### Loaded demo data

- [In-memory data store](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/data_loader.py): `backend/data_loader.py`
- [S1 entities](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/data/s1_entities.json): `backend/data/s1_entities.json`
- [Candidate evidence](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/data/candidates.json): `backend/data/candidates.json`
- [Match decisions](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/data/decisions.json): `backend/data/decisions.json`
- [Precomputed metrics](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/data/metrics.json): `backend/data/metrics.json`
- [Experiment runs](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/backend/data/experiment_runs.json): `backend/data/experiment_runs.json`

### Methodology display

- [Methodology page](https://github.com/shrutibale/business-entity-resolution_amazon/blob/main/frontend/src/pages/Methodology.jsx): `frontend/src/pages/Methodology.jsx`

### Other components

- **Judge / user**

## Connections

- Judge / user → Page router: uses
- Page router → Home showcase: routes to
- Page router → Entity browser: routes to
- Page router → Entity detail: routes to
- Page router → Metrics dashboard: routes to
- Page router → Experiment comparison: routes to
- Page router → Methodology page: routes to
- Entity browser → API client: requests entities
- Entity detail → API client: requests detail and showcase
- Home showcase → API client: requests showcase
- Metrics dashboard → API client: requests metrics
- Experiment comparison → API client: requests runs
- API client → FastAPI endpoints: HTTP requests
- FastAPI endpoints → Startup data loader: gets store
- Startup data loader → In-memory data store: creates
- S1 entities → In-memory data store: loaded into
- Candidate evidence → In-memory data store: loaded into
- Match decisions → In-memory data store: loaded into
- Precomputed metrics → In-memory data store: loaded into
- Experiment runs → In-memory data store: loaded into
- FastAPI endpoints → Explanation generator: generates detail explanation
- FastAPI endpoints → API client: returns API data
