# rahulv1130/codenova architecture

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

- Interactive diagram: https://gitdiagram.com/rahulv1130/codenova
- Repository: https://github.com/rahulv1130/codenova

## Overview

Codenova is a GitHub-connected codebase navigator with a web UI and terminal client. Users authenticate, add a repository for background indexing, then ask codebase questions, generate documentation, review pull requests, or request verified code edits that can become GitHub PRs. The backend combines API routes and worker tasks with relational, vector, and graph stores. README statements establish the major workflows; source excerpts and the index support some internal calls, but several route and agent implementations were not sampled, so those links are documented or left unverified.

Main entry points: [`backend/app/main.py`](https://github.com/rahulv1130/codenova/blob/main/backend/app/main.py) (FastAPI app), [`backend/app/agents/repo_analyzer.py`](https://github.com/rahulv1130/codenova/blob/main/backend/app/agents/repo_analyzer.py) (Ingestion orchestration), [`backend/app/tasks.py`](https://github.com/rahulv1130/codenova/blob/main/backend/app/tasks.py) (Celery tasks), [`backend/app/services/vector_store.py`](https://github.com/rahulv1130/codenova/blob/main/backend/app/services/vector_store.py) (Qdrant vectors)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User clients"]
  node_web["Web app<br/>[page.tsx]"]
  node_cli["CLI<br/>[main.py]"]
  node_cli_api["CLI API client<br/>[client.py]"]
end

subgraph group_api["API and jobs"]
  node_api_entry["FastAPI app<br/>[main.py]"]
  node_repo_routes["Repository routes<br/>[repositories.py]"]
  node_chat_routes["Chat routes<br/>[chat.py]"]
  node_docs_routes["Documentation routes<br/>[docs.py]"]
  node_pr_routes["PR routes<br/>[pull_request.py]"]
  node_edit_routes["Edit routes<br/>[code_edit.py]"]
  node_worker["Celery tasks<br/>[tasks.py]"]
end

subgraph group_indexing["Repository indexing"]
  node_repo_analyzer["Ingestion orchestration<br/>[repo_analyzer.py]"]
  node_github["GitHub loading<br/>[github_service.py]"]
  node_ast["AST extraction<br/>[ast_extractor.py]"]
  node_api_surface["API surface extraction"]
end

subgraph group_workflows["AI workflows"]
  node_chat_agent["Repository chat<br/>[chat_agent.py]"]
  node_doc_agent["Documentation generation<br/>[doc_agent.py]"]
  node_pr_agent["PR review<br/>[pr_agent.py]"]
  node_planner["Edit planner<br/>[planner.py]"]
  node_editor["Edit agent<br/>[agentic_editor.py]"]
  node_verifier["Edit verification<br/>[verify.py]"]
  node_sandbox["Container session"]
end

subgraph group_data["Knowledge and state"]
  node_postgres[("PostgreSQL<br/>[database.py]")]
  node_vectors[("Qdrant vectors<br/>[vector_store.py]")]
  node_graph[("Neo4j graph<br/>[graph_store.py]")]
  node_redis["Redis status and queue<br/>[redis.py]"]
end

node_user(("Engineer"))
node_github_service["GitHub"]
node_llm["OpenRouter models"]
node_openai["OpenAI embeddings"]
node_docker["Docker sandbox"]

node_user -->|"uses"| node_web
node_user -->|"uses"| node_cli
node_web -->|"REST and SSE"| node_api_entry
node_cli -->|"calls"| node_cli_api
node_cli_api -->|"HTTP requests"| node_api_entry
node_api_entry -->|"registers"| node_repo_routes
node_api_entry -->|"registers"| node_chat_routes
node_api_entry -->|"registers"| node_docs_routes
node_api_entry -->|"registers"| node_pr_routes
node_api_entry -->|"registers"| node_edit_routes
node_repo_routes -.->|"enqueues ingestion"| node_worker
node_worker -->|"runs indexing"| node_repo_analyzer
node_repo_analyzer -->|"loads repository"| node_github
node_repo_analyzer -->|"extracts structure"| node_ast
node_repo_analyzer -->|"extracts surfaces"| node_api_surface
node_repo_analyzer -->|"indexes chunks"| node_vectors
node_repo_analyzer -->|"writes graph"| node_graph
node_chat_routes -->|"invokes"| node_chat_agent
node_chat_agent -->|"searches code"| node_vectors
node_chat_agent -->|"adds graph context"| node_graph
node_chat_agent -->|"generates answers"| node_llm
node_docs_routes -.->|"invokes"| node_doc_agent
node_doc_agent -->|"retrieves context"| node_vectors
node_doc_agent -->|"retrieves context"| node_graph
node_doc_agent -->|"generates topics"| node_llm
node_pr_routes -.->|"invokes"| node_pr_agent
node_pr_agent -->|"fetches PR data"| node_github
node_pr_agent -->|"analyzes impact"| node_graph
node_pr_agent -->|"analyzes and synthesizes"| node_llm
node_edit_routes -->|"queues edit"| node_worker
node_worker -->|"starts planning"| node_planner
node_planner -->|"retrieves context"| node_vectors
node_worker -->|"runs edit agent"| node_editor
node_editor -->|"uses session"| node_sandbox
node_worker -->|"verifies changes"| node_verifier
node_verifier -->|"runs checks"| node_sandbox
node_worker -->|"pushes approved changes"| node_github
node_editor -->|"uses coding model"| node_llm
node_api_entry -->|"initializes database"| node_postgres
node_api_entry -->|"connects"| node_redis
node_api_entry -->|"ensures collection"| node_vectors
node_api_entry -->|"creates indexes"| node_graph
node_repo_analyzer -->|"embeds chunks"| node_openai
node_sandbox -->|"runs isolated container"| node_docker

click node_web "https://github.com/rahulv1130/codenova/blob/main/frontend/src/app/page.tsx"
click node_cli "https://github.com/rahulv1130/codenova/blob/main/cli/src/codenova/main.py"
click node_cli_api "https://github.com/rahulv1130/codenova/blob/main/cli/src/codenova/api/client.py"
click node_api_entry "https://github.com/rahulv1130/codenova/blob/main/backend/app/main.py"
click node_repo_routes "https://github.com/rahulv1130/codenova/blob/main/backend/app/api/routes/repositories.py"
click node_chat_routes "https://github.com/rahulv1130/codenova/blob/main/backend/app/api/routes/chat.py"
click node_docs_routes "https://github.com/rahulv1130/codenova/blob/main/backend/app/api/routes/docs.py"
click node_pr_routes "https://github.com/rahulv1130/codenova/blob/main/backend/app/api/routes/pull_request.py"
click node_edit_routes "https://github.com/rahulv1130/codenova/blob/main/backend/app/api/routes/code_edit.py"
click node_worker "https://github.com/rahulv1130/codenova/blob/main/backend/app/tasks.py"
click node_repo_analyzer "https://github.com/rahulv1130/codenova/blob/main/backend/app/agents/repo_analyzer.py"
click node_github "https://github.com/rahulv1130/codenova/blob/main/backend/app/services/github_service.py"
click node_ast "https://github.com/rahulv1130/codenova/blob/main/backend/app/services/ast_extractor.py"
click node_api_surface "https://github.com/rahulv1130/codenova/blob/main/backend/app/services/api_surface_extractor.py"
click node_chat_agent "https://github.com/rahulv1130/codenova/blob/main/backend/app/agents/chat_agent.py"
click node_doc_agent "https://github.com/rahulv1130/codenova/blob/main/backend/app/agents/doc_agent.py"
click node_pr_agent "https://github.com/rahulv1130/codenova/blob/main/backend/app/agents/pr_agent.py"
click node_planner "https://github.com/rahulv1130/codenova/blob/main/backend/app/agents/coding_agent/planner.py"
click node_editor "https://github.com/rahulv1130/codenova/blob/main/backend/app/agents/coding_agent/agentic_editor.py"
click node_verifier "https://github.com/rahulv1130/codenova/blob/main/backend/app/agents/coding_agent/verify.py"
click node_sandbox "https://github.com/rahulv1130/codenova/blob/main/backend/app/services/container_session.py"
click node_postgres "https://github.com/rahulv1130/codenova/blob/main/backend/app/core/database.py"
click node_vectors "https://github.com/rahulv1130/codenova/blob/main/backend/app/services/vector_store.py"
click node_graph "https://github.com/rahulv1130/codenova/blob/main/backend/app/services/graph_store.py"
click node_redis "https://github.com/rahulv1130/codenova/blob/main/backend/app/core/redis.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_web,node_cli,node_cli_api toneBlue
class node_api_entry,node_repo_routes,node_chat_routes,node_docs_routes,node_pr_routes,node_edit_routes,node_worker toneAmber
class node_repo_analyzer,node_github,node_ast,node_api_surface,node_llm toneMint
class node_chat_agent,node_doc_agent,node_pr_agent,node_planner,node_editor,node_verifier,node_sandbox toneRose
class node_postgres,node_vectors,node_graph,node_redis,node_user,node_github_service,node_openai,node_docker toneIndigo
```

## Components

### User clients

- [Web app](https://github.com/rahulv1130/codenova/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [CLI](https://github.com/rahulv1130/codenova/blob/main/cli/src/codenova/main.py): `cli/src/codenova/main.py`
- [CLI API client](https://github.com/rahulv1130/codenova/blob/main/cli/src/codenova/api/client.py): `cli/src/codenova/api/client.py`

### API and jobs

- [FastAPI app](https://github.com/rahulv1130/codenova/blob/main/backend/app/main.py): `backend/app/main.py`
- [Repository routes](https://github.com/rahulv1130/codenova/blob/main/backend/app/api/routes/repositories.py): `backend/app/api/routes/repositories.py`
- [Chat routes](https://github.com/rahulv1130/codenova/blob/main/backend/app/api/routes/chat.py): `backend/app/api/routes/chat.py`
- [Documentation routes](https://github.com/rahulv1130/codenova/blob/main/backend/app/api/routes/docs.py): `backend/app/api/routes/docs.py`
- [PR routes](https://github.com/rahulv1130/codenova/blob/main/backend/app/api/routes/pull_request.py): `backend/app/api/routes/pull_request.py`
- [Edit routes](https://github.com/rahulv1130/codenova/blob/main/backend/app/api/routes/code_edit.py): `backend/app/api/routes/code_edit.py`
- [Celery tasks](https://github.com/rahulv1130/codenova/blob/main/backend/app/tasks.py): `backend/app/tasks.py`

### Repository indexing

- [Ingestion orchestration](https://github.com/rahulv1130/codenova/blob/main/backend/app/agents/repo_analyzer.py): `backend/app/agents/repo_analyzer.py`
- [GitHub loading](https://github.com/rahulv1130/codenova/blob/main/backend/app/services/github_service.py): `backend/app/services/github_service.py`
- [AST extraction](https://github.com/rahulv1130/codenova/blob/main/backend/app/services/ast_extractor.py): `backend/app/services/ast_extractor.py`
- [API surface extraction](https://github.com/rahulv1130/codenova/blob/main/backend/app/services/api_surface_extractor.py): `backend/app/services/api_surface_extractor.py`

### AI workflows

- [Repository chat](https://github.com/rahulv1130/codenova/blob/main/backend/app/agents/chat_agent.py): `backend/app/agents/chat_agent.py`
- [Documentation generation](https://github.com/rahulv1130/codenova/blob/main/backend/app/agents/doc_agent.py): `backend/app/agents/doc_agent.py`
- [PR review](https://github.com/rahulv1130/codenova/blob/main/backend/app/agents/pr_agent.py): `backend/app/agents/pr_agent.py`
- [Edit planner](https://github.com/rahulv1130/codenova/blob/main/backend/app/agents/coding_agent/planner.py): `backend/app/agents/coding_agent/planner.py`
- [Edit agent](https://github.com/rahulv1130/codenova/blob/main/backend/app/agents/coding_agent/agentic_editor.py): `backend/app/agents/coding_agent/agentic_editor.py`
- [Edit verification](https://github.com/rahulv1130/codenova/blob/main/backend/app/agents/coding_agent/verify.py): `backend/app/agents/coding_agent/verify.py`
- [Container session](https://github.com/rahulv1130/codenova/blob/main/backend/app/services/container_session.py): `backend/app/services/container_session.py`

### Knowledge and state

- [PostgreSQL](https://github.com/rahulv1130/codenova/blob/main/backend/app/core/database.py): `backend/app/core/database.py`
- [Qdrant vectors](https://github.com/rahulv1130/codenova/blob/main/backend/app/services/vector_store.py): `backend/app/services/vector_store.py`
- [Neo4j graph](https://github.com/rahulv1130/codenova/blob/main/backend/app/services/graph_store.py): `backend/app/services/graph_store.py`
- [Redis status and queue](https://github.com/rahulv1130/codenova/blob/main/backend/app/core/redis.py): `backend/app/core/redis.py`

### Other components

- **Engineer**
- **GitHub**
- **OpenRouter models**
- **OpenAI embeddings**
- **Docker sandbox**

## Connections

- Engineer → Web app: uses (evidence: `README.md`)
- Engineer → CLI: uses (evidence: `README.md`)
- Web app → FastAPI app: REST and SSE (evidence: `README.md`)
- CLI → CLI API client: calls (evidence: `cli/src/codenova/main.py`)
- CLI API client → FastAPI app: HTTP requests (evidence: `README.md`)
- FastAPI app → Repository routes: registers (evidence: `backend/app/main.py`)
- FastAPI app → Chat routes: registers (evidence: `backend/app/main.py`)
- FastAPI app → Documentation routes: registers (evidence: `backend/app/main.py`)
- FastAPI app → PR routes: registers (evidence: `backend/app/main.py`)
- FastAPI app → Edit routes: registers (evidence: `backend/app/main.py`)
- Repository routes → Celery tasks: enqueues ingestion
- Celery tasks → Ingestion orchestration: runs indexing (evidence: `backend/app/tasks.py`)
- Ingestion orchestration → GitHub loading: loads repository (evidence: `backend/app/agents/repo_analyzer.py`)
- Ingestion orchestration → AST extraction: extracts structure (evidence: `backend/app/agents/repo_analyzer.py`)
- Ingestion orchestration → API surface extraction: extracts surfaces (evidence: `backend/app/agents/repo_analyzer.py`)
- Ingestion orchestration → Qdrant vectors: indexes chunks (evidence: `backend/app/agents/repo_analyzer.py`)
- Ingestion orchestration → Neo4j graph: writes graph (evidence: `backend/app/agents/repo_analyzer.py`)
- Chat routes → Repository chat: invokes (evidence: `backend/app/api/routes/chat.py`)
- Repository chat → Qdrant vectors: searches code (evidence: `README.md`)
- Repository chat → Neo4j graph: adds graph context (evidence: `README.md`)
- Repository chat → OpenRouter models: generates answers (evidence: `README.md`)
- Documentation routes → Documentation generation: invokes
- Documentation generation → Qdrant vectors: retrieves context (evidence: `README.md`)
- Documentation generation → Neo4j graph: retrieves context (evidence: `README.md`)
- Documentation generation → OpenRouter models: generates topics (evidence: `README.md`)
- PR routes → PR review: invokes
- PR review → GitHub loading: fetches PR data (evidence: `README.md`)
- PR review → Neo4j graph: analyzes impact (evidence: `README.md`)
- PR review → OpenRouter models: analyzes and synthesizes (evidence: `README.md`)
- Edit routes → Celery tasks: queues edit (evidence: `backend/app/api/routes/code_edit.py`)
- Celery tasks → Edit planner: starts planning (evidence: `backend/app/tasks.py`)
- Edit planner → Qdrant vectors: retrieves context (evidence: `backend/app/agents/coding_agent/planner.py`)
- Celery tasks → Edit agent: runs edit agent (evidence: `backend/app/tasks.py`)
- Edit agent → Container session: uses session (evidence: `backend/app/agents/coding_agent/agentic_editor.py`)
- Celery tasks → Edit verification: verifies changes (evidence: `backend/app/tasks.py`)
- Edit verification → Container session: runs checks (evidence: `backend/app/agents/coding_agent/verify.py`)
- Celery tasks → GitHub loading: pushes approved changes (evidence: `README.md`)
- Edit agent → OpenRouter models: uses coding model (evidence: `README.md`)
- FastAPI app → PostgreSQL: initializes database (evidence: `backend/app/main.py`)
- FastAPI app → Redis status and queue: connects (evidence: `backend/app/main.py`)
- FastAPI app → Qdrant vectors: ensures collection (evidence: `backend/app/main.py`)
- FastAPI app → Neo4j graph: creates indexes (evidence: `backend/app/main.py`)
- Ingestion orchestration → OpenAI embeddings: embeds chunks (evidence: `README.md`)
- Container session → Docker sandbox: runs isolated container (evidence: `README.md`)
