# adityapatel5912/reposcope architecture

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

- Interactive diagram: https://gitdiagram.com/adityapatel5912/reposcope
- Repository: https://github.com/adityapatel5912/reposcope

## Overview

RepoScope loads a GitHub repository, builds an architecture graph, and presents it alongside file browsing, cited conversational Q&A, code tours, impact analysis, and change tracking. The main workflow runs from the React workspace through the API to repository loading and graph construction; chat builds graph and optional GitHub context before using the configured LLM providers. The README documents several additional capabilities whose exact internal wiring is not shown in the sampled source, so those connections are limited to documented ownership and supported paths.

Main entry points: [`frontend/src/App.tsx`](https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/App.tsx) (Workspace), [`backend/main.py`](https://github.com/adityapatel5912/reposcope/blob/main/backend/main.py) (FastAPI endpoints), [`backend/orchestrator.py`](https://github.com/adityapatel5912/reposcope/blob/main/backend/orchestrator.py) (Context orchestrator), [`frontend/src/api/client.ts`](https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/api/client.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace UI"]
  node_app["Workspace<br/>[App.tsx]"]
  node_repo_load_ui["Repository loader<br/>[useRepoLoader.ts]"]
  node_api_client["API client<br/>[client.ts]"]
  node_graph_ui["Architecture graph<br/>[GraphView.tsx]"]
  node_chat_ui["Chat panel<br/>[ChatPanel.tsx]"]
  node_file_tree["File tree<br/>[FileTree.tsx]"]
  node_tracking_ui["Tracking panel<br/>[TrackingPanel.tsx]"]
  node_tour_ui["Tour panel<br/>[TourPanel.tsx]"]
  node_impact_ui["Impact panel<br/>[ImpactPanel.tsx]"]
  node_features_api["Feature requests<br/>[features.ts]"]
end

subgraph group_api["API and orchestration"]
  node_api_server["FastAPI endpoints<br/>[main.py]"]
  node_orchestrator["Context orchestrator<br/>[orchestrator.py]"]
  node_byok[("Session token store<br/>[byok_manager.py]")]
end

subgraph group_analysis["Repository analysis"]
  node_repo_loader["Repository loader<br/>[repo_loader.py]"]
  node_graph_builder["Code graph builder<br/>[graph_builder.py]"]
  node_impact_analyzer["Impact analysis<br/>[impact_analyzer.py]"]
  node_tour_generator["Tour generation<br/>[tour_generator.py]"]
  node_repo_tracker[("Tracking state<br/>[repo_tracker.py]")]
end

subgraph group_integrations["External integrations"]
  node_mcp_client["GitHub and MCP client<br/>[mcp_client.py]"]
  node_runtime_config["LLM provider chain<br/>[runtime_config.py]"]
  node_key_rotator["Key rotation<br/>[key_rotator.py]"]
end

node_engineer(("Repository user"))
node_github["GitHub"]
node_codebase_mcp["Codebase MCP"]
node_llm["LLM providers"]

node_engineer -->|"uses"| node_app
node_app -->|"starts loading"| node_repo_load_ui
node_repo_load_ui -->|"requests load"| node_api_client
node_api_client -->|"HTTP requests"| node_api_server
node_api_server -->|"loads repository"| node_repo_loader
node_repo_loader -->|"fetches repository"| node_github
node_api_server -->|"builds chat context"| node_orchestrator
node_orchestrator -->|"reads state"| node_repo_tracker
node_orchestrator -->|"builds graph"| node_graph_builder
node_orchestrator -.->|"queries fallback graph"| node_mcp_client
node_mcp_client -.->|"queries graph"| node_codebase_mcp
node_orchestrator -.->|"fetches tracking"| node_mcp_client
node_mcp_client -->|"fetches activity"| node_github
node_orchestrator -->|"requests answer"| node_runtime_config
node_runtime_config -->|"gets provider key"| node_key_rotator
node_runtime_config -->|"sends prompt"| node_llm
node_api_server -->|"stores token"| node_byok
node_api_server -->|"analyzes impact"| node_impact_analyzer
node_api_server -->|"generates tour"| node_tour_generator
node_api_server -->|"updates tracking"| node_repo_tracker
node_graph_ui -->|"loads graph"| node_api_client
node_chat_ui -->|"streams chat"| node_api_client
node_tracking_ui -->|"requests tracking"| node_api_client
node_impact_ui -->|"requests analysis"| node_features_api
node_tour_ui -->|"requests tour"| node_features_api
node_graph_ui -->|"requests prompt"| node_features_api
node_app -->|"renders graph"| node_graph_ui
node_app -->|"renders chat"| node_chat_ui
node_app -->|"renders files"| node_file_tree
node_app -->|"renders tracking"| node_tracking_ui
node_app -->|"renders tours"| node_tour_ui
node_app -->|"renders impact"| node_impact_ui

click node_app "https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/App.tsx"
click node_repo_load_ui "https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/hooks/useRepoLoader.ts"
click node_api_client "https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/api/client.ts"
click node_graph_ui "https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/components/GraphView.tsx"
click node_chat_ui "https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/components/ChatPanel.tsx"
click node_file_tree "https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/components/FileTree.tsx"
click node_tracking_ui "https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/components/TrackingPanel.tsx"
click node_tour_ui "https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/components/TourPanel.tsx"
click node_impact_ui "https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/components/ImpactPanel.tsx"
click node_features_api "https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/api/features.ts"
click node_api_server "https://github.com/adityapatel5912/reposcope/blob/main/backend/main.py"
click node_orchestrator "https://github.com/adityapatel5912/reposcope/blob/main/backend/orchestrator.py"
click node_repo_loader "https://github.com/adityapatel5912/reposcope/blob/main/backend/repo_loader.py"
click node_graph_builder "https://github.com/adityapatel5912/reposcope/blob/main/backend/graph_builder.py"
click node_impact_analyzer "https://github.com/adityapatel5912/reposcope/blob/main/backend/impact_analyzer.py"
click node_tour_generator "https://github.com/adityapatel5912/reposcope/blob/main/backend/tour_generator.py"
click node_repo_tracker "https://github.com/adityapatel5912/reposcope/blob/main/backend/repo_tracker.py"
click node_mcp_client "https://github.com/adityapatel5912/reposcope/blob/main/backend/mcp_client.py"
click node_runtime_config "https://github.com/adityapatel5912/reposcope/blob/main/backend/runtime_config.py"
click node_key_rotator "https://github.com/adityapatel5912/reposcope/blob/main/backend/key_rotator.py"
click node_byok "https://github.com/adityapatel5912/reposcope/blob/main/backend/byok_manager.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_app,node_repo_load_ui,node_api_client,node_graph_ui,node_chat_ui,node_file_tree,node_tracking_ui,node_tour_ui,node_impact_ui,node_features_api,node_engineer toneBlue
class node_api_server,node_orchestrator,node_byok toneAmber
class node_repo_loader,node_graph_builder,node_impact_analyzer,node_tour_generator,node_repo_tracker toneMint
class node_mcp_client,node_runtime_config,node_key_rotator toneRose
class node_github,node_codebase_mcp,node_llm toneIndigo
```

## Components

### Workspace UI

- [Workspace](https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Repository loader](https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/hooks/useRepoLoader.ts): `frontend/src/hooks/useRepoLoader.ts`
- [API client](https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Architecture graph](https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/components/GraphView.tsx): `frontend/src/components/GraphView.tsx`
- [Chat panel](https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/components/ChatPanel.tsx): `frontend/src/components/ChatPanel.tsx`
- [File tree](https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/components/FileTree.tsx): `frontend/src/components/FileTree.tsx`
- [Tracking panel](https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/components/TrackingPanel.tsx): `frontend/src/components/TrackingPanel.tsx`
- [Tour panel](https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/components/TourPanel.tsx): `frontend/src/components/TourPanel.tsx`
- [Impact panel](https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/components/ImpactPanel.tsx): `frontend/src/components/ImpactPanel.tsx`
- [Feature requests](https://github.com/adityapatel5912/reposcope/blob/main/frontend/src/api/features.ts): `frontend/src/api/features.ts`

### API and orchestration

- [FastAPI endpoints](https://github.com/adityapatel5912/reposcope/blob/main/backend/main.py): `backend/main.py`
- [Context orchestrator](https://github.com/adityapatel5912/reposcope/blob/main/backend/orchestrator.py): `backend/orchestrator.py`
- [Session token store](https://github.com/adityapatel5912/reposcope/blob/main/backend/byok_manager.py): `backend/byok_manager.py`

### Repository analysis

- [Repository loader](https://github.com/adityapatel5912/reposcope/blob/main/backend/repo_loader.py): `backend/repo_loader.py`
- [Code graph builder](https://github.com/adityapatel5912/reposcope/blob/main/backend/graph_builder.py): `backend/graph_builder.py`
- [Impact analysis](https://github.com/adityapatel5912/reposcope/blob/main/backend/impact_analyzer.py): `backend/impact_analyzer.py`
- [Tour generation](https://github.com/adityapatel5912/reposcope/blob/main/backend/tour_generator.py): `backend/tour_generator.py`
- [Tracking state](https://github.com/adityapatel5912/reposcope/blob/main/backend/repo_tracker.py): `backend/repo_tracker.py`

### External integrations

- [GitHub and MCP client](https://github.com/adityapatel5912/reposcope/blob/main/backend/mcp_client.py): `backend/mcp_client.py`
- [LLM provider chain](https://github.com/adityapatel5912/reposcope/blob/main/backend/runtime_config.py): `backend/runtime_config.py`
- [Key rotation](https://github.com/adityapatel5912/reposcope/blob/main/backend/key_rotator.py): `backend/key_rotator.py`

### Other components

- **Repository user**
- **GitHub**
- **Codebase MCP**
- **LLM providers**

## Connections

- Repository user → Workspace: uses
- Workspace → Repository loader: starts loading
- Repository loader → API client: requests load
- API client → FastAPI endpoints: HTTP requests
- FastAPI endpoints → Repository loader: loads repository
- Repository loader → GitHub: fetches repository
- FastAPI endpoints → Context orchestrator: builds chat context
- Context orchestrator → Tracking state: reads state
- Context orchestrator → Code graph builder: builds graph
- Context orchestrator → GitHub and MCP client: queries fallback graph
- GitHub and MCP client → Codebase MCP: queries graph
- Context orchestrator → GitHub and MCP client: fetches tracking
- GitHub and MCP client → GitHub: fetches activity
- Context orchestrator → LLM provider chain: requests answer
- LLM provider chain → Key rotation: gets provider key
- LLM provider chain → LLM providers: sends prompt
- FastAPI endpoints → Session token store: stores token
- FastAPI endpoints → Impact analysis: analyzes impact
- FastAPI endpoints → Tour generation: generates tour
- FastAPI endpoints → Tracking state: updates tracking
- Architecture graph → API client: loads graph
- Chat panel → API client: streams chat
- Tracking panel → API client: requests tracking
- Impact panel → Feature requests: requests analysis
- Tour panel → Feature requests: requests tour
- Architecture graph → Feature requests: requests prompt
- Workspace → Architecture graph: renders graph
- Workspace → Chat panel: renders chat
- Workspace → File tree: renders files
- Workspace → Tracking panel: renders tracking
- Workspace → Tour panel: renders tours
- Workspace → Impact panel: renders impact
