# stormbreaker06/reviewing- architecture

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

- Interactive diagram: https://gitdiagram.com/stormbreaker06/reviewing-
- Repository: https://github.com/stormbreaker06/reviewing-

## Overview

This is a FastAPI service for inspecting GitHub pull requests and producing AI code reviews. A caller can fetch pull-request metadata or a parsed diff; the review workflow fetches the PR head, retrieves its diff, parses changed files, loads each file’s content, and reviews files concurrently through an LLM. Review text is parsed into issue results. The graph reflects the sampled implementation; no README was provided, and the Pydantic result models are defined but their use in runtime responses is not shown.

Main entry points: [`app/main.py`](https://github.com/stormbreaker06/reviewing-/blob/main/app/main.py) (FastAPI routes), [`app/github/client.py`](https://github.com/stormbreaker06/reviewing-/blob/main/app/github/client.py) (GitHub client), [`app/llm.py`](https://github.com/stormbreaker06/reviewing-/blob/main/app/llm.py) (LLM reviewer), [`app/github/diff_parser.py`](https://github.com/stormbreaker06/reviewing-/blob/main/app/github/diff_parser.py) (Diff parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_fastapi["FastAPI routes<br/>[main.py]"]
  node_review_flow["Review orchestration<br/>[main.py]"]
end

subgraph group_github["GitHub access"]
  node_github_api["GitHub REST API"]
  node_github_client["GitHub client<br/>[client.py]"]
end

subgraph group_review["Review workflow"]
  node_diff_parser["Diff parser<br/>[diff_parser.py]"]
  node_review_parser["Review parser<br/>[diff_parser.py]"]
  node_review_models["Review models<br/>[model.py]"]
end

subgraph group_llm["AI review"]
  node_llm_review["LLM reviewer<br/>[llm.py]"]
  node_llm_service["LLM service"]
end

node_caller(("API caller"))

node_caller -->|"requests"| node_fastapi
node_fastapi -->|"fetches PR"| node_github_client
node_fastapi -->|"fetches diff"| node_github_client
node_github_client -->|"calls"| node_github_api
node_fastapi -->|"parses diff"| node_diff_parser
node_fastapi -->|"dispatches review"| node_review_flow
node_review_flow -->|"fetches PR"| node_github_client
node_review_flow -->|"fetches diff"| node_github_client
node_review_flow -->|"parses diff"| node_diff_parser
node_review_flow -->|"loads file"| node_github_client
node_review_flow -->|"reviews files"| node_llm_review
node_llm_review -->|"requests review"| node_llm_service
node_llm_review -->|"parses response"| node_review_parser
node_fastapi -->|"returns response"| node_caller

click node_fastapi "https://github.com/stormbreaker06/reviewing-/blob/main/app/main.py"
click node_review_flow "https://github.com/stormbreaker06/reviewing-/blob/main/app/main.py"
click node_github_client "https://github.com/stormbreaker06/reviewing-/blob/main/app/github/client.py"
click node_diff_parser "https://github.com/stormbreaker06/reviewing-/blob/main/app/github/diff_parser.py"
click node_review_parser "https://github.com/stormbreaker06/reviewing-/blob/main/app/github/diff_parser.py"
click node_llm_review "https://github.com/stormbreaker06/reviewing-/blob/main/app/llm.py"
click node_review_models "https://github.com/stormbreaker06/reviewing-/blob/main/app/model.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_fastapi,node_review_flow toneBlue
class node_github_api,node_github_client toneAmber
class node_diff_parser,node_review_parser,node_review_models,node_caller toneMint
class node_llm_review,node_llm_service toneRose
```

## Components

### HTTP API

- [FastAPI routes](https://github.com/stormbreaker06/reviewing-/blob/main/app/main.py): `app/main.py`
- [Review orchestration](https://github.com/stormbreaker06/reviewing-/blob/main/app/main.py): `app/main.py`

### GitHub access

- **GitHub REST API**
- [GitHub client](https://github.com/stormbreaker06/reviewing-/blob/main/app/github/client.py): `app/github/client.py`

### Review workflow

- [Diff parser](https://github.com/stormbreaker06/reviewing-/blob/main/app/github/diff_parser.py): `app/github/diff_parser.py`
- [Review parser](https://github.com/stormbreaker06/reviewing-/blob/main/app/github/diff_parser.py): `app/github/diff_parser.py`
- [Review models](https://github.com/stormbreaker06/reviewing-/blob/main/app/model.py): `app/model.py`

### AI review

- [LLM reviewer](https://github.com/stormbreaker06/reviewing-/blob/main/app/llm.py): `app/llm.py`
- **LLM service**

### Other components

- **API caller**

## Connections

- API caller → FastAPI routes: requests (evidence: `app/main.py`)
- FastAPI routes → GitHub client: fetches PR (evidence: `app/main.py`)
- FastAPI routes → GitHub client: fetches diff (evidence: `app/main.py`)
- GitHub client → GitHub REST API: calls (evidence: `app/github/client.py`)
- FastAPI routes → Diff parser: parses diff (evidence: `app/main.py`)
- FastAPI routes → Review orchestration: dispatches review (evidence: `app/main.py`)
- Review orchestration → GitHub client: fetches PR (evidence: `app/main.py`)
- Review orchestration → GitHub client: fetches diff (evidence: `app/main.py`)
- Review orchestration → Diff parser: parses diff (evidence: `app/main.py`)
- Review orchestration → GitHub client: loads file (evidence: `app/main.py`)
- Review orchestration → LLM reviewer: reviews files (evidence: `app/main.py`)
- LLM reviewer → LLM service: requests review (evidence: `app/llm.py`)
- LLM reviewer → Review parser: parses response (evidence: `app/llm.py`)
- FastAPI routes → API caller: returns response (evidence: `app/main.py`)
