# winnermarvi/codeinsights_github architecture

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

- Interactive diagram: https://gitdiagram.com/winnermarvi/codeinsights_github
- Repository: https://github.com/winnermarvi/codeinsights_github

## Overview

CodeInsight AI analyzes a GitHub repository, builds searchable code and dependency knowledge, and serves repository Q&A and analysis through a web interface. The principal workflow runs from repository submission through ingestion, Python parsing, semantic chunking, embedding, and storage; chat then rewrites a question, retrieves matching chunks, and generates a sourced answer. Separate graph, architecture, and impact paths expose structural views and dependency-based change reports. The graph reflects the sampled pipeline calls and documented product capabilities; wiring inside unsampled routes and UI components is represented only at the documented feature level.

Main entry points: [`frontend/src/api.js`](https://github.com/winnermarvi/codeinsights_github/blob/main/frontend/src/api.js) (HTTP client), [`app/ingestion/ingestion_pipeline.py`](https://github.com/winnermarvi/codeinsights_github/blob/main/app/ingestion/ingestion_pipeline.py) (Repository ingestion), [`app/rag/rag_pipeline.py`](https://github.com/winnermarvi/codeinsights_github/blob/main/app/rag/rag_pipeline.py) (RAG response), [`app/repository/repository_graph_pipeline.py`](https://github.com/winnermarvi/codeinsights_github/blob/main/app/repository/repository_graph_pipeline.py) (Repository graph)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_analyze_ui["Analyze page<br/>[Analyze.jsx]"]
  node_chat_ui["Chat page<br/>[Chat.jsx]"]
  node_architecture_ui["Architecture page<br/>[Architecture.jsx]"]
  node_impact_ui["Impact page<br/>[Impact.jsx]"]
  node_api_client["HTTP client<br/>[api.js]"]
end

subgraph group_backend["API and orchestration"]
  node_analyze_route["Analyze endpoint<br/>[analyze.py]"]
  node_chat_route["Chat endpoint<br/>[chat.py]"]
  node_architecture_route["Architecture endpoint<br/>[architecture.py]"]
  node_impact_route["Impact endpoint<br/>[impact.py]"]
end

subgraph group_repository["Repository analysis"]
  node_ingestion["Repository ingestion"]
  node_extract["AST extraction"]
  node_chunk["Semantic chunking<br/>[chunk_pipeline.py]"]
  node_embedding["Code embeddings"]
end

subgraph group_qa["Search and Q&amp;A"]
  node_chat["Chat workflow<br/>[chat_pipeline.py]"]
  node_rag["RAG response<br/>[rag_pipeline.py]"]
  node_search["Similarity search<br/>[search_pipeline.py]"]
end

subgraph group_graph["Structure and impact"]
  node_repo_graph["Repository graph"]
  node_architecture["Architecture views"]
  node_impact["Impact analysis"]
end

subgraph group_storage["Persistence"]
  node_database[("SQLite store<br/>[store.py]")]
end

node_developer(("Developer"))
node_llm(("Language model"))

node_developer -->|"submits repository"| node_analyze_ui
node_developer -->|"asks questions"| node_chat_ui
node_developer -->|"views structure"| node_architecture_ui
node_developer -->|"checks changes"| node_impact_ui
node_analyze_ui -->|"sends request"| node_api_client
node_chat_ui -->|"sends request"| node_api_client
node_architecture_ui -->|"requests view"| node_api_client
node_impact_ui -->|"requests report"| node_api_client
node_api_client -->|"HTTP request"| node_analyze_route
node_api_client -->|"HTTP request"| node_chat_route
node_api_client -->|"HTTP request"| node_architecture_route
node_api_client -->|"HTTP request"| node_impact_route
node_analyze_route -->|"starts analysis"| node_ingestion
node_ingestion -->|"provides inventory"| node_extract
node_ingestion -->|"provides inventory"| node_chunk
node_extract -->|"provides structures"| node_repo_graph
node_chunk -->|"provides chunks"| node_embedding
node_embedding -->|"stores vectors"| node_database
node_chat_route -->|"dispatches question"| node_chat
node_chat -->|"requests answer"| node_rag
node_rag -->|"retrieves chunks"| node_search
node_search -->|"loads vectors and chunks"| node_database
node_rag -.->|"generates answer"| node_llm
node_architecture_route -->|"requests diagrams"| node_architecture
node_architecture -->|"reads dependencies"| node_repo_graph
node_impact_route -->|"requests report"| node_impact
node_impact -->|"reads dependencies"| node_repo_graph

click node_analyze_ui "https://github.com/winnermarvi/codeinsights_github/blob/main/frontend/src/pages/Analyze.jsx"
click node_chat_ui "https://github.com/winnermarvi/codeinsights_github/blob/main/frontend/src/pages/Chat.jsx"
click node_architecture_ui "https://github.com/winnermarvi/codeinsights_github/blob/main/frontend/src/pages/Architecture.jsx"
click node_impact_ui "https://github.com/winnermarvi/codeinsights_github/blob/main/frontend/src/pages/Impact.jsx"
click node_api_client "https://github.com/winnermarvi/codeinsights_github/blob/main/frontend/src/api.js"
click node_analyze_route "https://github.com/winnermarvi/codeinsights_github/blob/main/backend/routes/analyze.py"
click node_chat_route "https://github.com/winnermarvi/codeinsights_github/blob/main/backend/routes/chat.py"
click node_architecture_route "https://github.com/winnermarvi/codeinsights_github/blob/main/backend/routes/architecture.py"
click node_impact_route "https://github.com/winnermarvi/codeinsights_github/blob/main/backend/routes/impact.py"
click node_ingestion "https://github.com/winnermarvi/codeinsights_github/blob/main/app/ingestion/ingestion_pipeline.py"
click node_extract "https://github.com/winnermarvi/codeinsights_github/blob/main/app/repository/repository_pipeline.py"
click node_chunk "https://github.com/winnermarvi/codeinsights_github/blob/main/app/chunking/chunk_pipeline.py"
click node_embedding "https://github.com/winnermarvi/codeinsights_github/blob/main/app/embedding/embedding_pipeline.py"
click node_chat "https://github.com/winnermarvi/codeinsights_github/blob/main/app/chat/chat_pipeline.py"
click node_rag "https://github.com/winnermarvi/codeinsights_github/blob/main/app/rag/rag_pipeline.py"
click node_search "https://github.com/winnermarvi/codeinsights_github/blob/main/app/search/search_pipeline.py"
click node_repo_graph "https://github.com/winnermarvi/codeinsights_github/blob/main/app/repository/repository_graph_pipeline.py"
click node_architecture "https://github.com/winnermarvi/codeinsights_github/blob/main/app/architecture/architecture_pipeline.py"
click node_impact "https://github.com/winnermarvi/codeinsights_github/blob/main/app/impact/impact_analysis_pipeline.py"
click node_database "https://github.com/winnermarvi/codeinsights_github/blob/main/app/database/store.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_analyze_ui,node_chat_ui,node_architecture_ui,node_impact_ui,node_api_client toneBlue
class node_analyze_route,node_chat_route,node_architecture_route,node_impact_route toneAmber
class node_ingestion,node_extract,node_chunk,node_embedding toneMint
class node_chat,node_rag,node_search toneRose
class node_repo_graph,node_architecture,node_impact,node_developer,node_llm toneIndigo
class node_database toneTeal
```

## Components

### Web interface

- [Analyze page](https://github.com/winnermarvi/codeinsights_github/blob/main/frontend/src/pages/Analyze.jsx): `frontend/src/pages/Analyze.jsx`
- [Chat page](https://github.com/winnermarvi/codeinsights_github/blob/main/frontend/src/pages/Chat.jsx): `frontend/src/pages/Chat.jsx`
- [Architecture page](https://github.com/winnermarvi/codeinsights_github/blob/main/frontend/src/pages/Architecture.jsx): `frontend/src/pages/Architecture.jsx`
- [Impact page](https://github.com/winnermarvi/codeinsights_github/blob/main/frontend/src/pages/Impact.jsx): `frontend/src/pages/Impact.jsx`
- [HTTP client](https://github.com/winnermarvi/codeinsights_github/blob/main/frontend/src/api.js): `frontend/src/api.js`

### API and orchestration

- [Analyze endpoint](https://github.com/winnermarvi/codeinsights_github/blob/main/backend/routes/analyze.py): `backend/routes/analyze.py`
- [Chat endpoint](https://github.com/winnermarvi/codeinsights_github/blob/main/backend/routes/chat.py): `backend/routes/chat.py`
- [Architecture endpoint](https://github.com/winnermarvi/codeinsights_github/blob/main/backend/routes/architecture.py): `backend/routes/architecture.py`
- [Impact endpoint](https://github.com/winnermarvi/codeinsights_github/blob/main/backend/routes/impact.py): `backend/routes/impact.py`

### Repository analysis

- [Repository ingestion](https://github.com/winnermarvi/codeinsights_github/blob/main/app/ingestion/ingestion_pipeline.py): `app/ingestion/ingestion_pipeline.py`
- [AST extraction](https://github.com/winnermarvi/codeinsights_github/blob/main/app/repository/repository_pipeline.py): `app/repository/repository_pipeline.py`
- [Semantic chunking](https://github.com/winnermarvi/codeinsights_github/blob/main/app/chunking/chunk_pipeline.py): `app/chunking/chunk_pipeline.py`
- [Code embeddings](https://github.com/winnermarvi/codeinsights_github/blob/main/app/embedding/embedding_pipeline.py): `app/embedding/embedding_pipeline.py`

### Search and Q&A

- [Chat workflow](https://github.com/winnermarvi/codeinsights_github/blob/main/app/chat/chat_pipeline.py): `app/chat/chat_pipeline.py`
- [RAG response](https://github.com/winnermarvi/codeinsights_github/blob/main/app/rag/rag_pipeline.py): `app/rag/rag_pipeline.py`
- [Similarity search](https://github.com/winnermarvi/codeinsights_github/blob/main/app/search/search_pipeline.py): `app/search/search_pipeline.py`

### Structure and impact

- [Repository graph](https://github.com/winnermarvi/codeinsights_github/blob/main/app/repository/repository_graph_pipeline.py): `app/repository/repository_graph_pipeline.py`
- [Architecture views](https://github.com/winnermarvi/codeinsights_github/blob/main/app/architecture/architecture_pipeline.py): `app/architecture/architecture_pipeline.py`
- [Impact analysis](https://github.com/winnermarvi/codeinsights_github/blob/main/app/impact/impact_analysis_pipeline.py): `app/impact/impact_analysis_pipeline.py`

### Persistence

- [SQLite store](https://github.com/winnermarvi/codeinsights_github/blob/main/app/database/store.py): `app/database/store.py`

### Other components

- **Developer**
- **Language model**

## Connections

- Developer → Analyze page: submits repository
- Developer → Chat page: asks questions
- Developer → Architecture page: views structure
- Developer → Impact page: checks changes
- Analyze page → HTTP client: sends request
- Chat page → HTTP client: sends request
- Architecture page → HTTP client: requests view
- Impact page → HTTP client: requests report
- HTTP client → Analyze endpoint: HTTP request
- HTTP client → Chat endpoint: HTTP request
- HTTP client → Architecture endpoint: HTTP request
- HTTP client → Impact endpoint: HTTP request
- Analyze endpoint → Repository ingestion: starts analysis
- Repository ingestion → AST extraction: provides inventory
- Repository ingestion → Semantic chunking: provides inventory
- AST extraction → Repository graph: provides structures
- Semantic chunking → Code embeddings: provides chunks
- Code embeddings → SQLite store: stores vectors
- Chat endpoint → Chat workflow: dispatches question
- Chat workflow → RAG response: requests answer
- RAG response → Similarity search: retrieves chunks
- Similarity search → SQLite store: loads vectors and chunks
- RAG response → Language model: generates answer
- Architecture endpoint → Architecture views: requests diagrams
- Architecture views → Repository graph: reads dependencies
- Impact endpoint → Impact analysis: requests report
- Impact analysis → Repository graph: reads dependencies
