# ossappscollective/oss-documentscanner architecture

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

- Interactive diagram: https://gitdiagram.com/ossappscollective/oss-documentscanner
- Repository: https://github.com/ossappscollective/oss-documentscanner

## Overview

The repository contains two NativeScript apps: OSS Document Scanner and OSS CardWallet. The main app entry starts document, OCR, security, network, and sync services, then selects a camera, card-list, or other UI entry point. The scanner’s broader workflow includes capture and image processing, document/OCR management, and PDF export; CardWallet has pass and barcode features. Sync supports local folders and remote providers. Source excerpts are limited, so uncertain links between UI components, processing, and services are omitted; documented provider and feature branches are shown at their existing paths.

Main entry points: [`app/app.ts`](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/app.ts) (App startup), [`app/services/sync/BasePDFSyncService.ts`](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/sync/BasePDFSyncService.ts) (PDF sync), [`app/services/sync/BaseDataSyncService.ts`](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/sync/BaseDataSyncService.ts) (Document sync), [`app/services/sync.ts`](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/sync.ts) (Sync service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App entry and UI"]
  node_entry["App startup<br/>[app.ts]"]
  node_camera["Camera UI<br/>[Camera.svelte]"]
  node_cardlist["Card list<br/>[CardsList.svelte]"]
  node_doclist["Document lists"]
  node_security["Passcode security<br/>[security.ts]"]
end

subgraph group_docs["Documents and scanning"]
  node_docservice["Document service<br/>[documents.ts]"]
  node_docmodel[("Document model<br/>[OCRDocument.ts]")]
  node_processor["Image processing<br/>[index.android.ts]"]
  node_ocr["OCR service<br/>[ocr.ts]"]
  node_ocrview["OCR results<br/>[OCRDataView.svelte]"]
  node_pdf["PDF export<br/>[PDFExporter.ts]"]
  node_pdfview["PDF preview<br/>[PDFPreview.svelte]"]
end

subgraph group_sync["Sync and storage"]
  node_sync["Sync service<br/>[sync.ts]"]
  node_data_sync["Document sync"]
  node_image_sync["Image sync"]
  node_pdf_sync["PDF sync"]
  node_gdrive["Google Drive"]
  node_onedrive["OneDrive"]
  node_webdav["WebDAV"]
  node_local["Local folders"]
  node_paperless["Paperless NGX"]
end

subgraph group_wallet["CardWallet features"]
  node_pkmodel[("Pass model<br/>[PKPass.ts]")]
  node_pkview["Pass display<br/>[PKPassView.svelte]"]
  node_barcode["Barcode tools"]
end

node_user(("User"))

node_user -->|"launches"| node_entry
node_entry -->|"selects camera"| node_camera
node_entry -->|"selects cards"| node_cardlist
node_entry -->|"selects documents"| node_doclist
node_entry -->|"starts"| node_docservice
node_entry -->|"starts"| node_ocr
node_entry -->|"starts"| node_sync
node_entry -->|"starts"| node_security
node_docservice -->|"uses"| node_docmodel
node_sync -->|"coordinates"| node_data_sync
node_data_sync -->|"reads and writes"| node_docmodel
node_data_sync -.->|"provider sync"| node_gdrive
node_data_sync -.->|"provider sync"| node_onedrive
node_data_sync -.->|"provider sync"| node_webdav
node_pdf_sync -.->|"local provider"| node_local
node_sync -->|"coordinates"| node_image_sync
node_sync -->|"coordinates"| node_pdf_sync
node_pdf_sync -.->|"provider sync"| node_gdrive
node_pdf_sync -.->|"provider sync"| node_onedrive
node_pdf_sync -.->|"provider sync"| node_webdav
node_pdf_sync -.->|"provider sync"| node_paperless
node_pkview -->|"displays"| node_pkmodel

click node_entry "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/app.ts"
click node_camera "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/components/camera/Camera.svelte"
click node_cardlist "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/components/list/CardsList.svelte"
click node_doclist "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/components/list/DocumentsList.svelte"
click node_docservice "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/documents.ts"
click node_docmodel "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/models/OCRDocument.ts"
click node_processor "https://github.com/ossappscollective/oss-documentscanner/blob/main/plugin-nativeprocessor/index.android.ts"
click node_ocr "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/ocr.ts"
click node_ocrview "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/components/ocr/OCRDataView.svelte"
click node_pdf "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/pdf/PDFExporter.ts"
click node_pdfview "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/components/pdf/PDFPreview.svelte"
click node_security "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/security.ts"
click node_sync "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/sync.ts"
click node_data_sync "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/sync/BaseDataSyncService.ts"
click node_image_sync "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/sync/BaseImageSyncService.ts"
click node_pdf_sync "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/sync/BasePDFSyncService.ts"
click node_gdrive "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/sync/gdrive/GoogleDriveDataSyncService.ts"
click node_onedrive "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/sync/onedrive/OneDriveDataSyncService.ts"
click node_webdav "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/sync/webdav/WebdavDataSyncService.ts"
click node_local "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/sync/local/LocalFolderPDFSyncService.ts"
click node_paperless "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/sync/paperless/PaperlessNgxPDFSyncService.ts"
click node_pkmodel "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/models/PKPass.ts"
click node_pkview "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/components/pkpass/PKPassView.svelte"
click node_barcode "https://github.com/ossappscollective/oss-documentscanner/blob/main/app/components/qrcode/CreateBarcode.svelte"

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_entry,node_camera,node_cardlist,node_doclist,node_security,node_user toneBlue
class node_docservice,node_docmodel,node_processor,node_ocr,node_ocrview,node_pdf,node_pdfview toneAmber
class node_sync,node_data_sync,node_image_sync,node_pdf_sync,node_gdrive,node_onedrive,node_webdav,node_local,node_paperless toneMint
class node_pkmodel,node_pkview,node_barcode toneRose
```

## Components

### App entry and UI

- [App startup](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/app.ts): `app/app.ts`
- [Camera UI](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/components/camera/Camera.svelte): `app/components/camera/Camera.svelte`
- [Card list](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/components/list/CardsList.svelte): `app/components/list/CardsList.svelte`
- [Document lists](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/components/list/DocumentsList.svelte): `app/components/list/DocumentsList.svelte`
- [Passcode security](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/security.ts): `app/services/security.ts`

### Documents and scanning

- [Document service](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/documents.ts): `app/services/documents.ts`
- [Document model](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/models/OCRDocument.ts): `app/models/OCRDocument.ts`
- [Image processing](https://github.com/ossappscollective/oss-documentscanner/blob/main/plugin-nativeprocessor/index.android.ts): `plugin-nativeprocessor/index.android.ts`
- [OCR service](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/ocr.ts): `app/services/ocr.ts`
- [OCR results](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/components/ocr/OCRDataView.svelte): `app/components/ocr/OCRDataView.svelte`
- [PDF export](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/pdf/PDFExporter.ts): `app/services/pdf/PDFExporter.ts`
- [PDF preview](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/components/pdf/PDFPreview.svelte): `app/components/pdf/PDFPreview.svelte`

### Sync and storage

- [Sync service](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/sync.ts): `app/services/sync.ts`
- [Document sync](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/sync/BaseDataSyncService.ts): `app/services/sync/BaseDataSyncService.ts`
- [Image sync](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/sync/BaseImageSyncService.ts): `app/services/sync/BaseImageSyncService.ts`
- [PDF sync](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/sync/BasePDFSyncService.ts): `app/services/sync/BasePDFSyncService.ts`
- [Google Drive](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/sync/gdrive/GoogleDriveDataSyncService.ts): `app/services/sync/gdrive/GoogleDriveDataSyncService.ts`
- [OneDrive](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/sync/onedrive/OneDriveDataSyncService.ts): `app/services/sync/onedrive/OneDriveDataSyncService.ts`
- [WebDAV](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/sync/webdav/WebdavDataSyncService.ts): `app/services/sync/webdav/WebdavDataSyncService.ts`
- [Local folders](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/sync/local/LocalFolderPDFSyncService.ts): `app/services/sync/local/LocalFolderPDFSyncService.ts`
- [Paperless NGX](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/services/sync/paperless/PaperlessNgxPDFSyncService.ts): `app/services/sync/paperless/PaperlessNgxPDFSyncService.ts`

### CardWallet features

- [Pass model](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/models/PKPass.ts): `app/models/PKPass.ts`
- [Pass display](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/components/pkpass/PKPassView.svelte): `app/components/pkpass/PKPassView.svelte`
- [Barcode tools](https://github.com/ossappscollective/oss-documentscanner/blob/main/app/components/qrcode/CreateBarcode.svelte): `app/components/qrcode/CreateBarcode.svelte`

### Other components

- **User**

## Connections

- User → App startup: launches
- App startup → Camera UI: selects camera
- App startup → Card list: selects cards
- App startup → Document lists: selects documents
- App startup → Document service: starts
- App startup → OCR service: starts
- App startup → Sync service: starts
- App startup → Passcode security: starts
- Document service → Document model: uses
- Sync service → Document sync: coordinates
- Document sync → Document model: reads and writes
- Document sync → Google Drive: provider sync
- Document sync → OneDrive: provider sync
- Document sync → WebDAV: provider sync
- PDF sync → Local folders: local provider
- Sync service → Image sync: coordinates
- Sync service → PDF sync: coordinates
- PDF sync → Google Drive: provider sync
- PDF sync → OneDrive: provider sync
- PDF sync → WebDAV: provider sync
- PDF sync → Paperless NGX: provider sync
- Pass display → Pass model: displays
