# madhulasyareddy847/github-repository-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/madhulasyareddy847/github-repository-analyzer
- Repository: https://github.com/madhulasyareddy847/github-repository-analyzer

## Overview

This repository provides a GitHub repository analyzer: users submit a repository URL, receive repository statistics and AI-generated insights, can ask questions, and can request a PDF report. The sampled files show a Streamlit client, FastAPI routes, a coordinating service, Git-based repository inspection, prompt construction, Gemini requests, and PDF generation. The tree contains a second nested copy of the application; its service and related modules are represented separately where the source index identifies them. README content was not supplied, so capability coverage is based on the sampled routes and UI.

Main entry points: [`backend/services/repository_service.py`](https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/backend/services/repository_service.py) (Analysis service), [`github-repository-analyzer-main/backend/services/repository_service.py`](https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/github-repository-analyzer-main/backend/services/repository_service.py) (Nested analysis service), [`frontend/streamlit_app.py`](https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/frontend/streamlit_app.py) (Streamlit interface), [`backend/app.py`](https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/backend/app.py) (FastAPI endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_ui["Streamlit interface<br/>[streamlit_app.py]"]
  node_api["FastAPI endpoints<br/>[app.py]"]
  node_nested_api["Nested API endpoints<br/>[app.py]"]
end

subgraph group_orchestration["Application orchestration"]
  node_service["Analysis service"]
  node_nested_service["Nested analysis service"]
end

subgraph group_inspection["Repository inspection"]
  node_parser["Repository parser<br/>[parser.py]"]
  node_nested_parser["Nested repository parser<br/>[parser.py]"]
end

subgraph group_generation["AI and reports"]
  node_prompts["Prompt builder<br/>[prompt_builder.py]"]
  node_gemini["Gemini client<br/>[gemini_client.py]"]
  node_pdf["PDF generator<br/>[pdf_generator.py]"]
  node_nested_prompts["Nested prompt builder<br/>[prompt_builder.py]"]
  node_nested_gemini["Nested Gemini client<br/>[gemini_client.py]"]
  node_nested_pdf["Nested PDF generator<br/>[pdf_generator.py]"]
end

node_user(("Repository analyst"))
node_github(("GitHub repository"))

node_user -->|"submits requests"| node_ui
node_ui -->|"calls endpoints"| node_api
node_api -->|"dispatches analysis"| node_service
node_service -->|"inspects repository"| node_parser
node_parser -->|"clones repository"| node_github
node_service -->|"builds prompts"| node_prompts
node_service -->|"requests AI output"| node_gemini
node_service -->|"generates report"| node_pdf
node_nested_api -->|"dispatches requests"| node_nested_service
node_nested_service -->|"inspects repository"| node_nested_parser
node_nested_parser -.->|"clones repository"| node_github
node_nested_service -->|"builds prompts"| node_nested_prompts
node_nested_service -->|"requests AI output"| node_nested_gemini
node_nested_service -.->|"generates report"| node_nested_pdf

click node_ui "https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/frontend/streamlit_app.py"
click node_api "https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/backend/app.py"
click node_service "https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/backend/services/repository_service.py"
click node_parser "https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/backend/repository/parser.py"
click node_prompts "https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/backend/ai/prompt_builder.py"
click node_gemini "https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/backend/ai/gemini_client.py"
click node_pdf "https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/backend/report/pdf_generator.py"
click node_nested_service "https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/github-repository-analyzer-main/backend/services/repository_service.py"
click node_nested_parser "https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/github-repository-analyzer-main/backend/repository/parser.py"
click node_nested_prompts "https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/github-repository-analyzer-main/backend/ai/prompt_builder.py"
click node_nested_gemini "https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/github-repository-analyzer-main/backend/ai/gemini_client.py"
click node_nested_pdf "https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/github-repository-analyzer-main/backend/report/pdf_generator.py"
click node_nested_api "https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/github-repository-analyzer-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_ui,node_api,node_nested_api toneBlue
class node_service,node_nested_service toneAmber
class node_parser,node_nested_parser toneMint
class node_prompts,node_gemini,node_pdf,node_nested_prompts,node_nested_gemini,node_nested_pdf toneRose
class node_user,node_github toneIndigo
```

## Components

### User experience

- [Streamlit interface](https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/frontend/streamlit_app.py): `frontend/streamlit_app.py`
- [FastAPI endpoints](https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/backend/app.py): `backend/app.py`
- [Nested API endpoints](https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/github-repository-analyzer-main/backend/app.py): `github-repository-analyzer-main/backend/app.py`

### Application orchestration

- [Analysis service](https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/backend/services/repository_service.py): `backend/services/repository_service.py`
- [Nested analysis service](https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/github-repository-analyzer-main/backend/services/repository_service.py): `github-repository-analyzer-main/backend/services/repository_service.py`

### Repository inspection

- [Repository parser](https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/backend/repository/parser.py): `backend/repository/parser.py`
- [Nested repository parser](https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/github-repository-analyzer-main/backend/repository/parser.py): `github-repository-analyzer-main/backend/repository/parser.py`

### AI and reports

- [Prompt builder](https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/backend/ai/prompt_builder.py): `backend/ai/prompt_builder.py`
- [Gemini client](https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/backend/ai/gemini_client.py): `backend/ai/gemini_client.py`
- [PDF generator](https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/backend/report/pdf_generator.py): `backend/report/pdf_generator.py`
- [Nested prompt builder](https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/github-repository-analyzer-main/backend/ai/prompt_builder.py): `github-repository-analyzer-main/backend/ai/prompt_builder.py`
- [Nested Gemini client](https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/github-repository-analyzer-main/backend/ai/gemini_client.py): `github-repository-analyzer-main/backend/ai/gemini_client.py`
- [Nested PDF generator](https://github.com/madhulasyareddy847/github-repository-analyzer/blob/main/github-repository-analyzer-main/backend/report/pdf_generator.py): `github-repository-analyzer-main/backend/report/pdf_generator.py`

### Other components

- **Repository analyst**
- **GitHub repository**

## Connections

- Repository analyst → Streamlit interface: submits requests (evidence: `frontend/streamlit_app.py`)
- Streamlit interface → FastAPI endpoints: calls endpoints (evidence: `frontend/streamlit_app.py`)
- FastAPI endpoints → Analysis service: dispatches analysis (evidence: `backend/app.py`)
- Analysis service → Repository parser: inspects repository (evidence: `backend/services/repository_service.py`)
- Repository parser → GitHub repository: clones repository (evidence: `backend/repository/parser.py`)
- Analysis service → Prompt builder: builds prompts (evidence: `backend/services/repository_service.py`)
- Analysis service → Gemini client: requests AI output (evidence: `backend/services/repository_service.py`)
- Analysis service → PDF generator: generates report (evidence: `backend/services/repository_service.py`)
- Nested API endpoints → Nested analysis service: dispatches requests (evidence: `github-repository-analyzer-main/backend/app.py`)
- Nested analysis service → Nested repository parser: inspects repository (evidence: `github-repository-analyzer-main/backend/services/repository_service.py`)
- Nested repository parser → GitHub repository: clones repository
- Nested analysis service → Nested prompt builder: builds prompts (evidence: `github-repository-analyzer-main/backend/services/repository_service.py`)
- Nested analysis service → Nested Gemini client: requests AI output (evidence: `github-repository-analyzer-main/backend/services/repository_service.py`)
- Nested analysis service → Nested PDF generator: generates report
