# hhari1234/codeforge-ai architecture

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

- Interactive diagram: https://gitdiagram.com/hhari1234/codeforge-ai
- Repository: https://github.com/hhari1234/codeforge-ai

## Overview

CodeForge AI is a full-stack developer platform: developers use a dashboard to submit code or repositories to AI tools and view or revisit results. Its broad feature set includes project and README generation, code review and explanation, debugging, API documentation, repository analysis, and repository chat. The sampled source shows the repository-analysis and chat paths in more detail; other feature branches are retained from the README and tree. Connections for unsampled feature internals are limited to documented capabilities rather than inferred call chains.

Main entry points: [`backend/app/api/routes/repository_chat.py`](https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/api/routes/repository_chat.py) (Chat routes), [`backend/app/api/routes/repository_analyzer.py`](https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/api/routes/repository_analyzer.py) (Analyzer routes), [`backend/app/main.py`](https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/main.py) (FastAPI application), [`frontend/src/App.tsx`](https://github.com/hhari1234/codeforge-ai/blob/master/frontend/src/App.tsx) (Dashboard SPA)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_spa["Dashboard SPA<br/>[App.tsx]"]
  node_repo_pages["Repository pages"]
  node_repo_hooks["Repository hooks"]
  node_repo_services["Repository API clients"]
  node_tool_pages["AI tool pages"]
  node_tool_clients["AI tool clients"]
  node_auth_ui["Authentication UI<br/>[authService.ts]"]
end

subgraph group_api["API and identity"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_auth_routes["Auth routes<br/>[auth.py]"]
  node_auth_service["Auth service<br/>[auth_service.py]"]
  node_dependencies["API dependencies<br/>[deps.py]"]
end

subgraph group_repo["Repository workflows"]
  node_analysis_route["Analyzer routes"]
  node_github_clone["GitHub clone<br/>[github_clone.py]"]
  node_repo_ingest["Repository ingestion<br/>[repo_ingest.py]"]
  node_analysis_ai["Repository analysis<br/>[analyzer.py]"]
  node_analysis_service["Analysis records"]
  node_chat_route["Chat routes<br/>[repository_chat.py]"]
  node_chat_ai["Repository chat<br/>[chat.py]"]
  node_chat_indexing["Chat indexing"]
end

subgraph group_tools["AI developer tools"]
  node_feature_routes["Tool endpoints"]
  node_feature_services["Tool services"]
  node_feature_ai["AI generators"]
end

subgraph group_state["Persistence and AI"]
  node_database[("SQL database<br/>[session.py]")]
  node_chroma[("ChromaDB vectors<br/>[vector_store.py]")]
  node_openrouter["OpenRouter"]
end

node_developer(("Developer"))

node_developer -->|"uses"| node_spa
node_spa -->|"routes to"| node_repo_pages
node_repo_pages -.->|"uses"| node_repo_hooks
node_repo_hooks -->|"calls"| node_repo_services
node_repo_services -.->|"HTTP requests"| node_analysis_route
node_spa -->|"routes to"| node_tool_pages
node_tool_pages -.->|"uses"| node_tool_clients
node_tool_clients -.->|"HTTP requests"| node_feature_routes
node_auth_ui -->|"HTTP requests"| node_auth_routes
node_api_app -->|"registers"| node_analysis_route
node_api_app -->|"registers"| node_chat_route
node_api_app -->|"registers"| node_auth_routes
node_api_app -->|"registers"| node_feature_routes
node_analysis_route -->|"clones"| node_github_clone
node_analysis_route -->|"ingests"| node_repo_ingest
node_analysis_route -->|"analyzes with"| node_analysis_ai
node_analysis_route -->|"persists and retrieves"| node_analysis_service
node_chat_route -->|"loads analysis"| node_analysis_service
node_chat_route -->|"clones"| node_github_clone
node_chat_route -->|"ingests"| node_repo_ingest
node_chat_route -->|"builds index"| node_chat_indexing
node_chat_route -->|"runs chat"| node_chat_ai
node_auth_routes -->|"delegates"| node_auth_service
node_analysis_service -.->|"stores records"| node_database
node_auth_service -.->|"stores users"| node_database
node_chat_indexing -.->|"stores vectors"| node_chroma
node_feature_routes -.->|"delegates"| node_feature_services
node_feature_services -.->|"uses AI"| node_feature_ai
node_feature_ai -.->|"requests completions"| node_openrouter
node_analysis_ai -.->|"requests analysis"| node_openrouter
node_chat_ai -.->|"requests answers"| node_openrouter

click node_spa "https://github.com/hhari1234/codeforge-ai/blob/master/frontend/src/App.tsx"
click node_repo_pages "https://github.com/hhari1234/codeforge-ai/tree/master/frontend/src/pages"
click node_repo_hooks "https://github.com/hhari1234/codeforge-ai/tree/master/frontend/src/hooks"
click node_repo_services "https://github.com/hhari1234/codeforge-ai/tree/master/frontend/src/services"
click node_tool_pages "https://github.com/hhari1234/codeforge-ai/tree/master/frontend/src/pages"
click node_tool_clients "https://github.com/hhari1234/codeforge-ai/tree/master/frontend/src/services"
click node_auth_ui "https://github.com/hhari1234/codeforge-ai/blob/master/frontend/src/services/authService.ts"
click node_api_app "https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/main.py"
click node_auth_routes "https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/api/routes/auth.py"
click node_auth_service "https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/services/auth_service.py"
click node_dependencies "https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/api/deps.py"
click node_analysis_route "https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/api/routes/repository_analyzer.py"
click node_github_clone "https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/parsers/github_clone.py"
click node_repo_ingest "https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/parsers/repo_ingest.py"
click node_analysis_ai "https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/ai/repository_analyzer/analyzer.py"
click node_analysis_service "https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/services/repository_analysis_service.py"
click node_chat_route "https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/api/routes/repository_chat.py"
click node_chat_ai "https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/ai/repository_chat/chat.py"
click node_chat_indexing "https://github.com/hhari1234/codeforge-ai/tree/master/backend/app/ai/repository_chat"
click node_feature_routes "https://github.com/hhari1234/codeforge-ai/tree/master/backend/app/api/routes"
click node_feature_services "https://github.com/hhari1234/codeforge-ai/tree/master/backend/app/services"
click node_feature_ai "https://github.com/hhari1234/codeforge-ai/tree/master/backend/app/ai"
click node_database "https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/database/session.py"
click node_chroma "https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/ai/repository_chat/vector_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_spa,node_repo_pages,node_repo_hooks,node_repo_services,node_tool_pages,node_tool_clients,node_auth_ui toneBlue
class node_api_app,node_auth_routes,node_auth_service,node_dependencies toneAmber
class node_analysis_route,node_github_clone,node_repo_ingest,node_analysis_ai,node_analysis_service,node_chat_route,node_chat_ai,node_chat_indexing toneMint
class node_feature_routes,node_feature_services,node_feature_ai toneRose
class node_database,node_chroma,node_openrouter,node_developer toneIndigo
```

## Components

### Web client

- [Dashboard SPA](https://github.com/hhari1234/codeforge-ai/blob/master/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Repository pages](https://github.com/hhari1234/codeforge-ai/tree/master/frontend/src/pages): `frontend/src/pages`
- [Repository hooks](https://github.com/hhari1234/codeforge-ai/tree/master/frontend/src/hooks): `frontend/src/hooks`
- [Repository API clients](https://github.com/hhari1234/codeforge-ai/tree/master/frontend/src/services): `frontend/src/services`
- [AI tool pages](https://github.com/hhari1234/codeforge-ai/tree/master/frontend/src/pages): `frontend/src/pages`
- [AI tool clients](https://github.com/hhari1234/codeforge-ai/tree/master/frontend/src/services): `frontend/src/services`
- [Authentication UI](https://github.com/hhari1234/codeforge-ai/blob/master/frontend/src/services/authService.ts): `frontend/src/services/authService.ts`

### API and identity

- [FastAPI application](https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/main.py): `backend/app/main.py`
- [Auth routes](https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/api/routes/auth.py): `backend/app/api/routes/auth.py`
- [Auth service](https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/services/auth_service.py): `backend/app/services/auth_service.py`
- [API dependencies](https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/api/deps.py): `backend/app/api/deps.py`

### Repository workflows

- [Analyzer routes](https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/api/routes/repository_analyzer.py): `backend/app/api/routes/repository_analyzer.py`
- [GitHub clone](https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/parsers/github_clone.py): `backend/app/parsers/github_clone.py`
- [Repository ingestion](https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/parsers/repo_ingest.py): `backend/app/parsers/repo_ingest.py`
- [Repository analysis](https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/ai/repository_analyzer/analyzer.py): `backend/app/ai/repository_analyzer/analyzer.py`
- [Analysis records](https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/services/repository_analysis_service.py): `backend/app/services/repository_analysis_service.py`
- [Chat routes](https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/api/routes/repository_chat.py): `backend/app/api/routes/repository_chat.py`
- [Repository chat](https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/ai/repository_chat/chat.py): `backend/app/ai/repository_chat/chat.py`
- [Chat indexing](https://github.com/hhari1234/codeforge-ai/tree/master/backend/app/ai/repository_chat): `backend/app/ai/repository_chat`

### AI developer tools

- [Tool endpoints](https://github.com/hhari1234/codeforge-ai/tree/master/backend/app/api/routes): `backend/app/api/routes`
- [Tool services](https://github.com/hhari1234/codeforge-ai/tree/master/backend/app/services): `backend/app/services`
- [AI generators](https://github.com/hhari1234/codeforge-ai/tree/master/backend/app/ai): `backend/app/ai`

### Persistence and AI

- [SQL database](https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/database/session.py): `backend/app/database/session.py`
- [ChromaDB vectors](https://github.com/hhari1234/codeforge-ai/blob/master/backend/app/ai/repository_chat/vector_store.py): `backend/app/ai/repository_chat/vector_store.py`
- **OpenRouter**

### Other components

- **Developer**

## Connections

- Developer → Dashboard SPA: uses (evidence: `README.md`)
- Dashboard SPA → Repository pages: routes to (evidence: `frontend/src/App.tsx`)
- Repository pages → Repository hooks: uses (evidence: `frontend/src/pages/RepositoryChatPage.tsx`)
- Repository hooks → Repository API clients: calls (evidence: `frontend/src/hooks/useRepositoryAnalysis.ts`)
- Repository API clients → Analyzer routes: HTTP requests
- Dashboard SPA → AI tool pages: routes to (evidence: `frontend/src/App.tsx`)
- AI tool pages → AI tool clients: uses
- AI tool clients → Tool endpoints: HTTP requests
- Authentication UI → Auth routes: HTTP requests (evidence: `frontend/src/services/authService.ts`)
- FastAPI application → Analyzer routes: registers (evidence: `backend/app/main.py`)
- FastAPI application → Chat routes: registers (evidence: `backend/app/main.py`)
- FastAPI application → Auth routes: registers (evidence: `backend/app/main.py`)
- FastAPI application → Tool endpoints: registers (evidence: `backend/app/main.py`)
- Analyzer routes → GitHub clone: clones (evidence: `backend/app/api/routes/repository_analyzer.py`)
- Analyzer routes → Repository ingestion: ingests (evidence: `backend/app/api/routes/repository_analyzer.py`)
- Analyzer routes → Repository analysis: analyzes with (evidence: `backend/app/api/routes/repository_analyzer.py`)
- Analyzer routes → Analysis records: persists and retrieves (evidence: `backend/app/api/routes/repository_analyzer.py`)
- Chat routes → Analysis records: loads analysis (evidence: `backend/app/api/routes/repository_chat.py`)
- Chat routes → GitHub clone: clones (evidence: `backend/app/api/routes/repository_chat.py`)
- Chat routes → Repository ingestion: ingests (evidence: `backend/app/api/routes/repository_chat.py`)
- Chat routes → Chat indexing: builds index (evidence: `backend/app/api/routes/repository_chat.py`)
- Chat routes → Repository chat: runs chat (evidence: `backend/app/api/routes/repository_chat.py`)
- Auth routes → Auth service: delegates (evidence: `backend/app/services/auth_service.py`)
- Analysis records → SQL database: stores records
- Auth service → SQL database: stores users
- Chat indexing → ChromaDB vectors: stores vectors
- Tool endpoints → Tool services: delegates (evidence: `backend/app/api/routes/repository_analyzer.py`)
- Tool services → AI generators: uses AI
- AI generators → OpenRouter: requests completions (evidence: `README.md`)
- Repository analysis → OpenRouter: requests analysis (evidence: `README.md`)
- Repository chat → OpenRouter: requests answers (evidence: `README.md`)
