# arkojyoti27dey/garlic_store_voice_agent_hackathon_project architecture

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

- Interactive diagram: https://gitdiagram.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project
- Repository: https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project

## Overview

This is a voice-first ecommerce and support application. A user speaks to the React client, which streams audio to Gemini; Gemini can invoke client tools that fetch product, order, or policy information from the FastAPI backend, and the client presents results in dashboard and shopping views. The backend combines keyword and semantic search over catalog data, with order and policy support. The README documents additional product capabilities; several frontend and backend implementation details were not sampled, so those links are shown only where documented or indexed.

Main entry points: [`App.tsx`](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/App.tsx) (App dashboard), [`services/geminiLiveService.ts`](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/services/geminiLiveService.ts) (Live voice service), [`backend/data_loader.py`](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/backend/data_loader.py) (Data loader), [`backend/search_logic.py`](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/backend/search_logic.py) (Hybrid search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_voice["Voice interaction"]
  node_live["Live voice service"]
  node_audio["Audio utilities<br/>[audioUtils.ts]"]
  node_prompts["System prompts<br/>[prompts.ts]"]
  node_tools["Agent tools<br/>[tools.ts]"]
  node_visualizer["Audio visualizer<br/>[Visualizer.tsx]"]
end

subgraph group_shop["Shopping experience"]
  node_app["App dashboard<br/>[App.tsx]"]
  node_product_card["Product cards<br/>[ProductCard.tsx]"]
  node_comparison["Product comparison<br/>[ComparisonView.tsx]"]
  node_cart_view["Cart view<br/>[CartView.tsx]"]
  node_order_card["Order cards<br/>[OrderCard.tsx]"]
end

subgraph group_api["Backend services"]
  node_api_client["Data API client<br/>[mockData.ts]"]
  node_fastapi["FastAPI routes<br/>[main.py]"]
  node_search["Hybrid search<br/>[search_logic.py]"]
end

subgraph group_data["Product and order data"]
  node_loader["Data loader<br/>[data_loader.py]"]
  node_vectors[("Vector search<br/>[vector_search.py]")]
  node_catalog[("Product catalog")]
  node_orders[("Order records")]
  node_faqs[("Product FAQs<br/>[product_faqs.json]")]
  node_policies["Company policies"]
end

node_user(("Shopper"))
node_gemini{{"Gemini Live"}}

node_user -->|"uses"| node_app
node_app -->|"starts session"| node_live
node_live -->|"streams audio"| node_gemini
node_gemini -->|"sends tool calls"| node_live
node_live -->|"decodes audio"| node_audio
node_live -->|"gets instructions"| node_prompts
node_live -->|"executes tools"| node_tools
node_tools -->|"requests data"| node_api_client
node_live -->|"updates context"| node_app
node_app -->|"renders"| node_product_card
node_app -->|"renders"| node_comparison
node_app -->|"renders"| node_cart_view
node_app -->|"renders"| node_order_card
node_app -->|"renders"| node_visualizer
node_product_card -->|"adds to cart"| node_api_client
node_cart_view -->|"updates cart"| node_api_client
node_api_client -->|"calls endpoints"| node_fastapi
node_fastapi -->|"dispatches search"| node_search
node_fastapi -->|"loads and serves data"| node_loader
node_search -->|"reads catalog data"| node_loader
node_search -->|"queries semantic index"| node_vectors
node_loader -->|"indexes products"| node_vectors
node_loader -->|"loads and saves"| node_catalog
node_loader -->|"loads and saves"| node_orders
node_loader -->|"loads"| node_faqs
node_search -.->|"searches policy content"| node_policies

click node_app "https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/App.tsx"
click node_live "https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/services/geminiLiveService.ts"
click node_audio "https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/services/audioUtils.ts"
click node_prompts "https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/services/prompts.ts"
click node_tools "https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/services/tools.ts"
click node_api_client "https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/services/mockData.ts"
click node_product_card "https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/components/ProductCard.tsx"
click node_comparison "https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/components/ComparisonView.tsx"
click node_cart_view "https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/components/CartView.tsx"
click node_order_card "https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/components/OrderCard.tsx"
click node_visualizer "https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/components/Visualizer.tsx"
click node_fastapi "https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/backend/main.py"
click node_search "https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/backend/search_logic.py"
click node_loader "https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/backend/data_loader.py"
click node_vectors "https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/backend/vector_search.py"
click node_catalog "https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/Files/product_catalog.json"
click node_orders "https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/Files/order_database.json"
click node_faqs "https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/Files/product_faqs.json"
click node_policies "https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/Files/Company_policies.md"

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_live,node_audio,node_prompts,node_tools,node_visualizer toneBlue
class node_app,node_product_card,node_comparison,node_cart_view,node_order_card toneAmber
class node_api_client,node_fastapi,node_search toneMint
class node_loader,node_vectors,node_catalog,node_orders,node_faqs,node_policies toneRose
class node_user,node_gemini toneIndigo
```

## Components

### Voice interaction

- [Live voice service](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/services/geminiLiveService.ts): `services/geminiLiveService.ts`
- [Audio utilities](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/services/audioUtils.ts): `services/audioUtils.ts`
- [System prompts](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/services/prompts.ts): `services/prompts.ts`
- [Agent tools](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/services/tools.ts): `services/tools.ts`
- [Audio visualizer](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/components/Visualizer.tsx): `components/Visualizer.tsx`

### Shopping experience

- [App dashboard](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/App.tsx): `App.tsx`
- [Product cards](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/components/ProductCard.tsx): `components/ProductCard.tsx`
- [Product comparison](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/components/ComparisonView.tsx): `components/ComparisonView.tsx`
- [Cart view](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/components/CartView.tsx): `components/CartView.tsx`
- [Order cards](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/components/OrderCard.tsx): `components/OrderCard.tsx`

### Backend services

- [Data API client](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/services/mockData.ts): `services/mockData.ts`
- [FastAPI routes](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/backend/main.py): `backend/main.py`
- [Hybrid search](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/backend/search_logic.py): `backend/search_logic.py`

### Product and order data

- [Data loader](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/backend/data_loader.py): `backend/data_loader.py`
- [Vector search](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/backend/vector_search.py): `backend/vector_search.py`
- [Product catalog](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/Files/product_catalog.json): `Files/product_catalog.json`
- [Order records](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/Files/order_database.json): `Files/order_database.json`
- [Product FAQs](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/Files/product_faqs.json): `Files/product_faqs.json`
- [Company policies](https://github.com/arkojyoti27dey/garlic_store_voice_agent_hackathon_project/blob/main/Files/Company_policies.md): `Files/Company_policies.md`

### Other components

- **Shopper**
- **Gemini Live**

## Connections

- Shopper → App dashboard: uses (evidence: `README.md`)
- App dashboard → Live voice service: starts session (evidence: `App.tsx`)
- Live voice service → Gemini Live: streams audio (evidence: `README.md`)
- Gemini Live → Live voice service: sends tool calls (evidence: `README.md`)
- Live voice service → Audio utilities: decodes audio (evidence: `services/geminiLiveService.ts`)
- Live voice service → System prompts: gets instructions (evidence: `services/geminiLiveService.ts`)
- Live voice service → Agent tools: executes tools (evidence: `services/geminiLiveService.ts`)
- Agent tools → Data API client: requests data (evidence: `services/tools.ts`)
- Live voice service → App dashboard: updates context (evidence: `services/geminiLiveService.ts`)
- App dashboard → Product cards: renders (evidence: `App.tsx`)
- App dashboard → Product comparison: renders (evidence: `App.tsx`)
- App dashboard → Cart view: renders (evidence: `App.tsx`)
- App dashboard → Order cards: renders (evidence: `App.tsx`)
- App dashboard → Audio visualizer: renders (evidence: `App.tsx`)
- Product cards → Data API client: adds to cart (evidence: `components/ProductCard.tsx`)
- Cart view → Data API client: updates cart (evidence: `components/CartView.tsx`)
- Data API client → FastAPI routes: calls endpoints (evidence: `services/mockData.ts`)
- FastAPI routes → Hybrid search: dispatches search (evidence: `backend/main.py`)
- FastAPI routes → Data loader: loads and serves data (evidence: `backend/main.py`)
- Hybrid search → Data loader: reads catalog data (evidence: `backend/search_logic.py`)
- Hybrid search → Vector search: queries semantic index (evidence: `backend/search_logic.py`)
- Data loader → Vector search: indexes products (evidence: `backend/data_loader.py`)
- Data loader → Product catalog: loads and saves (evidence: `backend/data_loader.py`)
- Data loader → Order records: loads and saves (evidence: `backend/data_loader.py`)
- Data loader → Product FAQs: loads (evidence: `backend/data_loader.py`)
- Hybrid search → Company policies: searches policy content
