# anandhu-experience/review-impact-analysis architecture

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

- Interactive diagram: https://gitdiagram.com/anandhu-experience/review-impact-analysis
- Repository: https://github.com/anandhu-experience/review-impact-analysis

## Overview

RIA is a front-end review-intelligence MVP for restaurant owners, built to close the loop from negative customer feedback to an operational fix and measured outcome. The principal workflow moves from dashboard and review triage through problem analysis, peer and positive-review comparison, root cause, remedy, action tracking, and before/after impact verdict. Seeded deterministic data supports the demo; Zustand coordinates session and action state. The README documents the full product flow; source excerpts and index support several internal calls, but unsampled page and service implementations are not assumed inspected.

Main entry points: [`src/store/useRIAStore.ts`](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/store/useRIAStore.ts) (Application State), [`src/components/analysis/ReviewAnalysis.tsx`](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/components/analysis/ReviewAnalysis.tsx) (Analysis View), [`src/services/impactAnalysisService.ts`](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/services/impactAnalysisService.ts) (Before-After Analysis), [`src/services/reviewAnalysisService.ts`](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/services/reviewAnalysisService.ts) (Problem Detection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Owner Experience"]
  node_login["Mock Sign-In<br/>[LoginPage.tsx]"]
  node_dashboard["Wake-Up Dashboard<br/>[DashboardPage.tsx]"]
  node_reviews["Review Triage<br/>[ReviewsPage.tsx]"]
  node_reviewtable["Review Table<br/>[ReviewTable.tsx]"]
end

subgraph group_analysis["Review Analysis"]
  node_analysispage["Review Analysis Page<br/>[AnalysisPage.tsx]"]
  node_analysisview["Analysis View<br/>[ReviewAnalysis.tsx]"]
  node_detect["Problem Detection"]
  node_peer["Peer Benchmark"]
  node_positive["Positive Review Contrast"]
  node_rootcause["Root Cause Analysis"]
  node_remedy["Remedy Selection<br/>[remedyService.ts]"]
end

subgraph group_operations["Action And Impact"]
  node_actionpage["Action Plan<br/>[ActionPlanPage.tsx]"]
  node_actionservice["Action Lifecycle"]
  node_impactpage["Impact Verdict<br/>[ImpactPage.tsx]"]
  node_impactservice["Before-After Analysis"]
end

subgraph group_foundation["Data And State"]
  node_store["Application State<br/>[useRIAStore.ts]"]
  node_seed[("Deterministic Demo Data<br/>[seed.ts]")]
  node_auth["Supabase Auth<br/>[supabase.ts]"]
end

node_owner(("Restaurant Owner"))

node_owner -->|"signs in"| node_login
node_login -->|"enters app"| node_dashboard
node_dashboard -->|"opens reviews"| node_reviews
node_reviews -->|"renders reviews"| node_reviewtable
node_reviews -->|"classifies reviews"| node_detect
node_reviews -->|"opens review"| node_analysispage
node_analysispage -.->|"analyzes review"| node_detect
node_analysispage -.->|"renders analysis"| node_analysisview
node_analysisview -->|"shows benchmark"| node_peer
node_analysisview -->|"shows contrast"| node_positive
node_analysisview -->|"shows cause"| node_rootcause
node_analysisview -->|"shows remedy"| node_remedy
node_detect -->|"compares peers"| node_peer
node_detect -->|"finds contrasts"| node_positive
node_owner -->|"commits fix"| node_actionpage
node_actionpage -.->|"updates action"| node_store
node_store -->|"creates action"| node_actionservice
node_owner -->|"collects reviews"| node_impactpage
node_impactpage -.->|"requests verdict"| node_store
node_store -->|"computes impact"| node_impactservice
node_impactservice -->|"detects complaints"| node_detect
node_impactservice -->|"benchmarks change"| node_peer
node_impactservice -->|"gets next remedy"| node_remedy
node_store -->|"loads demo data"| node_seed
node_impactservice -->|"reads scenarios"| node_seed
node_store -->|"fetches owner"| node_auth
node_store -.->|"persists session"| node_owner

click node_login "https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/pages/LoginPage.tsx"
click node_dashboard "https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/pages/DashboardPage.tsx"
click node_reviews "https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/pages/ReviewsPage.tsx"
click node_reviewtable "https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/components/reviews/ReviewTable.tsx"
click node_analysispage "https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/pages/AnalysisPage.tsx"
click node_analysisview "https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/components/analysis/ReviewAnalysis.tsx"
click node_detect "https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/services/reviewAnalysisService.ts"
click node_peer "https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/services/peerComparisonService.ts"
click node_positive "https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/services/positiveReviewService.ts"
click node_rootcause "https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/services/rootCauseService.ts"
click node_remedy "https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/services/remedyService.ts"
click node_actionpage "https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/pages/ActionPlanPage.tsx"
click node_actionservice "https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/services/actionPlanService.ts"
click node_impactpage "https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/pages/ImpactPage.tsx"
click node_impactservice "https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/services/impactAnalysisService.ts"
click node_store "https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/store/useRIAStore.ts"
click node_seed "https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/data/seed.ts"
click node_auth "https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/lib/supabase.ts"

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_login,node_dashboard,node_reviews,node_reviewtable toneBlue
class node_analysispage,node_analysisview,node_detect,node_peer,node_positive,node_rootcause,node_remedy toneAmber
class node_actionpage,node_actionservice,node_impactpage,node_impactservice toneMint
class node_store,node_seed,node_auth toneRose
class node_owner toneIndigo
```

## Components

### Owner Experience

- [Mock Sign-In](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/pages/LoginPage.tsx): `src/pages/LoginPage.tsx`
- [Wake-Up Dashboard](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/pages/DashboardPage.tsx): `src/pages/DashboardPage.tsx`
- [Review Triage](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/pages/ReviewsPage.tsx): `src/pages/ReviewsPage.tsx`
- [Review Table](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/components/reviews/ReviewTable.tsx): `src/components/reviews/ReviewTable.tsx`

### Review Analysis

- [Review Analysis Page](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/pages/AnalysisPage.tsx): `src/pages/AnalysisPage.tsx`
- [Analysis View](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/components/analysis/ReviewAnalysis.tsx): `src/components/analysis/ReviewAnalysis.tsx`
- [Problem Detection](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/services/reviewAnalysisService.ts): `src/services/reviewAnalysisService.ts`
- [Peer Benchmark](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/services/peerComparisonService.ts): `src/services/peerComparisonService.ts`
- [Positive Review Contrast](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/services/positiveReviewService.ts): `src/services/positiveReviewService.ts`
- [Root Cause Analysis](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/services/rootCauseService.ts): `src/services/rootCauseService.ts`
- [Remedy Selection](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/services/remedyService.ts): `src/services/remedyService.ts`

### Action And Impact

- [Action Plan](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/pages/ActionPlanPage.tsx): `src/pages/ActionPlanPage.tsx`
- [Action Lifecycle](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/services/actionPlanService.ts): `src/services/actionPlanService.ts`
- [Impact Verdict](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/pages/ImpactPage.tsx): `src/pages/ImpactPage.tsx`
- [Before-After Analysis](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/services/impactAnalysisService.ts): `src/services/impactAnalysisService.ts`

### Data And State

- [Application State](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/store/useRIAStore.ts): `src/store/useRIAStore.ts`
- [Deterministic Demo Data](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/data/seed.ts): `src/data/seed.ts`
- [Supabase Auth](https://github.com/anandhu-experience/review-impact-analysis/blob/anandhu-subramaniam/ria/src/lib/supabase.ts): `src/lib/supabase.ts`

### Other components

- **Restaurant Owner**

## Connections

- Restaurant Owner → Mock Sign-In: signs in
- Mock Sign-In → Wake-Up Dashboard: enters app
- Wake-Up Dashboard → Review Triage: opens reviews
- Review Triage → Review Table: renders reviews (evidence: `src/pages/ReviewsPage.tsx`)
- Review Triage → Problem Detection: classifies reviews (evidence: `src/pages/ReviewsPage.tsx`)
- Review Triage → Review Analysis Page: opens review
- Review Analysis Page → Problem Detection: analyzes review
- Review Analysis Page → Analysis View: renders analysis
- Analysis View → Peer Benchmark: shows benchmark (evidence: `src/components/analysis/ReviewAnalysis.tsx`)
- Analysis View → Positive Review Contrast: shows contrast (evidence: `src/components/analysis/ReviewAnalysis.tsx`)
- Analysis View → Root Cause Analysis: shows cause (evidence: `src/components/analysis/ReviewAnalysis.tsx`)
- Analysis View → Remedy Selection: shows remedy (evidence: `src/components/analysis/ReviewAnalysis.tsx`)
- Problem Detection → Peer Benchmark: compares peers (evidence: `src/services/reviewAnalysisService.ts`)
- Problem Detection → Positive Review Contrast: finds contrasts (evidence: `src/services/reviewAnalysisService.ts`)
- Restaurant Owner → Action Plan: commits fix
- Action Plan → Application State: updates action
- Application State → Action Lifecycle: creates action (evidence: `src/store/useRIAStore.ts`)
- Restaurant Owner → Impact Verdict: collects reviews
- Impact Verdict → Application State: requests verdict (evidence: `src/pages/ImpactPage.tsx`)
- Application State → Before-After Analysis: computes impact (evidence: `src/store/useRIAStore.ts`)
- Before-After Analysis → Problem Detection: detects complaints (evidence: `src/services/impactAnalysisService.ts`)
- Before-After Analysis → Peer Benchmark: benchmarks change (evidence: `src/services/impactAnalysisService.ts`)
- Before-After Analysis → Remedy Selection: gets next remedy (evidence: `src/services/impactAnalysisService.ts`)
- Application State → Deterministic Demo Data: loads demo data (evidence: `src/store/useRIAStore.ts`)
- Before-After Analysis → Deterministic Demo Data: reads scenarios (evidence: `src/services/impactAnalysisService.ts`)
- Application State → Supabase Auth: fetches owner (evidence: `src/store/useRIAStore.ts`)
- Application State → Restaurant Owner: persists session
