# aayushasnani/github-ai-assistant architecture

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

- Interactive diagram: https://gitdiagram.com/aayushasnani/github-ai-assistant
- Repository: https://github.com/aayushasnani/github-ai-assistant

## Overview

The README describes a GitHub repository intelligence platform, but the sampled implementation is an early scaffold: the frontend is still the React/Vite starter screen, and the backend exposes a database-checking health route with user and repository models. Documented analysis capabilities are retained as product areas, not asserted as implemented or connected; their implementation was not shown. Solid edges reflect sampled calls and setup, while dashed edges mark documented-but-unverified integrations or workflow links.

Main entry points: [`backend/app`](https://github.com/aayushasnani/github-ai-assistant/tree/main/backend/app) (Code-aware RAG), [`backend/app/main.py`](https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/main.py) (FastAPI app), [`backend/app/db/session.py`](https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/db/session.py) (DB sessions), [`backend/app/api/v1/health.py`](https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/api/v1/health.py) (Health route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client"]
  node_frontend_entry["React entry<br/>[main.tsx]"]
  node_frontend_app["Starter screen<br/>[App.tsx]"]
end

subgraph group_backend["Backend foundation"]
  node_api_app["FastAPI app<br/>[main.py]"]
  node_health["Health route<br/>[health.py]"]
  node_settings["Settings<br/>[config.py]"]
  node_db_session["DB sessions<br/>[session.py]"]
  node_auth_deps["Auth dependencies<br/>[deps.py]"]
  node_security["JWT security<br/>[security.py]"]
  node_user_model["User model<br/>[user.py]"]
  node_repo_model["Repository model<br/>[repository.py]"]
  node_model_base["ORM base<br/>[base.py]"]
  node_health_schema["Health schema<br/>[health.py]"]
end

subgraph group_intelligence["Repository intelligence"]
  node_repo_upload["Repository upload"]
  node_github_integration["GitHub integration"]
  node_parsing["Tree-sitter parsing"]
  node_code_rag["Code-aware RAG"]
  node_documentation["Documentation generation"]
  node_bug_detection["Bug detection"]
  node_refactoring["Refactoring suggestions"]
  node_test_generation["Unit test generation"]
  node_architecture["Architecture visualization"]
end

node_user(("User"))
node_database[("Database")]
node_github["GitHub"]
node_ai_services["AI services"]

node_user -->|"opens"| node_frontend_entry
node_frontend_entry -->|"renders"| node_frontend_app
node_api_app -->|"registers"| node_health
node_api_app -->|"loads"| node_settings
node_api_app -->|"initializes"| node_db_session
node_api_app -->|"creates tables"| node_model_base
node_api_app -->|"loads model"| node_user_model
node_api_app -->|"loads model"| node_repo_model
node_health -->|"gets session"| node_db_session
node_health -->|"reads version"| node_settings
node_health -->|"returns schema"| node_health_schema
node_db_session -->|"reads config"| node_settings
node_db_session -->|"connects"| node_database
node_auth_deps -->|"gets session"| node_db_session
node_auth_deps -->|"decodes token"| node_security
node_auth_deps -->|"queries user"| node_user_model
node_security -->|"reads key"| node_settings
node_user_model -->|"inherits"| node_model_base
node_repo_model -->|"inherits"| node_model_base
node_repo_upload -.->|"supports"| node_parsing
node_github_integration -.->|"integrates"| node_github
node_parsing -.->|"feeds"| node_code_rag
node_code_rag -.->|"uses"| node_ai_services
node_code_rag -.->|"supports"| node_documentation
node_code_rag -.->|"supports"| node_bug_detection
node_code_rag -.->|"supports"| node_refactoring
node_code_rag -.->|"supports"| node_test_generation
node_code_rag -.->|"supports"| node_architecture

click node_frontend_entry "https://github.com/aayushasnani/github-ai-assistant/blob/main/frontend/src/main.tsx"
click node_frontend_app "https://github.com/aayushasnani/github-ai-assistant/blob/main/frontend/src/App.tsx"
click node_api_app "https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/main.py"
click node_health "https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/api/v1/health.py"
click node_settings "https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/core/config.py"
click node_db_session "https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/db/session.py"
click node_auth_deps "https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/core/deps.py"
click node_security "https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/core/security.py"
click node_user_model "https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/models/user.py"
click node_repo_model "https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/models/repository.py"
click node_model_base "https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/models/base.py"
click node_health_schema "https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/schemas/health.py"
click node_repo_upload "https://github.com/aayushasnani/github-ai-assistant/tree/main/backend/app"
click node_github_integration "https://github.com/aayushasnani/github-ai-assistant/tree/main/backend/app"
click node_parsing "https://github.com/aayushasnani/github-ai-assistant/tree/main/backend/app"
click node_code_rag "https://github.com/aayushasnani/github-ai-assistant/tree/main/backend/app"
click node_documentation "https://github.com/aayushasnani/github-ai-assistant/tree/main/backend/app"
click node_bug_detection "https://github.com/aayushasnani/github-ai-assistant/tree/main/backend/app"
click node_refactoring "https://github.com/aayushasnani/github-ai-assistant/tree/main/backend/app"
click node_test_generation "https://github.com/aayushasnani/github-ai-assistant/tree/main/backend/app"
click node_architecture "https://github.com/aayushasnani/github-ai-assistant/tree/main/backend/app"

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_frontend_entry,node_frontend_app,node_user toneBlue
class node_api_app,node_health,node_settings,node_db_session,node_auth_deps,node_security,node_user_model,node_repo_model,node_model_base,node_health_schema,node_database toneAmber
class node_repo_upload,node_github_integration,node_parsing,node_code_rag,node_documentation,node_bug_detection,node_refactoring,node_test_generation,node_architecture toneMint
class node_github,node_ai_services toneIndigo
```

## Components

### Client

- [React entry](https://github.com/aayushasnani/github-ai-assistant/blob/main/frontend/src/main.tsx): `frontend/src/main.tsx`
- [Starter screen](https://github.com/aayushasnani/github-ai-assistant/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`

### Backend foundation

- [FastAPI app](https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/main.py): `backend/app/main.py`
- [Health route](https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/api/v1/health.py): `backend/app/api/v1/health.py`
- [Settings](https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/core/config.py): `backend/app/core/config.py`
- [DB sessions](https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/db/session.py): `backend/app/db/session.py`
- [Auth dependencies](https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/core/deps.py): `backend/app/core/deps.py`
- [JWT security](https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/core/security.py): `backend/app/core/security.py`
- [User model](https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/models/user.py): `backend/app/models/user.py`
- [Repository model](https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/models/repository.py): `backend/app/models/repository.py`
- [ORM base](https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/models/base.py): `backend/app/models/base.py`
- [Health schema](https://github.com/aayushasnani/github-ai-assistant/blob/main/backend/app/schemas/health.py): `backend/app/schemas/health.py`

### Repository intelligence

- [Repository upload](https://github.com/aayushasnani/github-ai-assistant/tree/main/backend/app): `backend/app`
- [GitHub integration](https://github.com/aayushasnani/github-ai-assistant/tree/main/backend/app): `backend/app`
- [Tree-sitter parsing](https://github.com/aayushasnani/github-ai-assistant/tree/main/backend/app): `backend/app`
- [Code-aware RAG](https://github.com/aayushasnani/github-ai-assistant/tree/main/backend/app): `backend/app`
- [Documentation generation](https://github.com/aayushasnani/github-ai-assistant/tree/main/backend/app): `backend/app`
- [Bug detection](https://github.com/aayushasnani/github-ai-assistant/tree/main/backend/app): `backend/app`
- [Refactoring suggestions](https://github.com/aayushasnani/github-ai-assistant/tree/main/backend/app): `backend/app`
- [Unit test generation](https://github.com/aayushasnani/github-ai-assistant/tree/main/backend/app): `backend/app`
- [Architecture visualization](https://github.com/aayushasnani/github-ai-assistant/tree/main/backend/app): `backend/app`

### Other components

- **User**
- **Database**
- **GitHub**
- **AI services**

## Connections

- User → React entry: opens (evidence: `frontend/src/main.tsx`)
- React entry → Starter screen: renders (evidence: `frontend/src/main.tsx`)
- FastAPI app → Health route: registers (evidence: `backend/app/main.py`)
- FastAPI app → Settings: loads (evidence: `backend/app/main.py`)
- FastAPI app → DB sessions: initializes (evidence: `backend/app/main.py`)
- FastAPI app → ORM base: creates tables (evidence: `backend/app/main.py`)
- FastAPI app → User model: loads model (evidence: `backend/app/main.py`)
- FastAPI app → Repository model: loads model (evidence: `backend/app/main.py`)
- Health route → DB sessions: gets session (evidence: `backend/app/api/v1/health.py`)
- Health route → Settings: reads version (evidence: `backend/app/api/v1/health.py`)
- Health route → Health schema: returns schema (evidence: `backend/app/api/v1/health.py`)
- DB sessions → Settings: reads config (evidence: `backend/app/db/session.py`)
- DB sessions → Database: connects (evidence: `backend/app/db/session.py`)
- Auth dependencies → DB sessions: gets session (evidence: `backend/app/core/deps.py`)
- Auth dependencies → JWT security: decodes token (evidence: `backend/app/core/deps.py`)
- Auth dependencies → User model: queries user (evidence: `backend/app/core/deps.py`)
- JWT security → Settings: reads key (evidence: `backend/app/core/security.py`)
- User model → ORM base: inherits (evidence: `backend/app/models/user.py`)
- Repository model → ORM base: inherits (evidence: `backend/app/models/repository.py`)
- Repository upload → Tree-sitter parsing: supports (evidence: `README.md`)
- GitHub integration → GitHub: integrates (evidence: `README.md`)
- Tree-sitter parsing → Code-aware RAG: feeds
- Code-aware RAG → AI services: uses (evidence: `README.md`)
- Code-aware RAG → Documentation generation: supports (evidence: `README.md`)
- Code-aware RAG → Bug detection: supports (evidence: `README.md`)
- Code-aware RAG → Refactoring suggestions: supports (evidence: `README.md`)
- Code-aware RAG → Unit test generation: supports (evidence: `README.md`)
- Code-aware RAG → Architecture visualization: supports (evidence: `README.md`)
