# rakesh-0804/loop architecture

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

- Interactive diagram: https://gitdiagram.com/rakesh-0804/loop
- Repository: https://github.com/rakesh-0804/loop

## Overview

Project Loop is a feedback-management and customer-insight application. Its visible workflow lets users submit or import feedback, review individual items, and view analytics; URL review analysis can optionally import extracted reviews into the inbox. Reporting, themes, and workspace-member management are additional product areas. The excerpts establish several API-to-authentication, AI, and database relationships, but most page-to-API wiring and the purpose or integration of the separate Python backend were not shown.

Main entry points: [`lib/auth.ts`](https://github.com/rakesh-0804/loop/blob/main/lib/auth.ts) (Authentication), [`lib/db.ts`](https://github.com/rakesh-0804/loop/blob/main/lib/db.ts) (Prisma database), [`lib/ai.ts`](https://github.com/rakesh-0804/loop/blob/main/lib/ai.ts) (AI analysis), [`app/(app)/inbox/page.tsx`](https://github.com/rakesh-0804/loop/blob/main/app/(app)/inbox/page.tsx) (Feedback inbox)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_inbox["Feedback inbox<br/>[page.tsx]"]
  node_analysis_page["Analysis view<br/>[page.tsx]"]
  node_reports_page["Reports view<br/>[page.tsx]"]
  node_themes_page["Themes view<br/>[page.tsx]"]
  node_members_page["Member settings<br/>[page.tsx]"]
  node_profile_page["Profile settings<br/>[page.tsx]"]
end

subgraph group_feedback["Feedback workflows"]
  node_feedback_entry["Feedback entry<br/>[FeedbackModal.tsx]"]
  node_csv_import["CSV import<br/>[CSVUploadModal.tsx]"]
  node_review_detail["Feedback review"]
  node_url_reviews["URL review analyzer"]
  node_feedback_api["Feedback API<br/>[route.ts]"]
  node_bulk_api["Bulk upload API<br/>[route.ts]"]
  node_analyze_api["Feedback analysis API<br/>[route.ts]"]
  node_scrape_api["Review scrape API<br/>[route.ts]"]
end

subgraph group_insights["Insights and reporting"]
  node_analysis_api["Analytics API<br/>[route.ts]"]
  node_reports_api["Report API<br/>[route.ts]"]
  node_themes_api["Themes API<br/>[route.ts]"]
  node_ai["AI analysis<br/>[ai.ts]"]
  node_demo_data["Demo feedback<br/>[demo-data.ts]"]
end

subgraph group_platform["Identity and data"]
  node_members_api["Members API<br/>[route.ts]"]
  node_profile_api["Profile API<br/>[route.ts]"]
  node_signup_api["Signup API<br/>[route.ts]"]
  node_auth_api["Auth handler<br/>[route.ts]"]
  node_auth["Authentication<br/>[auth.ts]"]
  node_database[("Prisma database<br/>[db.ts]")]
end

node_user(("Workspace user"))
node_python_backend["Python backend<br/>[app.py]"]

node_user -.->|"opens"| node_dashboard
node_user -.->|"opens"| node_inbox
node_user -.->|"opens"| node_analysis_page
node_user -.->|"opens"| node_reports_page
node_user -.->|"opens"| node_themes_page
node_user -.->|"opens"| node_members_page
node_user -.->|"opens"| node_profile_page
node_inbox -->|"renders"| node_csv_import
node_inbox -->|"renders"| node_review_detail
node_inbox -->|"renders"| node_url_reviews
node_dashboard -->|"renders"| node_url_reviews
node_feedback_entry -->|"renders"| node_review_detail
node_url_reviews -->|"requests analysis"| node_scrape_api
node_review_detail -->|"requests analysis"| node_analyze_api
node_review_detail -->|"updates status"| node_feedback_api
node_scrape_api -->|"checks session"| node_auth
node_scrape_api -->|"analyzes reviews"| node_ai
node_scrape_api -->|"imports reviews"| node_database
node_feedback_api -->|"checks session"| node_auth
node_feedback_api -->|"reads and writes"| node_database
node_feedback_api -->|"analyzes feedback"| node_ai
node_bulk_api -->|"checks session"| node_auth
node_bulk_api -->|"writes feedback"| node_database
node_bulk_api -->|"analyzes feedback"| node_ai
node_analyze_api -->|"checks session"| node_auth
node_analyze_api -->|"reads and writes"| node_database
node_analyze_api -->|"analyzes feedback"| node_ai
node_analysis_api -->|"checks session"| node_auth
node_analysis_api -->|"reads feedback"| node_database
node_analysis_api -->|"uses fallback data"| node_demo_data
node_reports_api -->|"checks session"| node_auth
node_reports_api -->|"reads and saves"| node_database
node_reports_api -->|"generates report"| node_ai
node_themes_api -->|"checks session"| node_auth
node_themes_api -->|"reads and writes"| node_database
node_members_api -->|"checks session"| node_auth
node_members_api -->|"manages members"| node_database
node_profile_api -->|"checks session"| node_auth
node_profile_api -->|"reads and writes"| node_database
node_signup_api -->|"creates account"| node_database
node_auth_api -->|"registers handlers"| node_auth
node_auth -->|"looks up users"| node_database

click node_dashboard "https://github.com/rakesh-0804/loop/blob/main/app/(app)/dashboard/page.tsx"
click node_inbox "https://github.com/rakesh-0804/loop/blob/main/app/(app)/inbox/page.tsx"
click node_analysis_page "https://github.com/rakesh-0804/loop/blob/main/app/(app)/analysis/page.tsx"
click node_reports_page "https://github.com/rakesh-0804/loop/blob/main/app/(app)/reports/page.tsx"
click node_themes_page "https://github.com/rakesh-0804/loop/blob/main/app/(app)/themes/page.tsx"
click node_members_page "https://github.com/rakesh-0804/loop/blob/main/app/(app)/settings/members/page.tsx"
click node_profile_page "https://github.com/rakesh-0804/loop/blob/main/app/(app)/settings/profile/page.tsx"
click node_feedback_entry "https://github.com/rakesh-0804/loop/blob/main/app/components/FeedbackModal.tsx"
click node_csv_import "https://github.com/rakesh-0804/loop/blob/main/app/components/CSVUploadModal.tsx"
click node_review_detail "https://github.com/rakesh-0804/loop/blob/main/app/components/FeedbackReviewModal.tsx"
click node_url_reviews "https://github.com/rakesh-0804/loop/blob/main/app/components/URLReviewAnalyzerModal.tsx"
click node_feedback_api "https://github.com/rakesh-0804/loop/blob/main/app/api/feedback/route.ts"
click node_bulk_api "https://github.com/rakesh-0804/loop/blob/main/app/api/feedback/bulk-upload/route.ts"
click node_analyze_api "https://github.com/rakesh-0804/loop/blob/main/app/api/feedback/analyze/route.ts"
click node_scrape_api "https://github.com/rakesh-0804/loop/blob/main/app/api/feedback/scrape-url/route.ts"
click node_analysis_api "https://github.com/rakesh-0804/loop/blob/main/app/api/analysis/route.ts"
click node_reports_api "https://github.com/rakesh-0804/loop/blob/main/app/api/reports/route.ts"
click node_themes_api "https://github.com/rakesh-0804/loop/blob/main/app/api/themes/route.ts"
click node_members_api "https://github.com/rakesh-0804/loop/blob/main/app/api/members/route.ts"
click node_profile_api "https://github.com/rakesh-0804/loop/blob/main/app/api/user/profile/route.ts"
click node_signup_api "https://github.com/rakesh-0804/loop/blob/main/app/api/signup/route.ts"
click node_auth_api "https://github.com/rakesh-0804/loop/blob/main/app/api/auth/%5B...nextauth%5D/route.ts"
click node_auth "https://github.com/rakesh-0804/loop/blob/main/lib/auth.ts"
click node_database "https://github.com/rakesh-0804/loop/blob/main/lib/db.ts"
click node_ai "https://github.com/rakesh-0804/loop/blob/main/lib/ai.ts"
click node_demo_data "https://github.com/rakesh-0804/loop/blob/main/lib/demo-data.ts"
click node_python_backend "https://github.com/rakesh-0804/loop/blob/main/backend/app.py"

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_inbox,node_analysis_page,node_reports_page,node_themes_page,node_members_page,node_profile_page,node_user toneBlue
class node_feedback_entry,node_csv_import,node_review_detail,node_url_reviews,node_feedback_api,node_bulk_api,node_analyze_api,node_scrape_api toneAmber
class node_analysis_api,node_reports_api,node_themes_api,node_ai,node_demo_data toneMint
class node_members_api,node_profile_api,node_signup_api,node_auth_api,node_auth,node_database toneRose
class node_python_backend toneTeal
```

## Components

### User experience

- [Dashboard](https://github.com/rakesh-0804/loop/blob/main/app/(app)/dashboard/page.tsx): `app/(app)/dashboard/page.tsx`
- [Feedback inbox](https://github.com/rakesh-0804/loop/blob/main/app/(app)/inbox/page.tsx): `app/(app)/inbox/page.tsx`
- [Analysis view](https://github.com/rakesh-0804/loop/blob/main/app/(app)/analysis/page.tsx): `app/(app)/analysis/page.tsx`
- [Reports view](https://github.com/rakesh-0804/loop/blob/main/app/(app)/reports/page.tsx): `app/(app)/reports/page.tsx`
- [Themes view](https://github.com/rakesh-0804/loop/blob/main/app/(app)/themes/page.tsx): `app/(app)/themes/page.tsx`
- [Member settings](https://github.com/rakesh-0804/loop/blob/main/app/(app)/settings/members/page.tsx): `app/(app)/settings/members/page.tsx`
- [Profile settings](https://github.com/rakesh-0804/loop/blob/main/app/(app)/settings/profile/page.tsx): `app/(app)/settings/profile/page.tsx`

### Feedback workflows

- [Feedback entry](https://github.com/rakesh-0804/loop/blob/main/app/components/FeedbackModal.tsx): `app/components/FeedbackModal.tsx`
- [CSV import](https://github.com/rakesh-0804/loop/blob/main/app/components/CSVUploadModal.tsx): `app/components/CSVUploadModal.tsx`
- [Feedback review](https://github.com/rakesh-0804/loop/blob/main/app/components/FeedbackReviewModal.tsx): `app/components/FeedbackReviewModal.tsx`
- [URL review analyzer](https://github.com/rakesh-0804/loop/blob/main/app/components/URLReviewAnalyzerModal.tsx): `app/components/URLReviewAnalyzerModal.tsx`
- [Feedback API](https://github.com/rakesh-0804/loop/blob/main/app/api/feedback/route.ts): `app/api/feedback/route.ts`
- [Bulk upload API](https://github.com/rakesh-0804/loop/blob/main/app/api/feedback/bulk-upload/route.ts): `app/api/feedback/bulk-upload/route.ts`
- [Feedback analysis API](https://github.com/rakesh-0804/loop/blob/main/app/api/feedback/analyze/route.ts): `app/api/feedback/analyze/route.ts`
- [Review scrape API](https://github.com/rakesh-0804/loop/blob/main/app/api/feedback/scrape-url/route.ts): `app/api/feedback/scrape-url/route.ts`

### Insights and reporting

- [Analytics API](https://github.com/rakesh-0804/loop/blob/main/app/api/analysis/route.ts): `app/api/analysis/route.ts`
- [Report API](https://github.com/rakesh-0804/loop/blob/main/app/api/reports/route.ts): `app/api/reports/route.ts`
- [Themes API](https://github.com/rakesh-0804/loop/blob/main/app/api/themes/route.ts): `app/api/themes/route.ts`
- [AI analysis](https://github.com/rakesh-0804/loop/blob/main/lib/ai.ts): `lib/ai.ts`
- [Demo feedback](https://github.com/rakesh-0804/loop/blob/main/lib/demo-data.ts): `lib/demo-data.ts`

### Identity and data

- [Members API](https://github.com/rakesh-0804/loop/blob/main/app/api/members/route.ts): `app/api/members/route.ts`
- [Profile API](https://github.com/rakesh-0804/loop/blob/main/app/api/user/profile/route.ts): `app/api/user/profile/route.ts`
- [Signup API](https://github.com/rakesh-0804/loop/blob/main/app/api/signup/route.ts): `app/api/signup/route.ts`
- [Auth handler](https://github.com/rakesh-0804/loop/blob/main/app/api/auth/%5B...nextauth%5D/route.ts): `app/api/auth/[...nextauth]/route.ts`
- [Authentication](https://github.com/rakesh-0804/loop/blob/main/lib/auth.ts): `lib/auth.ts`
- [Prisma database](https://github.com/rakesh-0804/loop/blob/main/lib/db.ts): `lib/db.ts`

### Other components

- **Workspace user**
- [Python backend](https://github.com/rakesh-0804/loop/blob/main/backend/app.py): `backend/app.py`

## Connections

- Workspace user → Dashboard: opens
- Workspace user → Feedback inbox: opens
- Workspace user → Analysis view: opens
- Workspace user → Reports view: opens
- Workspace user → Themes view: opens
- Workspace user → Member settings: opens
- Workspace user → Profile settings: opens
- Feedback inbox → CSV import: renders (evidence: `app/(app)/inbox/page.tsx`)
- Feedback inbox → Feedback review: renders (evidence: `app/(app)/inbox/page.tsx`)
- Feedback inbox → URL review analyzer: renders (evidence: `app/(app)/inbox/page.tsx`)
- Dashboard → URL review analyzer: renders (evidence: `app/(app)/dashboard/page.tsx`)
- Feedback entry → Feedback review: renders (evidence: `app/components/FeedbackModal.tsx`)
- URL review analyzer → Review scrape API: requests analysis (evidence: `app/components/URLReviewAnalyzerModal.tsx`)
- Feedback review → Feedback analysis API: requests analysis (evidence: `app/components/FeedbackReviewModal.tsx`)
- Feedback review → Feedback API: updates status (evidence: `app/components/FeedbackReviewModal.tsx`)
- Review scrape API → Authentication: checks session (evidence: `app/api/feedback/scrape-url/route.ts`)
- Review scrape API → AI analysis: analyzes reviews (evidence: `app/api/feedback/scrape-url/route.ts`)
- Review scrape API → Prisma database: imports reviews (evidence: `app/api/feedback/scrape-url/route.ts`)
- Feedback API → Authentication: checks session (evidence: `app/api/feedback/route.ts`)
- Feedback API → Prisma database: reads and writes (evidence: `app/api/feedback/route.ts`)
- Feedback API → AI analysis: analyzes feedback (evidence: `app/api/feedback/route.ts`)
- Bulk upload API → Authentication: checks session (evidence: `app/api/feedback/bulk-upload/route.ts`)
- Bulk upload API → Prisma database: writes feedback (evidence: `app/api/feedback/bulk-upload/route.ts`)
- Bulk upload API → AI analysis: analyzes feedback (evidence: `app/api/feedback/bulk-upload/route.ts`)
- Feedback analysis API → Authentication: checks session (evidence: `app/api/feedback/analyze/route.ts`)
- Feedback analysis API → Prisma database: reads and writes (evidence: `app/api/feedback/analyze/route.ts`)
- Feedback analysis API → AI analysis: analyzes feedback (evidence: `app/api/feedback/analyze/route.ts`)
- Analytics API → Authentication: checks session (evidence: `app/api/analysis/route.ts`)
- Analytics API → Prisma database: reads feedback (evidence: `app/api/analysis/route.ts`)
- Analytics API → Demo feedback: uses fallback data (evidence: `app/api/analysis/route.ts`)
- Report API → Authentication: checks session (evidence: `app/api/reports/route.ts`)
- Report API → Prisma database: reads and saves (evidence: `app/api/reports/route.ts`)
- Report API → AI analysis: generates report (evidence: `app/api/reports/route.ts`)
- Themes API → Authentication: checks session (evidence: `app/api/themes/route.ts`)
- Themes API → Prisma database: reads and writes (evidence: `app/api/themes/route.ts`)
- Members API → Authentication: checks session (evidence: `app/api/members/route.ts`)
- Members API → Prisma database: manages members (evidence: `app/api/members/route.ts`)
- Profile API → Authentication: checks session (evidence: `app/api/user/profile/route.ts`)
- Profile API → Prisma database: reads and writes (evidence: `app/api/user/profile/route.ts`)
- Signup API → Prisma database: creates account (evidence: `app/api/signup/route.ts`)
- Auth handler → Authentication: registers handlers (evidence: `app/api/auth/[...nextauth]/route.ts`)
- Authentication → Prisma database: looks up users (evidence: `lib/auth.ts`)
