# monizb/trivagro architecture

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

- Interactive diagram: https://gitdiagram.com/monizb/trivagro
- Repository: https://github.com/monizb/trivagro

## Overview

Trivagro is a React frontend for comparing grocery search results across BigBasket, Zepto, Blinkit, and Instamart. A user enters a product name; the app queries three endpoints on a local backend and Blinkit directly, sorts Blinkit results by name similarity, and displays each retailer’s results. BigBasket results use a dedicated list component that supports variants and unit-price calculations. The README says a backend is needed for CORS, but no backend code is present here, so its internal behavior is not represented.

Main entry points: [`src/App.js`](https://github.com/monizb/trivagro/blob/main/src/App.js) (Search and Compare), [`src/index.js`](https://github.com/monizb/trivagro/blob/main/src/index.js) (React Entry), [`src/BBProductList.js`](https://github.com/monizb/trivagro/blob/main/src/BBProductList.js) (BigBasket Product List)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_entry["React Entry<br/>[index.js]"]
  node_app["Search and Compare<br/>[App.js]"]
end

subgraph group_retailers["Retailer APIs"]
  node_local_api["Local Grocery API"]
  node_blinkit_api["Blinkit Search API"]
end

subgraph group_results["Product Results"]
  node_retailer_results["Retailer Result Views<br/>[App.js]"]
  node_bigbasket_list["BigBasket Product List<br/>[BBProductList.js]"]
end

node_user(("Shopper"))

node_user -->|"searches products"| node_app
node_entry -->|"renders"| node_app
node_app -->|"queries BB, Zepto, Instamart"| node_local_api
node_local_api -->|"returns product data"| node_app
node_app -->|"fetches search results"| node_blinkit_api
node_blinkit_api -->|"returns product data"| node_app
node_app -->|"displays retailer results"| node_retailer_results
node_app -->|"renders BigBasket products"| node_bigbasket_list

click node_entry "https://github.com/monizb/trivagro/blob/main/src/index.js"
click node_app "https://github.com/monizb/trivagro/blob/main/src/App.js"
click node_retailer_results "https://github.com/monizb/trivagro/blob/main/src/App.js"
click node_bigbasket_list "https://github.com/monizb/trivagro/blob/main/src/BBProductList.js"

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_entry,node_app toneBlue
class node_local_api,node_blinkit_api toneAmber
class node_retailer_results,node_bigbasket_list toneMint
class node_user toneIndigo
```

## Components

### Frontend

- [React Entry](https://github.com/monizb/trivagro/blob/main/src/index.js): `src/index.js`
- [Search and Compare](https://github.com/monizb/trivagro/blob/main/src/App.js): `src/App.js`

### Retailer APIs

- **Local Grocery API**
- **Blinkit Search API**

### Product Results

- [Retailer Result Views](https://github.com/monizb/trivagro/blob/main/src/App.js): `src/App.js`
- [BigBasket Product List](https://github.com/monizb/trivagro/blob/main/src/BBProductList.js): `src/BBProductList.js`

### Other components

- **Shopper**

## Connections

- Shopper → Search and Compare: searches products (evidence: `src/App.js`)
- React Entry → Search and Compare: renders (evidence: `src/index.js`)
- Search and Compare → Local Grocery API: queries BB, Zepto, Instamart (evidence: `src/App.js`)
- Local Grocery API → Search and Compare: returns product data (evidence: `src/App.js`)
- Search and Compare → Blinkit Search API: fetches search results (evidence: `src/App.js`)
- Blinkit Search API → Search and Compare: returns product data (evidence: `src/App.js`)
- Search and Compare → Retailer Result Views: displays retailer results (evidence: `src/App.js`)
- Search and Compare → BigBasket Product List: renders BigBasket products (evidence: `src/App.js`)
