# gustavo-87/camscanner_app architecture

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

## Overview

CamScanner is a .NET MAUI document-scanning app. Users create or open a lot, capture or import document images, and manage them locally; they can view a document, run OCR, edit recognized text, and export documents or lots. SQLite stores lot and document records while images are stored on-device. The README documents capture, gallery import, document management, OCR, sharing, Excel and ZIP export. Several UI and storage details are unsampled, so links without direct excerpt evidence are omitted or marked unverified.

Main entry points: [`src/MainPage.xaml.cs`](https://github.com/gustavo-87/camscanner_app/blob/main/src/MainPage.xaml.cs) (Lot library), [`src/DetallePage.xaml.cs`](https://github.com/gustavo-87/camscanner_app/blob/main/src/DetallePage.xaml.cs) (Document detail), [`src/Services/ExcelExportService.cs`](https://github.com/gustavo-87/camscanner_app/blob/main/src/Services/ExcelExportService.cs) (Excel export), [`src/LotePage.xaml.cs`](https://github.com/gustavo-87/camscanner_app/blob/main/src/LotePage.xaml.cs) (Lot view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Scanning workflow"]
  node_main["Lot library<br/>[MainPage.xaml.cs]"]
  node_lotview["Lot view<br/>[LotePage.xaml.cs]"]
  node_lotcard["Lot card<br/>[LoteCard.cs]"]
  node_detail["Document detail"]
  node_textedit["Text editor<br/>[TextoPage.xaml.cs]"]
  node_databasepage["Data browser"]
end

subgraph group_persistence["Local persistence"]
  node_docmodel["Document record<br/>[Documento.cs]"]
  node_lotmodel["Lot record<br/>[Lote.cs]"]
  node_db[("SQLite database")]
  node_image["Image storage<br/>[AlmacenImagenes.cs]"]
end

subgraph group_processing["Text and export"]
  node_ocrinterface["OCR contract<br/>[IOcrService.cs]"]
  node_excel["Excel export"]
  node_zip["ZIP export"]
  node_files["File saving<br/>[ArchivoService.cs]"]
end

subgraph group_platform["Platform adapters"]
  node_androidocr["Android OCR<br/>[OcrService.cs]"]
  node_iosocr["iOS OCR<br/>[OcrService.cs]"]
end

node_user(("User"))
node_gallery["Device gallery"]
node_sharing["Device sharing"]

node_user -->|"uses"| node_main
node_main -.->|"opens"| node_lotview
node_main -.->|"opens"| node_detail
node_main -->|"renders"| node_lotcard
node_main -->|"imports images"| node_gallery
node_main -->|"manages records"| node_db
node_main -.->|"stores images"| node_image
node_main -->|"exports lots"| node_excel
node_main -->|"creates archive"| node_zip
node_main -->|"saves exports"| node_files
node_main -->|"shares exports"| node_sharing
node_lotview -->|"reorders documents"| node_db
node_lotview -->|"exports lot"| node_excel
node_lotview -->|"saves workbook"| node_files
node_lotview -->|"shares workbook"| node_sharing
node_databasepage -->|"queries and updates"| node_db
node_detail -->|"recognizes image"| node_ocrinterface
node_detail -->|"loads lot data"| node_db
node_detail -->|"opens editor"| node_textedit
node_detail -->|"exports document"| node_excel
node_detail -->|"saves workbook"| node_files
node_detail -->|"shares image"| node_sharing
node_androidocr -->|"implements"| node_ocrinterface
node_iosocr -->|"implements"| node_ocrinterface
node_zip -->|"embeds workbook"| node_excel
node_zip -->|"reads images"| node_image
node_excel -->|"exports fields"| node_docmodel
node_excel -->|"exports fields"| node_lotmodel

click node_main "https://github.com/gustavo-87/camscanner_app/blob/main/src/MainPage.xaml.cs"
click node_lotview "https://github.com/gustavo-87/camscanner_app/blob/main/src/LotePage.xaml.cs"
click node_lotcard "https://github.com/gustavo-87/camscanner_app/blob/main/src/LoteCard.cs"
click node_detail "https://github.com/gustavo-87/camscanner_app/blob/main/src/DetallePage.xaml.cs"
click node_textedit "https://github.com/gustavo-87/camscanner_app/blob/main/src/TextoPage.xaml.cs"
click node_databasepage "https://github.com/gustavo-87/camscanner_app/blob/main/src/DatabasePage.xaml.cs"
click node_docmodel "https://github.com/gustavo-87/camscanner_app/blob/main/src/Models/Documento.cs"
click node_lotmodel "https://github.com/gustavo-87/camscanner_app/blob/main/src/Models/Lote.cs"
click node_db "https://github.com/gustavo-87/camscanner_app/blob/main/src/Data/CamScannerDatabase.cs"
click node_image "https://github.com/gustavo-87/camscanner_app/blob/main/src/Services/AlmacenImagenes.cs"
click node_ocrinterface "https://github.com/gustavo-87/camscanner_app/blob/main/src/Services/IOcrService.cs"
click node_androidocr "https://github.com/gustavo-87/camscanner_app/blob/main/src/Platforms/Android/OcrService.cs"
click node_iosocr "https://github.com/gustavo-87/camscanner_app/blob/main/src/Platforms/iOS/OcrService.cs"
click node_excel "https://github.com/gustavo-87/camscanner_app/blob/main/src/Services/ExcelExportService.cs"
click node_zip "https://github.com/gustavo-87/camscanner_app/blob/main/src/Services/ZipExportService.cs"
click node_files "https://github.com/gustavo-87/camscanner_app/blob/main/src/Services/ArchivoService.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_main,node_lotview,node_lotcard,node_detail,node_textedit,node_databasepage,node_user toneBlue
class node_docmodel,node_lotmodel,node_db,node_image toneAmber
class node_ocrinterface,node_excel,node_zip,node_files toneMint
class node_androidocr,node_iosocr toneRose
class node_gallery,node_sharing toneIndigo
```

## Components

### Scanning workflow

- [Lot library](https://github.com/gustavo-87/camscanner_app/blob/main/src/MainPage.xaml.cs): `src/MainPage.xaml.cs`
- [Lot view](https://github.com/gustavo-87/camscanner_app/blob/main/src/LotePage.xaml.cs): `src/LotePage.xaml.cs`
- [Lot card](https://github.com/gustavo-87/camscanner_app/blob/main/src/LoteCard.cs): `src/LoteCard.cs`
- [Document detail](https://github.com/gustavo-87/camscanner_app/blob/main/src/DetallePage.xaml.cs): `src/DetallePage.xaml.cs`
- [Text editor](https://github.com/gustavo-87/camscanner_app/blob/main/src/TextoPage.xaml.cs): `src/TextoPage.xaml.cs`
- [Data browser](https://github.com/gustavo-87/camscanner_app/blob/main/src/DatabasePage.xaml.cs): `src/DatabasePage.xaml.cs`

### Local persistence

- [Document record](https://github.com/gustavo-87/camscanner_app/blob/main/src/Models/Documento.cs): `src/Models/Documento.cs`
- [Lot record](https://github.com/gustavo-87/camscanner_app/blob/main/src/Models/Lote.cs): `src/Models/Lote.cs`
- [SQLite database](https://github.com/gustavo-87/camscanner_app/blob/main/src/Data/CamScannerDatabase.cs): `src/Data/CamScannerDatabase.cs`
- [Image storage](https://github.com/gustavo-87/camscanner_app/blob/main/src/Services/AlmacenImagenes.cs): `src/Services/AlmacenImagenes.cs`

### Text and export

- [OCR contract](https://github.com/gustavo-87/camscanner_app/blob/main/src/Services/IOcrService.cs): `src/Services/IOcrService.cs`
- [Excel export](https://github.com/gustavo-87/camscanner_app/blob/main/src/Services/ExcelExportService.cs): `src/Services/ExcelExportService.cs`
- [ZIP export](https://github.com/gustavo-87/camscanner_app/blob/main/src/Services/ZipExportService.cs): `src/Services/ZipExportService.cs`
- [File saving](https://github.com/gustavo-87/camscanner_app/blob/main/src/Services/ArchivoService.cs): `src/Services/ArchivoService.cs`

### Platform adapters

- [Android OCR](https://github.com/gustavo-87/camscanner_app/blob/main/src/Platforms/Android/OcrService.cs): `src/Platforms/Android/OcrService.cs`
- [iOS OCR](https://github.com/gustavo-87/camscanner_app/blob/main/src/Platforms/iOS/OcrService.cs): `src/Platforms/iOS/OcrService.cs`

### Other components

- **User**
- **Device gallery**
- **Device sharing**

## Connections

- User → Lot library: uses (evidence: `README.md`)
- Lot library → Lot view: opens (evidence: `README.md`)
- Lot library → Document detail: opens (evidence: `README.md`)
- Lot library → Lot card: renders (evidence: `src/MainPage.xaml.cs`)
- Lot library → Device gallery: imports images (evidence: `src/MainPage.xaml.cs`)
- Lot library → SQLite database: manages records (evidence: `src/MainPage.xaml.cs`)
- Lot library → Image storage: stores images
- Lot library → Excel export: exports lots (evidence: `src/MainPage.xaml.cs`)
- Lot library → ZIP export: creates archive (evidence: `src/MainPage.xaml.cs`)
- Lot library → File saving: saves exports (evidence: `src/MainPage.xaml.cs`)
- Lot library → Device sharing: shares exports (evidence: `src/MainPage.xaml.cs`)
- Lot view → SQLite database: reorders documents (evidence: `src/LotePage.xaml.cs`)
- Lot view → Excel export: exports lot (evidence: `src/LotePage.xaml.cs`)
- Lot view → File saving: saves workbook (evidence: `src/LotePage.xaml.cs`)
- Lot view → Device sharing: shares workbook (evidence: `src/LotePage.xaml.cs`)
- Data browser → SQLite database: queries and updates (evidence: `src/DatabasePage.xaml.cs`)
- Document detail → OCR contract: recognizes image (evidence: `src/DetallePage.xaml.cs`)
- Document detail → SQLite database: loads lot data (evidence: `src/DetallePage.xaml.cs`)
- Document detail → Text editor: opens editor (evidence: `src/DetallePage.xaml.cs`)
- Document detail → Excel export: exports document (evidence: `src/DetallePage.xaml.cs`)
- Document detail → File saving: saves workbook (evidence: `src/DetallePage.xaml.cs`)
- Document detail → Device sharing: shares image (evidence: `src/DetallePage.xaml.cs`)
- Android OCR → OCR contract: implements (evidence: `src/Platforms/Android/OcrService.cs`)
- iOS OCR → OCR contract: implements (evidence: `src/Platforms/iOS/OcrService.cs`)
- ZIP export → Excel export: embeds workbook (evidence: `src/Services/ZipExportService.cs`)
- ZIP export → Image storage: reads images (evidence: `src/Services/ZipExportService.cs`)
- Excel export → Document record: exports fields (evidence: `src/Services/ExcelExportService.cs`)
- Excel export → Lot record: exports fields (evidence: `src/Services/ExcelExportService.cs`)
