# likithraj9956dynamic/freshgaurd-ai architecture

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

- Interactive diagram: https://gitdiagram.com/likithraj9956dynamic/freshgaurd-ai
- Repository: https://github.com/likithraj9956dynamic/freshgaurd-ai

## Overview

FreshGuard AI is a retail-operations intelligence UI for monitoring store health and moving from detected issues to investigation, decisions, and actions. Its main workflow starts at the dashboard, opens store or investigation detail, and offers decision simulation and action review; separate workspaces cover network health, store-manager directives, and barcode verification. Demo data is supplied through a shared hook, while product lookup calls Open Food Facts. Source excerpts and the index establish the main routes and several component calls; unsampled page internals are not inferred.

Main entry points: [`src/App.tsx`](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/App.tsx) (Application routes), [`src/pages/InvestigationRoom.tsx`](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/InvestigationRoom.tsx) (Investigation room), [`src/hooks/useDemos.ts`](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/hooks/useDemos.ts) (Demo data hook), [`src/pages/Dashboard.tsx`](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/Dashboard.tsx) (Operations dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_app["Application routes<br/>[App.tsx]"]
  node_shell["App shell<br/>[AppShell.tsx]"]
  node_state["Loading and empty states<br/>[state.tsx]"]
  node_badge["Status badges<br/>[badges.tsx]"]
end

subgraph group_ops["Operations intelligence"]
  node_dashboard["Operations dashboard<br/>[Dashboard.tsx]"]
  node_store["Store overview<br/>[StoreOverview.tsx]"]
  node_network["Store network<br/>[Network.tsx]"]
  node_manager["Store directives<br/>[StoreManager.tsx]"]
end

subgraph group_response["Issue response"]
  node_investigation["Investigation room"]
  node_evidence["Investigation evidence"]
  node_challenge["Issue challenge"]
  node_graph["Investigation graph"]
  node_decisions["Decision centre<br/>[DecisionCentre.tsx]"]
  node_actions["Action centre<br/>[ActionCenter.tsx]"]
  node_simulator["What-if simulator"]
end

subgraph group_data["Data and integrations"]
  node_lookup["Product lookup<br/>[ProductLookup.tsx]"]
  node_demo["Demo data hook<br/>[useDemos.ts]"]
  node_offclient["Open Food Facts client<br/>[openfoodfacts.ts]"]
  node_types["Domain types<br/>[issue.ts]"]
  node_barcode_types["Product API types<br/>[openfoodfacts.ts]"]
end

node_operator(("Retail operator"))
node_off["Open Food Facts API"]

node_operator -->|"opens"| node_app
node_app -->|"wraps routes"| node_shell
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_store
node_app -->|"routes to"| node_investigation
node_app -->|"routes to"| node_decisions
node_app -->|"routes to"| node_network
node_app -->|"routes to"| node_actions
node_app -->|"routes to"| node_manager
node_app -->|"routes to"| node_lookup
node_shell -->|"hosts routes"| node_app
node_dashboard -->|"reads demo data"| node_demo
node_store -->|"reads demo data"| node_demo
node_network -->|"reads demo data"| node_demo
node_manager -->|"reads demo data"| node_demo
node_investigation -->|"reads demo data"| node_demo
node_decisions -->|"reads demo data"| node_demo
node_actions -->|"reads demo data"| node_demo
node_dashboard -->|"renders status"| node_badge
node_dashboard -->|"renders empty state"| node_state
node_store -->|"renders loading state"| node_state
node_investigation -->|"renders"| node_evidence
node_investigation -->|"renders"| node_challenge
node_investigation -->|"renders"| node_graph
node_decisions -->|"renders"| node_simulator
node_lookup -->|"fetches product"| node_offclient
node_offclient -->|"requests product"| node_off
node_offclient -->|"uses response types"| node_barcode_types
node_investigation -->|"uses domain types"| node_types

click node_app "https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/App.tsx"
click node_shell "https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/components/AppShell.tsx"
click node_dashboard "https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/Dashboard.tsx"
click node_store "https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/StoreOverview.tsx"
click node_network "https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/Network.tsx"
click node_manager "https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/StoreManager.tsx"
click node_investigation "https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/InvestigationRoom.tsx"
click node_evidence "https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/InvestigationRoomEvidence.tsx"
click node_challenge "https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/InvestigationRoomChallenge.tsx"
click node_graph "https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/InvestigationRoomGraph.tsx"
click node_decisions "https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/DecisionCentre.tsx"
click node_actions "https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/ActionCenter.tsx"
click node_lookup "https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/ProductLookup.tsx"
click node_demo "https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/hooks/useDemos.ts"
click node_offclient "https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/services/openfoodfacts.ts"
click node_types "https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/types/issue.ts"
click node_barcode_types "https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/types/openfoodfacts.ts"
click node_state "https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/components/state.tsx"
click node_badge "https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/components/badges.tsx"
click node_simulator "https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/components/WhatIfSimulator.tsx"

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_shell,node_state,node_badge toneBlue
class node_dashboard,node_store,node_network,node_manager toneAmber
class node_investigation,node_evidence,node_challenge,node_graph,node_decisions,node_actions,node_simulator,node_off toneMint
class node_lookup,node_demo,node_offclient,node_types,node_barcode_types toneRose
class node_operator toneIndigo
```

## Components

### Application shell

- [Application routes](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/App.tsx): `src/App.tsx`
- [App shell](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/components/AppShell.tsx): `src/components/AppShell.tsx`
- [Loading and empty states](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/components/state.tsx): `src/components/state.tsx`
- [Status badges](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/components/badges.tsx): `src/components/badges.tsx`

### Operations intelligence

- [Operations dashboard](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`
- [Store overview](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/StoreOverview.tsx): `src/pages/StoreOverview.tsx`
- [Store network](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/Network.tsx): `src/pages/Network.tsx`
- [Store directives](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/StoreManager.tsx): `src/pages/StoreManager.tsx`

### Issue response

- [Investigation room](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/InvestigationRoom.tsx): `src/pages/InvestigationRoom.tsx`
- [Investigation evidence](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/InvestigationRoomEvidence.tsx): `src/pages/InvestigationRoomEvidence.tsx`
- [Issue challenge](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/InvestigationRoomChallenge.tsx): `src/pages/InvestigationRoomChallenge.tsx`
- [Investigation graph](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/InvestigationRoomGraph.tsx): `src/pages/InvestigationRoomGraph.tsx`
- [Decision centre](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/DecisionCentre.tsx): `src/pages/DecisionCentre.tsx`
- [Action centre](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/ActionCenter.tsx): `src/pages/ActionCenter.tsx`
- [What-if simulator](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/components/WhatIfSimulator.tsx): `src/components/WhatIfSimulator.tsx`

### Data and integrations

- [Product lookup](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/pages/ProductLookup.tsx): `src/pages/ProductLookup.tsx`
- [Demo data hook](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/hooks/useDemos.ts): `src/hooks/useDemos.ts`
- [Open Food Facts client](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/services/openfoodfacts.ts): `src/services/openfoodfacts.ts`
- [Domain types](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/types/issue.ts): `src/types/issue.ts`
- [Product API types](https://github.com/likithraj9956dynamic/freshgaurd-ai/blob/master/src/types/openfoodfacts.ts): `src/types/openfoodfacts.ts`

### Other components

- **Retail operator**
- **Open Food Facts API**

## Connections

- Retail operator → Application routes: opens (evidence: `src/App.tsx`)
- Application routes → App shell: wraps routes (evidence: `src/App.tsx`)
- Application routes → Operations dashboard: routes to (evidence: `src/App.tsx`)
- Application routes → Store overview: routes to (evidence: `src/App.tsx`)
- Application routes → Investigation room: routes to (evidence: `src/App.tsx`)
- Application routes → Decision centre: routes to (evidence: `src/App.tsx`)
- Application routes → Store network: routes to (evidence: `src/App.tsx`)
- Application routes → Action centre: routes to (evidence: `src/App.tsx`)
- Application routes → Store directives: routes to (evidence: `src/App.tsx`)
- Application routes → Product lookup: routes to (evidence: `src/App.tsx`)
- App shell → Application routes: hosts routes (evidence: `src/components/AppShell.tsx`)
- Operations dashboard → Demo data hook: reads demo data (evidence: `src/pages/Dashboard.tsx`)
- Store overview → Demo data hook: reads demo data (evidence: `src/pages/StoreOverview.tsx`)
- Store network → Demo data hook: reads demo data (evidence: `src/pages/Network.tsx`)
- Store directives → Demo data hook: reads demo data (evidence: `src/pages/StoreManager.tsx`)
- Investigation room → Demo data hook: reads demo data (evidence: `src/pages/InvestigationRoom.tsx`)
- Decision centre → Demo data hook: reads demo data (evidence: `src/pages/DecisionCentre.tsx`)
- Action centre → Demo data hook: reads demo data (evidence: `src/pages/ActionCenter.tsx`)
- Operations dashboard → Status badges: renders status (evidence: `src/pages/Dashboard.tsx`)
- Operations dashboard → Loading and empty states: renders empty state (evidence: `src/pages/Dashboard.tsx`)
- Store overview → Loading and empty states: renders loading state (evidence: `src/pages/StoreOverview.tsx`)
- Investigation room → Investigation evidence: renders (evidence: `src/pages/InvestigationRoom.tsx`)
- Investigation room → Issue challenge: renders (evidence: `src/pages/InvestigationRoom.tsx`)
- Investigation room → Investigation graph: renders (evidence: `src/pages/InvestigationRoom.tsx`)
- Decision centre → What-if simulator: renders (evidence: `src/pages/DecisionCentre.tsx`)
- Product lookup → Open Food Facts client: fetches product (evidence: `src/pages/ProductLookup.tsx`)
- Open Food Facts client → Open Food Facts API: requests product (evidence: `src/services/openfoodfacts.ts`)
- Open Food Facts client → Product API types: uses response types (evidence: `src/services/openfoodfacts.ts`)
- Investigation room → Domain types: uses domain types (evidence: `src/pages/InvestigationRoom.tsx`)
