# tamimdiu-232/nexora. architecture

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

- Interactive diagram: https://gitdiagram.com/tamimdiu-232/nexora.
- Repository: https://github.com/tamimdiu-232/nexora.

## Overview

Nexora is a two-plane document intelligence platform: organization users upload and process scoped documents, then search or ask grounded questions and send answers for human review; platform administrators manage system health and security without document-content access. Laravel handles the web workflow and calls the FastAPI service for AI operations. The README documents OCR, bilingual extraction, metadata, summaries, and conflict detection; some of those implementation paths were not sampled, so those links are shown only where evidence supports them.

Main entry points: [`ai-service/app/main.py`](https://github.com/tamimdiu-232/nexora./blob/main/ai-service/app/main.py) (AI API), [`laravel-app/routes/web.php`](https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/routes/web.php) (Web routing), [`laravel-app/app/Services/AiClient.php`](https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Services/AiClient.php) (AI client), [`laravel-app/app/Http/Controllers/DocumentsController.php`](https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Http/Controllers/DocumentsController.php) (Document workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Organization Workspace"]
  node_web_routes["Web routing<br/>[web.php]"]
  node_documents["Document workflow"]
  node_processor["Document processor"]
  node_doc_store[("Document records<br/>[Document.php]")]
end

subgraph group_platform["Platform Operations"]
  node_audit["Audit logging<br/>[AuditLogger.php]"]
  node_platform_ops["Platform operations"]
end

subgraph group_ai["AI Processing"]
  node_ai_client["AI client<br/>[AiClient.php]"]
  node_ai_api["AI API<br/>[main.py]"]
  node_ocr["OCR extraction<br/>[ocr.py]"]
  node_classification["Classification<br/>[classify.py]"]
  node_metadata["Metadata extraction<br/>[info.py]"]
  node_chunking["Page chunking<br/>[chunking.py]"]
end

subgraph group_retrieval["Search and Answers"]
  node_semantic_index[("Vector index<br/>[vector_store.py]")]
  node_search["Semantic search"]
  node_qa_controller["Chat workflow<br/>[ChatController.php]"]
  node_rag["Grounded QA<br/>[rag.py]"]
  node_llm["LLM provider<br/>[llm.py]"]
  node_summaries["Document summaries<br/>[summarize.py]"]
  node_related_docs["Related documents"]
end

subgraph group_review["Human Verification"]
  node_review_flow["Review workflow"]
end

node_org_user(("Organization user"))
node_super_admin(("Super Admin"))

node_org_user -->|"uses workspace"| node_web_routes
node_super_admin -->|"uses platform"| node_web_routes
node_web_routes -->|"routes requests"| node_documents
node_web_routes -->|"routes requests"| node_search
node_web_routes -->|"routes requests"| node_qa_controller
node_web_routes -->|"routes requests"| node_review_flow
node_web_routes -->|"routes requests"| node_platform_ops
node_documents -->|"dispatches processing"| node_processor
node_documents -->|"creates records"| node_doc_store
node_documents -->|"requests AI processing"| node_ai_client
node_processor -.->|"delegates AI calls"| node_ai_client
node_ai_client -->|"calls endpoints"| node_ai_api
node_ai_api -->|"uses OCR"| node_ocr
node_ai_api -->|"classifies documents"| node_classification
node_ai_api -->|"extracts metadata"| node_metadata
node_ai_api -->|"chunks pages"| node_chunking
node_ai_api -->|"indexes documents"| node_semantic_index
node_search -.->|"requests search"| node_ai_client
node_ai_api -->|"searches scope"| node_semantic_index
node_qa_controller -->|"requests answers"| node_ai_client
node_ai_api -->|"generates answers"| node_llm
node_llm -->|"falls back to"| node_rag
node_rag -->|"retrieves chunks"| node_semantic_index
node_ai_client -->|"requests summaries"| node_summaries
node_org_user -->|"submits answers"| node_review_flow
node_review_flow -->|"records decisions"| node_audit
node_super_admin -->|"manages operations"| node_platform_ops
node_platform_ops -->|"checks service health"| node_ai_client
node_platform_ops -->|"records actions"| node_audit

click node_web_routes "https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/routes/web.php"
click node_documents "https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Http/Controllers/DocumentsController.php"
click node_processor "https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Services/DocumentProcessor.php"
click node_doc_store "https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Models/Document.php"
click node_ai_client "https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Services/AiClient.php"
click node_ai_api "https://github.com/tamimdiu-232/nexora./blob/main/ai-service/app/main.py"
click node_ocr "https://github.com/tamimdiu-232/nexora./blob/main/ai-service/app/ocr.py"
click node_classification "https://github.com/tamimdiu-232/nexora./blob/main/ai-service/app/classify.py"
click node_metadata "https://github.com/tamimdiu-232/nexora./blob/main/ai-service/app/info.py"
click node_chunking "https://github.com/tamimdiu-232/nexora./blob/main/ai-service/app/chunking.py"
click node_semantic_index "https://github.com/tamimdiu-232/nexora./blob/main/ai-service/app/vector_store.py"
click node_search "https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Http/Controllers/SearchController.php"
click node_qa_controller "https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Http/Controllers/ChatController.php"
click node_rag "https://github.com/tamimdiu-232/nexora./blob/main/ai-service/app/rag.py"
click node_llm "https://github.com/tamimdiu-232/nexora./blob/main/ai-service/app/llm.py"
click node_summaries "https://github.com/tamimdiu-232/nexora./blob/main/ai-service/app/summarize.py"
click node_related_docs "https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Http/Controllers/RelatedDocumentsController.php"
click node_review_flow "https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Http/Controllers/ReviewController.php"
click node_audit "https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Services/AuditLogger.php"
click node_platform_ops "https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Http/Controllers/PlatformOperationsController.php"

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_routes,node_documents,node_processor,node_doc_store,node_org_user toneBlue
class node_audit,node_platform_ops toneAmber
class node_ai_client,node_ai_api,node_ocr,node_classification,node_metadata,node_chunking toneMint
class node_semantic_index,node_search,node_qa_controller,node_rag,node_llm,node_summaries,node_related_docs toneRose
class node_review_flow,node_super_admin toneIndigo
```

## Components

### Organization Workspace

- [Web routing](https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/routes/web.php): `laravel-app/routes/web.php`
- [Document workflow](https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Http/Controllers/DocumentsController.php): `laravel-app/app/Http/Controllers/DocumentsController.php`
- [Document processor](https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Services/DocumentProcessor.php): `laravel-app/app/Services/DocumentProcessor.php`
- [Document records](https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Models/Document.php): `laravel-app/app/Models/Document.php`

### Platform Operations

- [Audit logging](https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Services/AuditLogger.php): `laravel-app/app/Services/AuditLogger.php`
- [Platform operations](https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Http/Controllers/PlatformOperationsController.php): `laravel-app/app/Http/Controllers/PlatformOperationsController.php`

### AI Processing

- [AI client](https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Services/AiClient.php): `laravel-app/app/Services/AiClient.php`
- [AI API](https://github.com/tamimdiu-232/nexora./blob/main/ai-service/app/main.py): `ai-service/app/main.py`
- [OCR extraction](https://github.com/tamimdiu-232/nexora./blob/main/ai-service/app/ocr.py): `ai-service/app/ocr.py`
- [Classification](https://github.com/tamimdiu-232/nexora./blob/main/ai-service/app/classify.py): `ai-service/app/classify.py`
- [Metadata extraction](https://github.com/tamimdiu-232/nexora./blob/main/ai-service/app/info.py): `ai-service/app/info.py`
- [Page chunking](https://github.com/tamimdiu-232/nexora./blob/main/ai-service/app/chunking.py): `ai-service/app/chunking.py`

### Search and Answers

- [Vector index](https://github.com/tamimdiu-232/nexora./blob/main/ai-service/app/vector_store.py): `ai-service/app/vector_store.py`
- [Semantic search](https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Http/Controllers/SearchController.php): `laravel-app/app/Http/Controllers/SearchController.php`
- [Chat workflow](https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Http/Controllers/ChatController.php): `laravel-app/app/Http/Controllers/ChatController.php`
- [Grounded QA](https://github.com/tamimdiu-232/nexora./blob/main/ai-service/app/rag.py): `ai-service/app/rag.py`
- [LLM provider](https://github.com/tamimdiu-232/nexora./blob/main/ai-service/app/llm.py): `ai-service/app/llm.py`
- [Document summaries](https://github.com/tamimdiu-232/nexora./blob/main/ai-service/app/summarize.py): `ai-service/app/summarize.py`
- [Related documents](https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Http/Controllers/RelatedDocumentsController.php): `laravel-app/app/Http/Controllers/RelatedDocumentsController.php`

### Human Verification

- [Review workflow](https://github.com/tamimdiu-232/nexora./blob/main/laravel-app/app/Http/Controllers/ReviewController.php): `laravel-app/app/Http/Controllers/ReviewController.php`

### Other components

- **Organization user**
- **Super Admin**

## Connections

- Organization user → Web routing: uses workspace (evidence: `README.md`)
- Super Admin → Web routing: uses platform (evidence: `README.md`)
- Web routing → Document workflow: routes requests (evidence: `laravel-app/routes/web.php`)
- Web routing → Semantic search: routes requests (evidence: `laravel-app/routes/web.php`)
- Web routing → Chat workflow: routes requests (evidence: `laravel-app/routes/web.php`)
- Web routing → Review workflow: routes requests (evidence: `laravel-app/routes/web.php`)
- Web routing → Platform operations: routes requests (evidence: `laravel-app/routes/web.php`)
- Document workflow → Document processor: dispatches processing (evidence: `laravel-app/app/Http/Controllers/DocumentsController.php`)
- Document workflow → Document records: creates records (evidence: `laravel-app/app/Http/Controllers/DocumentsController.php`)
- Document workflow → AI client: requests AI processing (evidence: `laravel-app/app/Http/Controllers/DocumentsController.php`)
- Document processor → AI client: delegates AI calls
- AI client → AI API: calls endpoints (evidence: `laravel-app/app/Services/AiClient.php`)
- AI API → OCR extraction: uses OCR (evidence: `ai-service/app/main.py`)
- AI API → Classification: classifies documents (evidence: `ai-service/app/main.py`)
- AI API → Metadata extraction: extracts metadata (evidence: `ai-service/app/main.py`)
- AI API → Page chunking: chunks pages (evidence: `ai-service/app/main.py`)
- AI API → Vector index: indexes documents (evidence: `ai-service/app/main.py`)
- Semantic search → AI client: requests search
- AI API → Vector index: searches scope (evidence: `ai-service/app/main.py`)
- Chat workflow → AI client: requests answers (evidence: `laravel-app/app/Http/Controllers/ChatController.php`)
- AI API → LLM provider: generates answers (evidence: `ai-service/app/main.py`)
- LLM provider → Grounded QA: falls back to (evidence: `ai-service/app/llm.py`)
- Grounded QA → Vector index: retrieves chunks (evidence: `ai-service/app/rag.py`)
- AI client → Document summaries: requests summaries (evidence: `laravel-app/app/Services/AiClient.php`)
- Organization user → Review workflow: submits answers (evidence: `laravel-app/app/Http/Controllers/ReviewController.php`)
- Review workflow → Audit logging: records decisions (evidence: `laravel-app/app/Http/Controllers/ReviewController.php`)
- Super Admin → Platform operations: manages operations (evidence: `README.md`)
- Platform operations → AI client: checks service health (evidence: `laravel-app/app/Http/Controllers/PlatformOperationsController.php`)
- Platform operations → Audit logging: records actions (evidence: `laravel-app/app/Http/Controllers/PlatformOperationsController.php`)
