# samrojk/feedbacklens architecture

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

- Interactive diagram: https://gitdiagram.com/samrojk/feedbacklens
- Repository: https://github.com/samrojk/feedbacklens

## Overview

FeedbackLens is a workspace-based customer-feedback analysis app. Its apparent core workflow is importing CSV feedback, analyzing it with AI, and reviewing results in dashboards, analyses, and issue views. The tree also shows authentication, workspace membership and invitations, notifications, and profile/settings capabilities. Source excerpts confirm the analyze endpoint’s workspace check and analysis call, plus selected persistence and notification operations; several other routes are unsampled, so their connections are left unverified.

Main entry points: [`lib/supabase/server.ts`](https://github.com/samrojk/feedbacklens/blob/main/lib/supabase/server.ts) (Supabase store), [`lib/supabase/get-workspace.ts`](https://github.com/samrojk/feedbacklens/blob/main/lib/supabase/get-workspace.ts) (Workspace access), [`app/api/workspace-invitations/route.ts`](https://github.com/samrojk/feedbacklens/blob/main/app/api/workspace-invitations/route.ts) (Invitation management), [`app/(dashboard)/feedback/page.tsx`](https://github.com/samrojk/feedbacklens/blob/main/app/(dashboard)/feedback/page.tsx) (Feedback import)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_feedback["Feedback analysis"]
  node_feedback_ui["Feedback import<br/>[page.tsx]"]
  node_upload_api["CSV upload<br/>[route.ts]"]
  node_csv_parser["CSV parsing<br/>[parser.ts]"]
  node_analyze_api["Analyze endpoint<br/>[route.ts]"]
  node_analysis_engine["Feedback analysis<br/>[analyze.ts]"]
  node_analysis_routes["Analysis records<br/>[route.ts]"]
  node_analysis_detail_api["Analysis detail API<br/>[route.ts]"]
end

subgraph group_insights["Results and insights"]
  node_overview["Workspace overview<br/>[page.tsx]"]
  node_dashboard_data["Dashboard data<br/>[dashboard-data.ts]"]
  node_analysis_detail["Analysis results<br/>[page.tsx]"]
  node_issues["Issue views<br/>[page.tsx]"]
end

subgraph group_workspace["Workspace and access"]
  node_login["Sign in<br/>[page.tsx]"]
  node_signup["Sign up<br/>[page.tsx]"]
  node_auth_api["Authentication API<br/>[route.ts]"]
  node_workspace_ui["Workspace switching"]
  node_workspace_routes["Workspace management<br/>[route.ts]"]
  node_invite_ui["Invitation review<br/>[page.tsx]"]
  node_invite_api["Invitation management<br/>[route.ts]"]
  node_workspace_admin["Member administration<br/>[route.ts]"]
  node_settings_api["Profile and settings<br/>[route.ts]"]
  node_notification_api["Notification API<br/>[route.ts]"]
end

subgraph group_services["Data and integrations"]
  node_workspace_access["Workspace access<br/>[get-workspace.ts]"]
  node_notification_creator["Notification creation"]
  node_supabase[("Supabase store<br/>[server.ts]")]
end

node_user(("User"))
node_gemini{{"Gemini AI"}}

node_user -->|"imports feedback"| node_feedback_ui
node_feedback_ui -.->|"uploads CSV"| node_upload_api
node_upload_api -.->|"parses CSV"| node_csv_parser
node_feedback_ui -.->|"submits feedback"| node_analyze_api
node_analyze_api -->|"checks access"| node_workspace_access
node_analyze_api -->|"analyzes feedback"| node_analysis_engine
node_analysis_engine -.->|"uses model"| node_gemini
node_analysis_routes -.->|"stores records"| node_supabase
node_user -->|"views metrics"| node_overview
node_overview -->|"loads dashboard"| node_dashboard_data
node_dashboard_data -.->|"queries data"| node_supabase
node_user -.->|"views results"| node_analysis_detail
node_user -.->|"reviews issues"| node_issues
node_user -->|"signs in"| node_login
node_user -.->|"creates account"| node_signup
node_login -.->|"submits credentials"| node_auth_api
node_user -.->|"switches workspace"| node_workspace_ui
node_user -->|"reviews invites"| node_invite_ui
node_invite_ui -.->|"requests invitations"| node_invite_api
node_invite_api -->|"checks workspace"| node_workspace_access
node_invite_api -->|"writes invitations"| node_supabase
node_invite_api -->|"creates notice"| node_notification_creator
node_notification_creator -.->|"writes notices"| node_supabase
node_workspace_admin -->|"checks workspace"| node_workspace_access
node_workspace_admin -->|"updates membership"| node_supabase
node_settings_api -->|"checks workspace"| node_workspace_access
node_settings_api -->|"updates settings"| node_supabase
node_notification_api -->|"checks workspace"| node_workspace_access
node_notification_api -->|"reads and updates"| node_supabase

click node_feedback_ui "https://github.com/samrojk/feedbacklens/blob/main/app/(dashboard)/feedback/page.tsx"
click node_upload_api "https://github.com/samrojk/feedbacklens/blob/main/app/api/upload/route.ts"
click node_csv_parser "https://github.com/samrojk/feedbacklens/blob/main/lib/csv/parser.ts"
click node_analyze_api "https://github.com/samrojk/feedbacklens/blob/main/app/api/analyze/route.ts"
click node_analysis_engine "https://github.com/samrojk/feedbacklens/blob/main/lib/ai/analyze.ts"
click node_analysis_routes "https://github.com/samrojk/feedbacklens/blob/main/app/api/analyses/route.ts"
click node_analysis_detail_api "https://github.com/samrojk/feedbacklens/blob/main/app/api/analyses/%5BanalysisId%5D/route.ts"
click node_overview "https://github.com/samrojk/feedbacklens/blob/main/app/(dashboard)/overview/page.tsx"
click node_dashboard_data "https://github.com/samrojk/feedbacklens/blob/main/lib/supabase/dashboard-data.ts"
click node_analysis_detail "https://github.com/samrojk/feedbacklens/blob/main/app/(dashboard)/analyses/%5BanalysisId%5D/page.tsx"
click node_issues "https://github.com/samrojk/feedbacklens/blob/main/app/(dashboard)/issues/page.tsx"
click node_login "https://github.com/samrojk/feedbacklens/blob/main/app/(auth)/login/page.tsx"
click node_signup "https://github.com/samrojk/feedbacklens/blob/main/app/(auth)/signup/page.tsx"
click node_auth_api "https://github.com/samrojk/feedbacklens/blob/main/app/api/auth/login/route.ts"
click node_workspace_access "https://github.com/samrojk/feedbacklens/blob/main/lib/supabase/get-workspace.ts"
click node_workspace_ui "https://github.com/samrojk/feedbacklens/blob/main/components/layout/workspace-switcher.tsx"
click node_workspace_routes "https://github.com/samrojk/feedbacklens/blob/main/app/api/workspaces/route.ts"
click node_invite_ui "https://github.com/samrojk/feedbacklens/blob/main/app/invitations/page.tsx"
click node_invite_api "https://github.com/samrojk/feedbacklens/blob/main/app/api/workspace-invitations/route.ts"
click node_workspace_admin "https://github.com/samrojk/feedbacklens/blob/main/app/api/workspace-management/route.ts"
click node_settings_api "https://github.com/samrojk/feedbacklens/blob/main/app/api/settings/route.ts"
click node_notification_api "https://github.com/samrojk/feedbacklens/blob/main/app/api/notifications/route.ts"
click node_notification_creator "https://github.com/samrojk/feedbacklens/blob/main/lib/notifications/create-notification.ts"
click node_supabase "https://github.com/samrojk/feedbacklens/blob/main/lib/supabase/server.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_feedback_ui,node_upload_api,node_csv_parser,node_analyze_api,node_analysis_engine,node_analysis_routes,node_analysis_detail_api,node_user toneBlue
class node_overview,node_dashboard_data,node_analysis_detail,node_issues toneAmber
class node_login,node_signup,node_auth_api,node_workspace_ui,node_workspace_routes,node_invite_ui,node_invite_api,node_workspace_admin,node_settings_api,node_notification_api toneMint
class node_workspace_access,node_notification_creator,node_supabase toneRose
class node_gemini toneIndigo
```

## Components

### Feedback analysis

- [Feedback import](https://github.com/samrojk/feedbacklens/blob/main/app/(dashboard)/feedback/page.tsx): `app/(dashboard)/feedback/page.tsx`
- [CSV upload](https://github.com/samrojk/feedbacklens/blob/main/app/api/upload/route.ts): `app/api/upload/route.ts`
- [CSV parsing](https://github.com/samrojk/feedbacklens/blob/main/lib/csv/parser.ts): `lib/csv/parser.ts`
- [Analyze endpoint](https://github.com/samrojk/feedbacklens/blob/main/app/api/analyze/route.ts): `app/api/analyze/route.ts`
- [Feedback analysis](https://github.com/samrojk/feedbacklens/blob/main/lib/ai/analyze.ts): `lib/ai/analyze.ts`
- [Analysis records](https://github.com/samrojk/feedbacklens/blob/main/app/api/analyses/route.ts): `app/api/analyses/route.ts`
- [Analysis detail API](https://github.com/samrojk/feedbacklens/blob/main/app/api/analyses/%5BanalysisId%5D/route.ts): `app/api/analyses/[analysisId]/route.ts`

### Results and insights

- [Workspace overview](https://github.com/samrojk/feedbacklens/blob/main/app/(dashboard)/overview/page.tsx): `app/(dashboard)/overview/page.tsx`
- [Dashboard data](https://github.com/samrojk/feedbacklens/blob/main/lib/supabase/dashboard-data.ts): `lib/supabase/dashboard-data.ts`
- [Analysis results](https://github.com/samrojk/feedbacklens/blob/main/app/(dashboard)/analyses/%5BanalysisId%5D/page.tsx): `app/(dashboard)/analyses/[analysisId]/page.tsx`
- [Issue views](https://github.com/samrojk/feedbacklens/blob/main/app/(dashboard)/issues/page.tsx): `app/(dashboard)/issues/page.tsx`

### Workspace and access

- [Sign in](https://github.com/samrojk/feedbacklens/blob/main/app/(auth)/login/page.tsx): `app/(auth)/login/page.tsx`
- [Sign up](https://github.com/samrojk/feedbacklens/blob/main/app/(auth)/signup/page.tsx): `app/(auth)/signup/page.tsx`
- [Authentication API](https://github.com/samrojk/feedbacklens/blob/main/app/api/auth/login/route.ts): `app/api/auth/login/route.ts`
- [Workspace switching](https://github.com/samrojk/feedbacklens/blob/main/components/layout/workspace-switcher.tsx): `components/layout/workspace-switcher.tsx`
- [Workspace management](https://github.com/samrojk/feedbacklens/blob/main/app/api/workspaces/route.ts): `app/api/workspaces/route.ts`
- [Invitation review](https://github.com/samrojk/feedbacklens/blob/main/app/invitations/page.tsx): `app/invitations/page.tsx`
- [Invitation management](https://github.com/samrojk/feedbacklens/blob/main/app/api/workspace-invitations/route.ts): `app/api/workspace-invitations/route.ts`
- [Member administration](https://github.com/samrojk/feedbacklens/blob/main/app/api/workspace-management/route.ts): `app/api/workspace-management/route.ts`
- [Profile and settings](https://github.com/samrojk/feedbacklens/blob/main/app/api/settings/route.ts): `app/api/settings/route.ts`
- [Notification API](https://github.com/samrojk/feedbacklens/blob/main/app/api/notifications/route.ts): `app/api/notifications/route.ts`

### Data and integrations

- [Workspace access](https://github.com/samrojk/feedbacklens/blob/main/lib/supabase/get-workspace.ts): `lib/supabase/get-workspace.ts`
- [Notification creation](https://github.com/samrojk/feedbacklens/blob/main/lib/notifications/create-notification.ts): `lib/notifications/create-notification.ts`
- [Supabase store](https://github.com/samrojk/feedbacklens/blob/main/lib/supabase/server.ts): `lib/supabase/server.ts`

### Other components

- **User**
- **Gemini AI**

## Connections

- User → Feedback import: imports feedback (evidence: `app/(dashboard)/feedback/page.tsx`)
- Feedback import → CSV upload: uploads CSV
- CSV upload → CSV parsing: parses CSV
- Feedback import → Analyze endpoint: submits feedback
- Analyze endpoint → Workspace access: checks access (evidence: `app/api/analyze/route.ts`)
- Analyze endpoint → Feedback analysis: analyzes feedback (evidence: `app/api/analyze/route.ts`)
- Feedback analysis → Gemini AI: uses model
- Analysis records → Supabase store: stores records
- User → Workspace overview: views metrics (evidence: `app/(dashboard)/overview/page.tsx`)
- Workspace overview → Dashboard data: loads dashboard (evidence: `app/(dashboard)/overview/page.tsx`)
- Dashboard data → Supabase store: queries data
- User → Analysis results: views results
- User → Issue views: reviews issues
- User → Sign in: signs in (evidence: `app/(auth)/login/page.tsx`)
- User → Sign up: creates account
- Sign in → Authentication API: submits credentials
- User → Workspace switching: switches workspace
- User → Invitation review: reviews invites (evidence: `app/invitations/page.tsx`)
- Invitation review → Invitation management: requests invitations
- Invitation management → Workspace access: checks workspace (evidence: `app/api/workspace-invitations/route.ts`)
- Invitation management → Supabase store: writes invitations (evidence: `app/api/workspace-invitations/route.ts`)
- Invitation management → Notification creation: creates notice (evidence: `app/api/workspace-invitations/route.ts`)
- Notification creation → Supabase store: writes notices
- Member administration → Workspace access: checks workspace (evidence: `app/api/workspace-management/route.ts`)
- Member administration → Supabase store: updates membership (evidence: `app/api/workspace-management/route.ts`)
- Profile and settings → Workspace access: checks workspace (evidence: `app/api/settings/route.ts`)
- Profile and settings → Supabase store: updates settings (evidence: `app/api/settings/route.ts`)
- Notification API → Workspace access: checks workspace (evidence: `app/api/notifications/route.ts`)
- Notification API → Supabase store: reads and updates (evidence: `app/api/notifications/route.ts`)
