# patelakshar/landt architecture

> Architecture diagram of the GitHub repository patelakshar/landt, 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/patelakshar/landt
- Repository: https://github.com/patelakshar/landt

## Overview

PdfSolverMvc is a local ASP.NET Core MVC application for uploading PDFs, extracting and aligning page content, storing results, and viewing or exporting them. The principal workflow runs from a user upload through the PDF controller and extraction service, which handles selectable text and scanned-page OCR, then persists document metadata and page results in SQLite. The README also documents CSV and original-PDF downloads. Source excerpts establish controller storage operations and extraction internals; some controller-to-extractor and optional AI wiring is not shown, so those links are marked unverified or omitted.

Main entry points: [`PdfSolverMvc/Controllers/PdfController.cs`](https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Controllers/PdfController.cs) (PDF controller), [`PdfSolverMvc/Services/PdfExtractionService.cs`](https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Services/PdfExtractionService.cs) (PDF extraction), [`PdfSolverMvc/Models/PdfDocumentRecord.cs`](https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Models/PdfDocumentRecord.cs) (Page results), [`PdfSolverMvc/Services/OcrService.cs`](https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Services/OcrService.cs) (OCR processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_controller["PDF controller<br/>[PdfController.cs]"]
  node_uploadview["Upload view<br/>[Upload.cshtml]"]
  node_indexview["Document list<br/>[Index.cshtml]"]
  node_detailsview["Document details<br/>[Details.cshtml]"]
  node_viewmodels["View models<br/>[PdfViewModels.cs]"]
end

subgraph group_extract["PDF extraction"]
  node_extractor["PDF extraction"]
  node_ocr["OCR processing<br/>[OcrService.cs]"]
  node_ocrinterface["OCR interface<br/>[IOcrService.cs]"]
  node_extractioninterface["Extraction interface"]
end

subgraph group_data["Document data"]
  node_pagecontent["Page results"]
  node_record["Document record"]
  node_dbcontext["EF database context<br/>[AppDbContext.cs]"]
  node_sqlite[("SQLite database")]
  node_files[("Uploaded PDFs")]
end

subgraph group_integrations["Optional integrations"]
  node_gemini["Gemini integration<br/>[GeminiService.cs]"]
  node_geminiinterface["Gemini interface<br/>[IGeminiService.cs]"]
end

node_user(("User"))

node_user -->|"uploads PDF"| node_controller
node_controller -->|"renders"| node_uploadview
node_controller -->|"stores files"| node_files
node_controller -->|"reads and writes"| node_dbcontext
node_dbcontext -->|"uses"| node_sqlite
node_controller -.->|"requests extraction"| node_extractor
node_extractor -.->|"uses OCR"| node_ocr
node_extractor -->|"builds pages"| node_pagecontent
node_controller -->|"creates records"| node_record
node_record -->|"serializes pages"| node_pagecontent
node_controller -->|"prepares views"| node_viewmodels
node_controller -.->|"renders list"| node_indexview
node_controller -.->|"renders details"| node_detailsview
node_controller -.->|"downloads original"| node_files
node_controller -->|"exports CSV"| node_pagecontent
node_extractor -->|"depends on"| node_ocrinterface
node_ocr -->|"implements"| node_ocrinterface
node_extractor -->|"implements"| node_extractioninterface
node_gemini -->|"implements"| node_geminiinterface
node_extractor -.->|"may use"| node_gemini

click node_controller "https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Controllers/PdfController.cs"
click node_uploadview "https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Views/Pdf/Upload.cshtml"
click node_indexview "https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Views/Pdf/Index.cshtml"
click node_detailsview "https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Views/Pdf/Details.cshtml"
click node_viewmodels "https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Models/ViewModels/PdfViewModels.cs"
click node_extractor "https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Services/PdfExtractionService.cs"
click node_ocr "https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Services/OcrService.cs"
click node_pagecontent "https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Models/PdfDocumentRecord.cs"
click node_record "https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Models/PdfDocumentRecord.cs"
click node_dbcontext "https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Data/AppDbContext.cs"
click node_gemini "https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Services/GeminiService.cs"
click node_geminiinterface "https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Services/IGeminiService.cs"
click node_ocrinterface "https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Services/IOcrService.cs"
click node_extractioninterface "https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Services/IPdfExtractionService.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_controller,node_uploadview,node_indexview,node_detailsview,node_viewmodels,node_user toneBlue
class node_extractor,node_ocr,node_ocrinterface,node_extractioninterface toneAmber
class node_pagecontent,node_record,node_dbcontext,node_sqlite,node_files toneMint
class node_gemini,node_geminiinterface toneRose
```

## Components

### Web application

- [PDF controller](https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Controllers/PdfController.cs): `PdfSolverMvc/Controllers/PdfController.cs`
- [Upload view](https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Views/Pdf/Upload.cshtml): `PdfSolverMvc/Views/Pdf/Upload.cshtml`
- [Document list](https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Views/Pdf/Index.cshtml): `PdfSolverMvc/Views/Pdf/Index.cshtml`
- [Document details](https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Views/Pdf/Details.cshtml): `PdfSolverMvc/Views/Pdf/Details.cshtml`
- [View models](https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Models/ViewModels/PdfViewModels.cs): `PdfSolverMvc/Models/ViewModels/PdfViewModels.cs`

### PDF extraction

- [PDF extraction](https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Services/PdfExtractionService.cs): `PdfSolverMvc/Services/PdfExtractionService.cs`
- [OCR processing](https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Services/OcrService.cs): `PdfSolverMvc/Services/OcrService.cs`
- [OCR interface](https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Services/IOcrService.cs): `PdfSolverMvc/Services/IOcrService.cs`
- [Extraction interface](https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Services/IPdfExtractionService.cs): `PdfSolverMvc/Services/IPdfExtractionService.cs`

### Document data

- [Page results](https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Models/PdfDocumentRecord.cs): `PdfSolverMvc/Models/PdfDocumentRecord.cs`
- [Document record](https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Models/PdfDocumentRecord.cs): `PdfSolverMvc/Models/PdfDocumentRecord.cs`
- [EF database context](https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Data/AppDbContext.cs): `PdfSolverMvc/Data/AppDbContext.cs`
- **SQLite database**
- **Uploaded PDFs**

### Optional integrations

- [Gemini integration](https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Services/GeminiService.cs): `PdfSolverMvc/Services/GeminiService.cs`
- [Gemini interface](https://github.com/patelakshar/landt/blob/main/PdfSolverMvc/Services/IGeminiService.cs): `PdfSolverMvc/Services/IGeminiService.cs`

### Other components

- **User**

## Connections

- User → PDF controller: uploads PDF
- PDF controller → Upload view: renders (evidence: `PdfSolverMvc/Controllers/PdfController.cs`)
- PDF controller → Uploaded PDFs: stores files (evidence: `PdfSolverMvc/Controllers/PdfController.cs`)
- PDF controller → EF database context: reads and writes (evidence: `PdfSolverMvc/Controllers/PdfController.cs`)
- EF database context → SQLite database: uses
- PDF controller → PDF extraction: requests extraction
- PDF extraction → OCR processing: uses OCR
- PDF extraction → Page results: builds pages (evidence: `PdfSolverMvc/Services/PdfExtractionService.cs`)
- PDF controller → Document record: creates records (evidence: `PdfSolverMvc/Controllers/PdfController.cs`)
- Document record → Page results: serializes pages (evidence: `PdfSolverMvc/Models/PdfDocumentRecord.cs`)
- PDF controller → View models: prepares views (evidence: `PdfSolverMvc/Controllers/PdfController.cs`)
- PDF controller → Document list: renders list
- PDF controller → Document details: renders details
- PDF controller → Uploaded PDFs: downloads original (evidence: `README.md`)
- PDF controller → Page results: exports CSV (evidence: `PdfSolverMvc/Controllers/PdfController.cs`)
- PDF extraction → OCR interface: depends on (evidence: `PdfSolverMvc/Services/PdfExtractionService.cs`)
- OCR processing → OCR interface: implements (evidence: `PdfSolverMvc/Services/OcrService.cs`)
- PDF extraction → Extraction interface: implements (evidence: `PdfSolverMvc/Services/PdfExtractionService.cs`)
- Gemini integration → Gemini interface: implements (evidence: `PdfSolverMvc/Services/GeminiService.cs`)
- PDF extraction → Gemini integration: may use
