# sahilsahu731/repomind architecture

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

- Interactive diagram: https://gitdiagram.com/sahilsahu731/repomind
- Repository: https://github.com/sahilsahu731/repomind

## Overview

RepoMind turns GitHub repositories into navigable engineering reports. The main workflow accepts an analysis request, checks repository access and existing work, creates a job, and queues analysis; users then inspect saved results in the web workspace or extension. The report covers architecture, dependencies, entry points, technology choices, and contribution signals. GitHub account and installation support and extension-specific analysis, chat, and comparison are additional product branches. Some implementation relationships are not shown in the sampled excerpts, so those links are omitted rather than inferred.

Main entry points: [`src/app/api/repos/analyze/route.ts`](https://github.com/sahilsahu731/repomind/blob/main/src/app/api/repos/analyze/route.ts) (Analysis request), [`extension/panel/src/App.tsx`](https://github.com/sahilsahu731/repomind/blob/main/extension/panel/src/App.tsx) (Extension panel), [`src/lib/services/processAnalysisJob.ts`](https://github.com/sahilsahu731/repomind/blob/main/src/lib/services/processAnalysisJob.ts) (Job processing), [`src/lib/supabaseDb.ts`](https://github.com/sahilsahu731/repomind/blob/main/src/lib/supabaseDb.ts) (Workspace database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Repository analysis"]
  node_analyze["Analysis request<br/>[route.ts]"]
  node_queue["Job queue<br/>[queue.ts]"]
  node_processor["Job processing"]
  node_analysis_services["Analysis services"]
  node_parser["Repository parser<br/>[parser.ts]"]
  node_ai["AI explanations<br/>[ai.ts]"]
  node_results[("Workspace database<br/>[supabaseDb.ts]")]
end

subgraph group_accounts["Accounts and GitHub"]
  node_auth["Web authentication<br/>[auth.ts]"]
  node_github_api["GitHub App access<br/>[app.ts]"]
  node_github_db[("GitHub data<br/>[db.ts]")]
  node_github_sync["Installation sync<br/>[sync.ts]"]
end

subgraph group_web["Web workspace"]
  node_report["Analysis report"]
  node_workspace["Repository workspace"]
end

subgraph group_extension["Browser extension"]
  node_extension_detector["Repository detector<br/>[detector.ts]"]
  node_extension_worker["Extension worker<br/>[worker.ts]"]
  node_extension_api["Extension API client<br/>[api.ts]"]
  node_extension_panel["Extension panel<br/>[App.tsx]"]
  node_extension_reports["Extension report views"]
  node_extension_compare["Repository comparison<br/>[CompareView.tsx]"]
  node_extension_chat["Analysis chat<br/>[ChatInterface.tsx]"]
end

node_user(("Repository user"))
node_github(("GitHub"))

node_user -->|"requests analysis"| node_analyze
node_analyze -->|"checks access"| node_github_api
node_analyze -->|"looks up repository"| node_github_db
node_analyze -->|"syncs installation"| node_github_sync
node_analyze -->|"enqueues job"| node_queue
node_queue -->|"dispatches job"| node_processor
node_processor -.->|"runs analysis"| node_analysis_services
node_analysis_services -.->|"uses parser"| node_parser
node_processor -.->|"requests explanations"| node_ai
node_processor -.->|"persists results"| node_results
node_workspace -->|"loads workspace data"| node_results
node_report -->|"reads analysis"| node_results
node_auth -->|"stores identity"| node_github_db
node_github_sync -->|"requests repositories"| node_github_api
node_github -->|"provides repository access"| node_github_api
node_extension_panel -->|"requests context"| node_extension_worker
node_extension_worker -->|"uses API client"| node_extension_api
node_extension_panel -->|"renders architecture"| node_extension_reports
node_extension_panel -->|"renders comparison"| node_extension_compare
node_extension_panel -->|"renders chat"| node_extension_chat

click node_analyze "https://github.com/sahilsahu731/repomind/blob/main/src/app/api/repos/analyze/route.ts"
click node_queue "https://github.com/sahilsahu731/repomind/blob/main/src/lib/queue.ts"
click node_processor "https://github.com/sahilsahu731/repomind/blob/main/src/lib/services/processAnalysisJob.ts"
click node_analysis_services "https://github.com/sahilsahu731/repomind/tree/main/src/lib/services"
click node_parser "https://github.com/sahilsahu731/repomind/blob/main/src/lib/services/parser.ts"
click node_ai "https://github.com/sahilsahu731/repomind/blob/main/src/lib/ai.ts"
click node_results "https://github.com/sahilsahu731/repomind/blob/main/src/lib/supabaseDb.ts"
click node_report "https://github.com/sahilsahu731/repomind/blob/main/src/components/report/RepositoryAnalysisReport.tsx"
click node_workspace "https://github.com/sahilsahu731/repomind/blob/main/src/components/workspace/RepositoryWorkspace.tsx"
click node_auth "https://github.com/sahilsahu731/repomind/blob/main/src/lib/auth.ts"
click node_github_api "https://github.com/sahilsahu731/repomind/blob/main/src/lib/github/app.ts"
click node_github_db "https://github.com/sahilsahu731/repomind/blob/main/src/lib/github/db.ts"
click node_github_sync "https://github.com/sahilsahu731/repomind/blob/main/src/lib/github/sync.ts"
click node_extension_detector "https://github.com/sahilsahu731/repomind/blob/main/extension/content/detector.ts"
click node_extension_worker "https://github.com/sahilsahu731/repomind/blob/main/extension/background/worker.ts"
click node_extension_api "https://github.com/sahilsahu731/repomind/blob/main/extension/background/api.ts"
click node_extension_panel "https://github.com/sahilsahu731/repomind/blob/main/extension/panel/src/App.tsx"
click node_extension_reports "https://github.com/sahilsahu731/repomind/blob/main/extension/panel/src/components/ArchitectureView.tsx"
click node_extension_compare "https://github.com/sahilsahu731/repomind/blob/main/extension/panel/src/components/CompareView.tsx"
click node_extension_chat "https://github.com/sahilsahu731/repomind/blob/main/extension/panel/src/components/ChatInterface.tsx"

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_analyze,node_queue,node_processor,node_analysis_services,node_parser,node_ai,node_results,node_user toneBlue
class node_auth,node_github_api,node_github_db,node_github_sync toneAmber
class node_report,node_workspace toneMint
class node_extension_detector,node_extension_worker,node_extension_api,node_extension_panel,node_extension_reports,node_extension_compare,node_extension_chat toneRose
class node_github toneIndigo
```

## Components

### Repository analysis

- [Analysis request](https://github.com/sahilsahu731/repomind/blob/main/src/app/api/repos/analyze/route.ts): `src/app/api/repos/analyze/route.ts`
- [Job queue](https://github.com/sahilsahu731/repomind/blob/main/src/lib/queue.ts): `src/lib/queue.ts`
- [Job processing](https://github.com/sahilsahu731/repomind/blob/main/src/lib/services/processAnalysisJob.ts): `src/lib/services/processAnalysisJob.ts`
- [Analysis services](https://github.com/sahilsahu731/repomind/tree/main/src/lib/services): `src/lib/services`
- [Repository parser](https://github.com/sahilsahu731/repomind/blob/main/src/lib/services/parser.ts): `src/lib/services/parser.ts`
- [AI explanations](https://github.com/sahilsahu731/repomind/blob/main/src/lib/ai.ts): `src/lib/ai.ts`
- [Workspace database](https://github.com/sahilsahu731/repomind/blob/main/src/lib/supabaseDb.ts): `src/lib/supabaseDb.ts`

### Accounts and GitHub

- [Web authentication](https://github.com/sahilsahu731/repomind/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- [GitHub App access](https://github.com/sahilsahu731/repomind/blob/main/src/lib/github/app.ts): `src/lib/github/app.ts`
- [GitHub data](https://github.com/sahilsahu731/repomind/blob/main/src/lib/github/db.ts): `src/lib/github/db.ts`
- [Installation sync](https://github.com/sahilsahu731/repomind/blob/main/src/lib/github/sync.ts): `src/lib/github/sync.ts`

### Web workspace

- [Analysis report](https://github.com/sahilsahu731/repomind/blob/main/src/components/report/RepositoryAnalysisReport.tsx): `src/components/report/RepositoryAnalysisReport.tsx`
- [Repository workspace](https://github.com/sahilsahu731/repomind/blob/main/src/components/workspace/RepositoryWorkspace.tsx): `src/components/workspace/RepositoryWorkspace.tsx`

### Browser extension

- [Repository detector](https://github.com/sahilsahu731/repomind/blob/main/extension/content/detector.ts): `extension/content/detector.ts`
- [Extension worker](https://github.com/sahilsahu731/repomind/blob/main/extension/background/worker.ts): `extension/background/worker.ts`
- [Extension API client](https://github.com/sahilsahu731/repomind/blob/main/extension/background/api.ts): `extension/background/api.ts`
- [Extension panel](https://github.com/sahilsahu731/repomind/blob/main/extension/panel/src/App.tsx): `extension/panel/src/App.tsx`
- [Extension report views](https://github.com/sahilsahu731/repomind/blob/main/extension/panel/src/components/ArchitectureView.tsx): `extension/panel/src/components/ArchitectureView.tsx`
- [Repository comparison](https://github.com/sahilsahu731/repomind/blob/main/extension/panel/src/components/CompareView.tsx): `extension/panel/src/components/CompareView.tsx`
- [Analysis chat](https://github.com/sahilsahu731/repomind/blob/main/extension/panel/src/components/ChatInterface.tsx): `extension/panel/src/components/ChatInterface.tsx`

### Other components

- **Repository user**
- **GitHub**

## Connections

- Repository user → Analysis request: requests analysis (evidence: `README.md`)
- Analysis request → GitHub App access: checks access (evidence: `src/app/api/repos/analyze/route.ts`)
- Analysis request → GitHub data: looks up repository (evidence: `src/app/api/repos/analyze/route.ts`)
- Analysis request → Installation sync: syncs installation (evidence: `src/app/api/repos/analyze/route.ts`)
- Analysis request → Job queue: enqueues job (evidence: `src/app/api/repos/analyze/route.ts`)
- Job queue → Job processing: dispatches job (evidence: `src/lib/queue.ts`)
- Job processing → Analysis services: runs analysis
- Analysis services → Repository parser: uses parser
- Job processing → AI explanations: requests explanations
- Job processing → Workspace database: persists results
- Repository workspace → Workspace database: loads workspace data (evidence: `src/components/workspace/RepositoryWorkspace.tsx`)
- Analysis report → Workspace database: reads analysis (evidence: `src/components/report/RepositoryAnalysisReport.tsx`)
- Web authentication → GitHub data: stores identity (evidence: `src/lib/auth.ts`)
- Installation sync → GitHub App access: requests repositories (evidence: `src/lib/github/sync.ts`)
- GitHub → GitHub App access: provides repository access (evidence: `src/lib/github/app.ts`)
- Extension panel → Extension worker: requests context (evidence: `extension/panel/src/App.tsx`)
- Extension worker → Extension API client: uses API client (evidence: `extension/background/worker.ts`)
- Extension panel → Extension report views: renders architecture (evidence: `extension/panel/src/App.tsx`)
- Extension panel → Repository comparison: renders comparison (evidence: `extension/panel/src/App.tsx`)
- Extension panel → Analysis chat: renders chat (evidence: `extension/panel/src/App.tsx`)
