# surfwithsb/product-review-dashboard architecture

> Architecture diagram of the GitHub repository surfwithsb/product-review-dashboard, 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/surfwithsb/product-review-dashboard
- Repository: https://github.com/surfwithsb/product-review-dashboard

## Overview

This is a product-review sentiment and summary dashboard. Users submit review text through the frontend; the backend analyzes each review with Groq, saves the resulting review data, and serves a summary for dashboard visualization. The graph preserves the README’s documented upload, analysis, persistence, summary, and chart capabilities. Frontend source files were not present in the supplied tree, so those components use the available `frontend` directory path; their internal wiring is not asserted. The backend call relationships are supported by the excerpts.

Main entry points: [`backend/src/main/java/com/cimba/backend/service/ReviewService.java`](https://github.com/surfwithsb/product-review-dashboard/blob/main/backend/src/main/java/com/cimba/backend/service/ReviewService.java) (Review Service), [`backend/src/main/java/com/cimba/backend/controller/ReviewController.java`](https://github.com/surfwithsb/product-review-dashboard/blob/main/backend/src/main/java/com/cimba/backend/controller/ReviewController.java) (Review Controller), [`backend/src/main/java/com/cimba/backend/repository/ReviewRepository.java`](https://github.com/surfwithsb/product-review-dashboard/blob/main/backend/src/main/java/com/cimba/backend/repository/ReviewRepository.java) (Review Repository), [`frontend`](https://github.com/surfwithsb/product-review-dashboard/tree/main/frontend) (Summary Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Review Dashboard"]
  node_upload_ui["Review Upload"]
  node_dashboard_ui["Summary Dashboard"]
  node_charts["Insight Charts"]
end

subgraph group_api["REST API"]
  node_controller["Review Controller"]
end

subgraph group_analysis["Review Analysis"]
  node_service["Review Service<br/>[ReviewService.java]"]
end

subgraph group_persistence["Review Persistence"]
  node_repository["Review Repository"]
  node_review["Review Entity<br/>[Review.java]"]
end

node_user(("User"))
node_groq{{"Groq LLM"}}
node_postgres[("PostgreSQL")]

node_user -->|"submits reviews"| node_upload_ui
node_upload_ui -->|"uploads text"| node_controller
node_dashboard_ui -->|"fetches summary"| node_controller
node_controller -->|"delegates upload"| node_service
node_controller -->|"requests summary"| node_service
node_service -->|"analyzes review"| node_groq
node_service -->|"saves review"| node_repository
node_service -->|"loads reviews"| node_repository
node_repository -->|"persists entity"| node_review
node_repository -.->|"stores reviews"| node_postgres
node_dashboard_ui -->|"visualizes insights"| node_charts

click node_upload_ui "https://github.com/surfwithsb/product-review-dashboard/tree/main/frontend"
click node_dashboard_ui "https://github.com/surfwithsb/product-review-dashboard/tree/main/frontend"
click node_charts "https://github.com/surfwithsb/product-review-dashboard/tree/main/frontend"
click node_controller "https://github.com/surfwithsb/product-review-dashboard/blob/main/backend/src/main/java/com/cimba/backend/controller/ReviewController.java"
click node_service "https://github.com/surfwithsb/product-review-dashboard/blob/main/backend/src/main/java/com/cimba/backend/service/ReviewService.java"
click node_repository "https://github.com/surfwithsb/product-review-dashboard/blob/main/backend/src/main/java/com/cimba/backend/repository/ReviewRepository.java"
click node_review "https://github.com/surfwithsb/product-review-dashboard/blob/main/backend/src/main/java/com/cimba/backend/model/Review.java"

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_upload_ui,node_dashboard_ui,node_charts,node_user toneBlue
class node_controller,node_postgres toneAmber
class node_service toneMint
class node_repository,node_review toneRose
class node_groq toneIndigo
```

## Components

### Review Dashboard

- [Review Upload](https://github.com/surfwithsb/product-review-dashboard/tree/main/frontend): `frontend`
- [Summary Dashboard](https://github.com/surfwithsb/product-review-dashboard/tree/main/frontend): `frontend`
- [Insight Charts](https://github.com/surfwithsb/product-review-dashboard/tree/main/frontend): `frontend`

### REST API

- [Review Controller](https://github.com/surfwithsb/product-review-dashboard/blob/main/backend/src/main/java/com/cimba/backend/controller/ReviewController.java): `backend/src/main/java/com/cimba/backend/controller/ReviewController.java`

### Review Analysis

- [Review Service](https://github.com/surfwithsb/product-review-dashboard/blob/main/backend/src/main/java/com/cimba/backend/service/ReviewService.java): `backend/src/main/java/com/cimba/backend/service/ReviewService.java`

### Review Persistence

- [Review Repository](https://github.com/surfwithsb/product-review-dashboard/blob/main/backend/src/main/java/com/cimba/backend/repository/ReviewRepository.java): `backend/src/main/java/com/cimba/backend/repository/ReviewRepository.java`
- [Review Entity](https://github.com/surfwithsb/product-review-dashboard/blob/main/backend/src/main/java/com/cimba/backend/model/Review.java): `backend/src/main/java/com/cimba/backend/model/Review.java`

### Other components

- **User**
- **Groq LLM**
- **PostgreSQL**

## Connections

- User → Review Upload: submits reviews (evidence: `README.md`)
- Review Upload → Review Controller: uploads text (evidence: `README.md`)
- Summary Dashboard → Review Controller: fetches summary (evidence: `README.md`)
- Review Controller → Review Service: delegates upload (evidence: `backend/src/main/java/com/cimba/backend/controller/ReviewController.java`)
- Review Controller → Review Service: requests summary (evidence: `backend/src/main/java/com/cimba/backend/controller/ReviewController.java`)
- Review Service → Groq LLM: analyzes review (evidence: `backend/src/main/java/com/cimba/backend/service/ReviewService.java`)
- Review Service → Review Repository: saves review (evidence: `backend/src/main/java/com/cimba/backend/service/ReviewService.java`)
- Review Service → Review Repository: loads reviews (evidence: `backend/src/main/java/com/cimba/backend/service/ReviewService.java`)
- Review Repository → Review Entity: persists entity (evidence: `backend/src/main/java/com/cimba/backend/repository/ReviewRepository.java`)
- Review Repository → PostgreSQL: stores reviews (evidence: `README.md`)
- Summary Dashboard → Insight Charts: visualizes insights (evidence: `README.md`)
