# emaaadev/knova_hub architecture

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

- Interactive diagram: https://gitdiagram.com/emaaadev/knova_hub
- Repository: https://github.com/emaaadev/knova_hub

## Overview

Knova Hub is an enterprise knowledge-management platform: staff use a JavaScript web client to manage company knowledge and ask natural-language questions; the API applies company and role context, retrieves eligible indexed document text, asks Claude, and returns an answer with source documents. The backend separates API, application services, domain contracts/entities, and infrastructure. The README also describes automated organization and proactive recommendations, but their implementation and wiring were not sampled, so those branches are represented without guessed call paths.

Main entry points: [`Knova Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/DocumentService.cs`](https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/DocumentService.cs) (Document management), [`Knova Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/QueryService.cs`](https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/QueryService.cs) (Question answering), [`Client-Js/dashboard/js/app.js`](https://github.com/emaaadev/knova_hub/blob/main/Client-Js/dashboard/js/app.js) (Web interface), [`Client-Js/auth/js/auth.js`](https://github.com/emaaadev/knova_hub/blob/main/Client-Js/auth/js/auth.js) (Sign-in UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_web["Web interface<br/>[app.js]"]
  node_authui["Sign-in UI<br/>[auth.js]"]
end

subgraph group_api["API and access"]
  node_authapi["Authentication API<br/>[AuthController.cs]"]
  node_departments["Department API"]
  node_documentsapi["Document API"]
  node_aiapi["AI query API<br/>[AiController.cs]"]
  node_access["Access policies"]
end

subgraph group_application["Knowledge services"]
  node_authservice["Auth service<br/>[AuthService.cs]"]
  node_documentservice["Document management<br/>[DocumentService.cs]"]
  node_discovery["Document discovery"]
  node_queryservice["Question answering<br/>[QueryService.cs]"]
  node_organization["Knowledge organization<br/>[CategoryService.cs]"]
  node_recommendations["Proactive suggestions"]
  node_filestorage["File storage"]
end

subgraph group_infrastructure["Infrastructure"]
  node_textprocessing["Text extraction"]
  node_claude["Claude integration<br/>[ClaudeAiService.cs]"]
  node_querylogs["Query history"]
end

subgraph group_domain["Domain and persistence"]
  node_database[("Application database")]
end

node_staff(("Staff user"))
node_externalclaude{{"Anthropic Claude"}}

node_staff -->|"uses"| node_web
node_staff -->|"signs in"| node_authui
node_web -.->|"manages documents"| node_documentsapi
node_authui -.->|"authenticates"| node_authapi
node_authapi -->|"delegates to"| node_authservice
node_departments -->|"checks access"| node_access
node_documentsapi -->|"delegates to"| node_documentservice
node_aiapi -.->|"dispatches query"| node_queryservice
node_documentservice -.->|"stores files"| node_filestorage
node_documentservice -.->|"extracts text"| node_textprocessing
node_documentservice -.->|"supports discovery"| node_discovery
node_staff -->|"asks questions"| node_aiapi
node_queryservice -->|"requests answer"| node_claude
node_claude -->|"calls API"| node_externalclaude
node_queryservice -->|"records query"| node_querylogs
node_querylogs -->|"writes logs"| node_database
node_organization -.->|"organizes knowledge"| node_staff
node_recommendations -.->|"suggests resources"| node_staff

click node_web "https://github.com/emaaadev/knova_hub/blob/main/Client-Js/dashboard/js/app.js"
click node_authui "https://github.com/emaaadev/knova_hub/blob/main/Client-Js/auth/js/auth.js"
click node_authapi "https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.API/Controllers/AuthController.cs"
click node_departments "https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.API/Controllers/DepartmentsController.cs"
click node_documentsapi "https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.API/Controllers/DocumentsController.cs"
click node_aiapi "https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.API/Controllers/AiController.cs"
click node_access "https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.API/Authorization/DepartmentAccessHandler.cs"
click node_authservice "https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/AuthService.cs"
click node_documentservice "https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/DocumentService.cs"
click node_discovery "https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/DocumentService.Discovery.cs"
click node_queryservice "https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/QueryService.cs"
click node_organization "https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/CategoryService.cs"
click node_recommendations "https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.ApplicationLayer/DTOs/DocumentSuggestionDto.cs"
click node_textprocessing "https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.InfrastructureLayer/Services/DocumentTextExtractor.cs"
click node_filestorage "https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/LocalFileStorage.cs"
click node_claude "https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.InfrastructureLayer/Services/ClaudeAiService.cs"
click node_database "https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.InfrastructureLayer/DbContext/KnovaHubDbContext.cs"
click node_querylogs "https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.InfrastructureLayer/Repositories/QueryLogRepository.cs"

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_authui,node_staff toneBlue
class node_authapi,node_departments,node_documentsapi,node_aiapi,node_access toneAmber
class node_authservice,node_documentservice,node_discovery,node_queryservice,node_organization,node_recommendations,node_filestorage toneMint
class node_textprocessing,node_claude,node_querylogs toneRose
class node_database,node_externalclaude toneIndigo
```

## Components

### Web client

- [Web interface](https://github.com/emaaadev/knova_hub/blob/main/Client-Js/dashboard/js/app.js): `Client-Js/dashboard/js/app.js`
- [Sign-in UI](https://github.com/emaaadev/knova_hub/blob/main/Client-Js/auth/js/auth.js): `Client-Js/auth/js/auth.js`

### API and access

- [Authentication API](https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.API/Controllers/AuthController.cs): `Knova Hub/Knova_Hub/KnovaHub.API/Controllers/AuthController.cs`
- [Department API](https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.API/Controllers/DepartmentsController.cs): `Knova Hub/Knova_Hub/KnovaHub.API/Controllers/DepartmentsController.cs`
- [Document API](https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.API/Controllers/DocumentsController.cs): `Knova Hub/Knova_Hub/KnovaHub.API/Controllers/DocumentsController.cs`
- [AI query API](https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.API/Controllers/AiController.cs): `Knova Hub/Knova_Hub/KnovaHub.API/Controllers/AiController.cs`
- [Access policies](https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.API/Authorization/DepartmentAccessHandler.cs): `Knova Hub/Knova_Hub/KnovaHub.API/Authorization/DepartmentAccessHandler.cs`

### Knowledge services

- [Auth service](https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/AuthService.cs): `Knova Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/AuthService.cs`
- [Document management](https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/DocumentService.cs): `Knova Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/DocumentService.cs`
- [Document discovery](https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/DocumentService.Discovery.cs): `Knova Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/DocumentService.Discovery.cs`
- [Question answering](https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/QueryService.cs): `Knova Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/QueryService.cs`
- [Knowledge organization](https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/CategoryService.cs): `Knova Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/CategoryService.cs`
- [Proactive suggestions](https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.ApplicationLayer/DTOs/DocumentSuggestionDto.cs): `Knova Hub/Knova_Hub/KnovaHub.ApplicationLayer/DTOs/DocumentSuggestionDto.cs`
- [File storage](https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/LocalFileStorage.cs): `Knova Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/LocalFileStorage.cs`

### Infrastructure

- [Text extraction](https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.InfrastructureLayer/Services/DocumentTextExtractor.cs): `Knova Hub/Knova_Hub/KnovaHub.InfrastructureLayer/Services/DocumentTextExtractor.cs`
- [Claude integration](https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.InfrastructureLayer/Services/ClaudeAiService.cs): `Knova Hub/Knova_Hub/KnovaHub.InfrastructureLayer/Services/ClaudeAiService.cs`
- [Query history](https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.InfrastructureLayer/Repositories/QueryLogRepository.cs): `Knova Hub/Knova_Hub/KnovaHub.InfrastructureLayer/Repositories/QueryLogRepository.cs`

### Domain and persistence

- [Application database](https://github.com/emaaadev/knova_hub/blob/main/Knova%20Hub/Knova_Hub/KnovaHub.InfrastructureLayer/DbContext/KnovaHubDbContext.cs): `Knova Hub/Knova_Hub/KnovaHub.InfrastructureLayer/DbContext/KnovaHubDbContext.cs`

### Other components

- **Staff user**
- **Anthropic Claude**

## Connections

- Staff user → Web interface: uses
- Staff user → Sign-in UI: signs in
- Web interface → Document API: manages documents
- Sign-in UI → Authentication API: authenticates
- Authentication API → Auth service: delegates to (evidence: `Knova Hub/Knova_Hub/KnovaHub.API/Controllers/AuthController.cs`)
- Department API → Access policies: checks access (evidence: `Knova Hub/Knova_Hub/KnovaHub.API/Controllers/DepartmentsController.cs`)
- Document API → Document management: delegates to (evidence: `Knova Hub/Knova_Hub/KnovaHub.API/Controllers/DocumentsController.cs`)
- AI query API → Question answering: dispatches query
- Document management → File storage: stores files
- Document management → Text extraction: extracts text
- Document management → Document discovery: supports discovery
- Staff user → AI query API: asks questions
- Question answering → Claude integration: requests answer (evidence: `Knova Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/QueryService.cs`)
- Claude integration → Anthropic Claude: calls API
- Question answering → Query history: records query (evidence: `Knova Hub/Knova_Hub/KnovaHub.ApplicationLayer/Services/QueryService.cs`)
- Query history → Application database: writes logs (evidence: `Knova Hub/Knova_Hub/KnovaHub.InfrastructureLayer/Repositories/QueryLogRepository.cs`)
- Knowledge organization → Staff user: organizes knowledge
- Proactive suggestions → Staff user: suggests resources
