# hariharan024/genai-management-decision-system architecture

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

- Interactive diagram: https://gitdiagram.com/hariharan024/genai-management-decision-system
- Repository: https://github.com/hariharan024/genai-management-decision-system

## Overview

The system turns customer reviews, sales records, and store images into management insights, exposed through a FastAPI dashboard and a generated report. The main pipeline orchestrates the analysis stages; review analysis can use Gemini or a local fallback. Edges follow the sampled source and README. The React-to-dashboard request and documented Gemini integration are shown; unsampled routes and data flows are omitted where their wiring is not evidenced.

Main entry points: [`app/main.py`](https://github.com/hariharan024/genai-management-decision-system/blob/main/app/main.py) (Pipeline Orchestrator), [`app/api.py`](https://github.com/hariharan024/genai-management-decision-system/blob/main/app/api.py) (FastAPI), [`app/batch_analyzer.py`](https://github.com/hariharan024/genai-management-decision-system/blob/main/app/batch_analyzer.py) (Batch Review Analysis), [`app/sentiment.py`](https://github.com/hariharan024/genai-management-decision-system/blob/main/app/sentiment.py) (Sentiment Analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Dashboard and API"]
  node_dashboard["Dashboard UI<br/>[main.jsx]"]
  node_api["FastAPI<br/>[api.py]"]
end

subgraph group_feedback["Customer Feedback"]
  node_review_data["Review File<br/>[reviews.txt]"]
  node_batch["Batch Review Analysis<br/>[batch_analyzer.py]"]
  node_sentiment["Sentiment Analysis<br/>[sentiment.py]"]
  node_prompt["Sentiment Prompt<br/>[prompts.py]"]
  node_cache[("Analysis Cache")]
end

subgraph group_analysis["Business Analysis"]
  node_pipeline["Pipeline Orchestrator<br/>[main.py]"]
  node_aggregation["Feedback Aggregation<br/>[aggregation.py]"]
  node_sales_data["Sales CSV<br/>[sales_data.csv]"]
  node_sales["Sales Analytics<br/>[sales_analysis.py]"]
  node_image_data["Store Images"]
  node_image_analysis["Image Analysis<br/>[image_analysis.py]"]
end

subgraph group_results["Decision and Reporting"]
  node_decision["Decision Engine<br/>[decision_engine.py]"]
  node_report["Report Generator"]
  node_report_file["Management Report"]
end

node_manager(("Manager"))
node_gemini{{"Gemini API"}}

node_manager -->|"uses"| node_dashboard
node_dashboard -->|"fetches dashboard"| node_api
node_api -->|"runs pipeline"| node_pipeline
node_api -->|"analyzes review"| node_sentiment
node_api -->|"serves images"| node_image_data
node_pipeline -->|"analyzes reviews"| node_batch
node_batch -->|"loads reviews"| node_review_data
node_batch -->|"analyzes uncached"| node_sentiment
node_batch -->|"reads and writes"| node_cache
node_sentiment -->|"formats prompt"| node_prompt
node_sentiment -.->|"requests analysis"| node_gemini
node_pipeline -->|"aggregates reviews"| node_aggregation
node_pipeline -->|"analyzes sales"| node_sales
node_sales -->|"reads CSV"| node_sales_data
node_pipeline -->|"analyzes images"| node_image_analysis
node_image_analysis -->|"scans directory"| node_image_data
node_pipeline -->|"builds decision"| node_decision
node_pipeline -->|"generates report"| node_report
node_report -->|"writes report"| node_report_file

click node_dashboard "https://github.com/hariharan024/genai-management-decision-system/blob/main/frontend/src/main.jsx"
click node_api "https://github.com/hariharan024/genai-management-decision-system/blob/main/app/api.py"
click node_pipeline "https://github.com/hariharan024/genai-management-decision-system/blob/main/app/main.py"
click node_review_data "https://github.com/hariharan024/genai-management-decision-system/blob/main/data/feedback/reviews.txt"
click node_batch "https://github.com/hariharan024/genai-management-decision-system/blob/main/app/batch_analyzer.py"
click node_sentiment "https://github.com/hariharan024/genai-management-decision-system/blob/main/app/sentiment.py"
click node_prompt "https://github.com/hariharan024/genai-management-decision-system/blob/main/app/prompts.py"
click node_cache "https://github.com/hariharan024/genai-management-decision-system/blob/main/data/feedback/analysis_results.json"
click node_aggregation "https://github.com/hariharan024/genai-management-decision-system/blob/main/app/aggregation.py"
click node_sales_data "https://github.com/hariharan024/genai-management-decision-system/blob/main/data/sales/sales_data.csv"
click node_sales "https://github.com/hariharan024/genai-management-decision-system/blob/main/app/sales_analysis.py"
click node_image_data "https://github.com/hariharan024/genai-management-decision-system/tree/main/data/images/store"
click node_image_analysis "https://github.com/hariharan024/genai-management-decision-system/blob/main/app/image_analysis.py"
click node_decision "https://github.com/hariharan024/genai-management-decision-system/blob/main/app/decision_engine.py"
click node_report "https://github.com/hariharan024/genai-management-decision-system/blob/main/app/report_generator.py"
click node_report_file "https://github.com/hariharan024/genai-management-decision-system/blob/main/outputs/reports/management_report.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_dashboard,node_api toneBlue
class node_review_data,node_batch,node_sentiment,node_prompt,node_cache toneAmber
class node_pipeline,node_aggregation,node_sales_data,node_sales,node_image_data,node_image_analysis,node_gemini toneMint
class node_decision,node_report,node_report_file toneRose
class node_manager toneIndigo
```

## Components

### Dashboard and API

- [Dashboard UI](https://github.com/hariharan024/genai-management-decision-system/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [FastAPI](https://github.com/hariharan024/genai-management-decision-system/blob/main/app/api.py): `app/api.py`

### Customer Feedback

- [Review File](https://github.com/hariharan024/genai-management-decision-system/blob/main/data/feedback/reviews.txt): `data/feedback/reviews.txt`
- [Batch Review Analysis](https://github.com/hariharan024/genai-management-decision-system/blob/main/app/batch_analyzer.py): `app/batch_analyzer.py`
- [Sentiment Analysis](https://github.com/hariharan024/genai-management-decision-system/blob/main/app/sentiment.py): `app/sentiment.py`
- [Sentiment Prompt](https://github.com/hariharan024/genai-management-decision-system/blob/main/app/prompts.py): `app/prompts.py`
- [Analysis Cache](https://github.com/hariharan024/genai-management-decision-system/blob/main/data/feedback/analysis_results.json): `data/feedback/analysis_results.json`

### Business Analysis

- [Pipeline Orchestrator](https://github.com/hariharan024/genai-management-decision-system/blob/main/app/main.py): `app/main.py`
- [Feedback Aggregation](https://github.com/hariharan024/genai-management-decision-system/blob/main/app/aggregation.py): `app/aggregation.py`
- [Sales CSV](https://github.com/hariharan024/genai-management-decision-system/blob/main/data/sales/sales_data.csv): `data/sales/sales_data.csv`
- [Sales Analytics](https://github.com/hariharan024/genai-management-decision-system/blob/main/app/sales_analysis.py): `app/sales_analysis.py`
- [Store Images](https://github.com/hariharan024/genai-management-decision-system/tree/main/data/images/store): `data/images/store`
- [Image Analysis](https://github.com/hariharan024/genai-management-decision-system/blob/main/app/image_analysis.py): `app/image_analysis.py`

### Decision and Reporting

- [Decision Engine](https://github.com/hariharan024/genai-management-decision-system/blob/main/app/decision_engine.py): `app/decision_engine.py`
- [Report Generator](https://github.com/hariharan024/genai-management-decision-system/blob/main/app/report_generator.py): `app/report_generator.py`
- [Management Report](https://github.com/hariharan024/genai-management-decision-system/blob/main/outputs/reports/management_report.md): `outputs/reports/management_report.md`

### Other components

- **Manager**
- **Gemini API**

## Connections

- Manager → Dashboard UI: uses (evidence: `frontend/src/main.jsx`)
- Dashboard UI → FastAPI: fetches dashboard (evidence: `frontend/src/main.jsx`)
- FastAPI → Pipeline Orchestrator: runs pipeline (evidence: `app/api.py`)
- FastAPI → Sentiment Analysis: analyzes review (evidence: `app/api.py`)
- FastAPI → Store Images: serves images (evidence: `app/api.py`)
- Pipeline Orchestrator → Batch Review Analysis: analyzes reviews (evidence: `app/main.py`)
- Batch Review Analysis → Review File: loads reviews (evidence: `app/batch_analyzer.py`)
- Batch Review Analysis → Sentiment Analysis: analyzes uncached (evidence: `app/batch_analyzer.py`)
- Batch Review Analysis → Analysis Cache: reads and writes (evidence: `app/batch_analyzer.py`)
- Sentiment Analysis → Sentiment Prompt: formats prompt (evidence: `app/sentiment.py`)
- Sentiment Analysis → Gemini API: requests analysis (evidence: `app/sentiment.py`)
- Pipeline Orchestrator → Feedback Aggregation: aggregates reviews (evidence: `app/main.py`)
- Pipeline Orchestrator → Sales Analytics: analyzes sales (evidence: `app/main.py`)
- Sales Analytics → Sales CSV: reads CSV
- Pipeline Orchestrator → Image Analysis: analyzes images (evidence: `app/main.py`)
- Image Analysis → Store Images: scans directory
- Pipeline Orchestrator → Decision Engine: builds decision (evidence: `app/main.py`)
- Pipeline Orchestrator → Report Generator: generates report (evidence: `app/main.py`)
- Report Generator → Management Report: writes report (evidence: `app/report_generator.py`)
