# viren1023/nexus-knowledge-portal architecture

> Architecture diagram of the GitHub repository viren1023/nexus-knowledge-portal, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/viren1023/nexus-knowledge-portal
- Repository: https://github.com/viren1023/nexus-knowledge-portal

## Overview

Nexus is a project knowledge and discovery portal: users manage projects and teams, add documents or Git repositories, search their indexed content, ask persistent AI questions, and manage tasks. Its central knowledge flow queues document/repository ingestion, extracts and embeds content, then stores it for search and chat retrieval. The graph combines README-described capabilities with sampled API wiring and source-index references; several worker and AI internals were not sampled, so those documented links are cited to the README.

Main entry points: [`backend/main.py`](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/main.py) (FastAPI application), [`backend/app/database.py`](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/database.py) (PostgreSQL and pgvector), [`backend/app/api/chat.py`](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/api/chat.py) (Chat API), [`backend/worker.py`](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/worker.py) (Ingestion worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webapp["Web app routes<br/>[App.jsx]"]
  node_projectui["Project workspace<br/>[ProjectDetails.jsx]"]
  node_searchui["Search and chat UI<br/>[SearchPage.jsx]"]
  node_client["API client<br/>[api.js]"]
end

subgraph group_api["API and collaboration"]
  node_apiapp["FastAPI application<br/>[main.py]"]
  node_authapi["Authentication API<br/>[auth.py]"]
  node_projectapi["Project and membership API<br/>[projects.py]"]
  node_taskapi["Task API<br/>[tasks.py]"]
  node_documentapi["Document and repository API<br/>[documents.py]"]
  node_chatapi["Chat API<br/>[chat.py]"]
  node_searchapi["Search API<br/>[search.py]"]
end

subgraph group_ingest["Knowledge ingestion"]
  node_queue["Ingestion queue<br/>[queue_manager.py]"]
  node_worker["Ingestion worker<br/>[worker.py]"]
  node_docprocess["Document processing"]
  node_gitanalysis["Repository analysis<br/>[git_analyzer.py]"]
  node_parsers["Code parsers"]
  node_embedding["Embedding service"]
end

subgraph group_ai["Search and AI"]
  node_hybrid["Hybrid search<br/>[hybrid_search.py]"]
  node_intent["Intent classifier"]
  node_context["Context retrieval"]
  node_response["Answer generation"]
  node_tasktool["AI task creation<br/>[task_tool.py]"]
end

subgraph group_state["Persistence and services"]
  node_db[("PostgreSQL and pgvector<br/>[database.py]")]
  node_models["Knowledge and project records<br/>[document.py]"]
  node_redis["Redis"]
  node_ollama["Ollama models"]
end

node_user(("Project user"))
node_sources["Documents and repositories"]

node_user -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_projectui
node_webapp -->|"routes to"| node_searchui
node_projectui -->|"requests data"| node_client
node_searchui -->|"requests data"| node_client
node_client -->|"calls API"| node_apiapp
node_apiapp -->|"registers routes"| node_authapi
node_apiapp -->|"registers routes"| node_projectapi
node_apiapp -->|"registers routes"| node_taskapi
node_apiapp -->|"registers routes"| node_documentapi
node_apiapp -->|"registers routes"| node_chatapi
node_apiapp -->|"registers routes"| node_searchapi
node_projectapi -->|"reads and writes"| node_db
node_taskapi -->|"reads and writes"| node_db
node_documentapi -->|"enqueues jobs"| node_queue
node_queue -->|"stores jobs"| node_redis
node_redis -->|"dispatches jobs"| node_worker
node_worker -->|"processes documents"| node_docprocess
node_worker -->|"analyzes repositories"| node_gitanalysis
node_gitanalysis -->|"parses source"| node_parsers
node_docprocess -->|"creates embeddings"| node_embedding
node_gitanalysis -->|"embeds code assets"| node_embedding
node_embedding -->|"requests vectors"| node_ollama
node_embedding -->|"persists vectors"| node_db
node_sources -->|"uploads"| node_documentapi
node_searchapi -->|"runs search"| node_hybrid
node_hybrid -->|"queries indexed content"| node_db
node_chatapi -->|"classifies request"| node_intent
node_chatapi -->|"retrieves context"| node_context
node_context -->|"searches knowledge"| node_hybrid
node_context -->|"reads project records"| node_db
node_chatapi -->|"generates answer"| node_response
node_response -.->|"requests completion"| node_ollama
node_chatapi -->|"handles task intent"| node_tasktool
node_tasktool -.->|"creates tasks"| node_taskapi
node_chatapi -->|"stores sessions"| node_db
node_documentapi -->|"stores source records"| node_db
node_worker -->|"updates indexed records"| node_db

click node_webapp "https://github.com/viren1023/nexus-knowledge-portal/blob/main/frontend/src/App.jsx"
click node_projectui "https://github.com/viren1023/nexus-knowledge-portal/blob/main/frontend/src/pages/ProjectDetails.jsx"
click node_searchui "https://github.com/viren1023/nexus-knowledge-portal/blob/main/frontend/src/pages/SearchPage.jsx"
click node_client "https://github.com/viren1023/nexus-knowledge-portal/blob/main/frontend/src/services/api.js"
click node_apiapp "https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/main.py"
click node_authapi "https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/api/auth.py"
click node_projectapi "https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/api/projects.py"
click node_taskapi "https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/api/tasks.py"
click node_documentapi "https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/api/documents.py"
click node_chatapi "https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/api/chat.py"
click node_searchapi "https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/api/search.py"
click node_queue "https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/services/ingestion/queue_manager.py"
click node_worker "https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/worker.py"
click node_docprocess "https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/services/ingestion/document_processor.py"
click node_gitanalysis "https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/services/ingestion/git_analyzer.py"
click node_parsers "https://github.com/viren1023/nexus-knowledge-portal/tree/main/backend/app/services/ingestion/parsers"
click node_embedding "https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/services/ingestion/embedding_service.py"
click node_hybrid "https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/services/search/hybrid_search.py"
click node_intent "https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/services/chat/intent_classifier.py"
click node_context "https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/services/chat/context_retriever.py"
click node_response "https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/services/chat/response_generator.py"
click node_tasktool "https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/services/chat/task_tool.py"
click node_db "https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/database.py"
click node_models "https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/models/document.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_webapp,node_projectui,node_searchui,node_client,node_user toneBlue
class node_apiapp,node_authapi,node_projectapi,node_taskapi,node_documentapi,node_chatapi,node_searchapi toneAmber
class node_queue,node_worker,node_docprocess,node_gitanalysis,node_parsers,node_embedding toneMint
class node_hybrid,node_intent,node_context,node_response,node_tasktool toneRose
class node_db,node_models,node_redis,node_ollama,node_sources toneIndigo
```

## Components

### Web experience

- [Web app routes](https://github.com/viren1023/nexus-knowledge-portal/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Project workspace](https://github.com/viren1023/nexus-knowledge-portal/blob/main/frontend/src/pages/ProjectDetails.jsx): `frontend/src/pages/ProjectDetails.jsx`
- [Search and chat UI](https://github.com/viren1023/nexus-knowledge-portal/blob/main/frontend/src/pages/SearchPage.jsx): `frontend/src/pages/SearchPage.jsx`
- [API client](https://github.com/viren1023/nexus-knowledge-portal/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### API and collaboration

- [FastAPI application](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/main.py): `backend/main.py`
- [Authentication API](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/api/auth.py): `backend/app/api/auth.py`
- [Project and membership API](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/api/projects.py): `backend/app/api/projects.py`
- [Task API](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/api/tasks.py): `backend/app/api/tasks.py`
- [Document and repository API](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/api/documents.py): `backend/app/api/documents.py`
- [Chat API](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/api/chat.py): `backend/app/api/chat.py`
- [Search API](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/api/search.py): `backend/app/api/search.py`

### Knowledge ingestion

- [Ingestion queue](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/services/ingestion/queue_manager.py): `backend/app/services/ingestion/queue_manager.py`
- [Ingestion worker](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/worker.py): `backend/worker.py`
- [Document processing](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/services/ingestion/document_processor.py): `backend/app/services/ingestion/document_processor.py`
- [Repository analysis](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/services/ingestion/git_analyzer.py): `backend/app/services/ingestion/git_analyzer.py`
- [Code parsers](https://github.com/viren1023/nexus-knowledge-portal/tree/main/backend/app/services/ingestion/parsers): `backend/app/services/ingestion/parsers`
- [Embedding service](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/services/ingestion/embedding_service.py): `backend/app/services/ingestion/embedding_service.py`

### Search and AI

- [Hybrid search](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/services/search/hybrid_search.py): `backend/app/services/search/hybrid_search.py`
- [Intent classifier](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/services/chat/intent_classifier.py): `backend/app/services/chat/intent_classifier.py`
- [Context retrieval](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/services/chat/context_retriever.py): `backend/app/services/chat/context_retriever.py`
- [Answer generation](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/services/chat/response_generator.py): `backend/app/services/chat/response_generator.py`
- [AI task creation](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/services/chat/task_tool.py): `backend/app/services/chat/task_tool.py`

### Persistence and services

- [PostgreSQL and pgvector](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/database.py): `backend/app/database.py`
- [Knowledge and project records](https://github.com/viren1023/nexus-knowledge-portal/blob/main/backend/app/models/document.py): `backend/app/models/document.py`
- **Redis**
- **Ollama models**

### Other components

- **Project user**
- **Documents and repositories**

## Connections

- Project user → Web app routes: uses (evidence: `frontend/src/App.jsx`)
- Web app routes → Project workspace: routes to (evidence: `frontend/src/App.jsx`)
- Web app routes → Search and chat UI: routes to (evidence: `frontend/src/App.jsx`)
- Project workspace → API client: requests data (evidence: `frontend/src/pages/ProjectDetails.jsx`)
- Search and chat UI → API client: requests data (evidence: `frontend/src/services/api.js`)
- API client → FastAPI application: calls API (evidence: `frontend/src/services/api.js`)
- FastAPI application → Authentication API: registers routes (evidence: `backend/main.py`)
- FastAPI application → Project and membership API: registers routes (evidence: `backend/main.py`)
- FastAPI application → Task API: registers routes (evidence: `backend/main.py`)
- FastAPI application → Document and repository API: registers routes (evidence: `backend/main.py`)
- FastAPI application → Chat API: registers routes (evidence: `backend/main.py`)
- FastAPI application → Search API: registers routes (evidence: `backend/main.py`)
- Project and membership API → PostgreSQL and pgvector: reads and writes (evidence: `backend/app/api/projects.py`)
- Task API → PostgreSQL and pgvector: reads and writes (evidence: `backend/app/api/tasks.py`)
- Document and repository API → Ingestion queue: enqueues jobs (evidence: `backend/app/api/documents.py`)
- Ingestion queue → Redis: stores jobs
- Redis → Ingestion worker: dispatches jobs (evidence: `README.md`)
- Ingestion worker → Document processing: processes documents (evidence: `README.md`)
- Ingestion worker → Repository analysis: analyzes repositories (evidence: `backend/worker.py`)
- Repository analysis → Code parsers: parses source (evidence: `README.md`)
- Document processing → Embedding service: creates embeddings (evidence: `README.md`)
- Repository analysis → Embedding service: embeds code assets (evidence: `README.md`)
- Embedding service → Ollama models: requests vectors (evidence: `backend/app/services/ingestion/embedding_service.py`)
- Embedding service → PostgreSQL and pgvector: persists vectors (evidence: `README.md`)
- Documents and repositories → Document and repository API: uploads (evidence: `README.md`)
- Search API → Hybrid search: runs search (evidence: `backend/app/api/search.py`)
- Hybrid search → PostgreSQL and pgvector: queries indexed content (evidence: `backend/app/services/search/hybrid_search.py`)
- Chat API → Intent classifier: classifies request (evidence: `backend/app/api/chat.py`)
- Chat API → Context retrieval: retrieves context (evidence: `backend/app/api/chat.py`)
- Context retrieval → Hybrid search: searches knowledge (evidence: `backend/app/services/chat/context_retriever.py`)
- Context retrieval → PostgreSQL and pgvector: reads project records (evidence: `backend/app/services/chat/context_retriever.py`)
- Chat API → Answer generation: generates answer (evidence: `backend/app/api/chat.py`)
- Answer generation → Ollama models: requests completion (evidence: `README.md`)
- Chat API → AI task creation: handles task intent (evidence: `backend/app/api/chat.py`)
- AI task creation → Task API: creates tasks
- Chat API → PostgreSQL and pgvector: stores sessions (evidence: `backend/app/api/chat.py`)
- Document and repository API → PostgreSQL and pgvector: stores source records (evidence: `backend/app/api/documents.py`)
- Ingestion worker → PostgreSQL and pgvector: updates indexed records (evidence: `backend/worker.py`)
