# tabrejcts/picquery architecture

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

- Interactive diagram: https://gitdiagram.com/tabrejcts/picquery
- Repository: https://github.com/tabrejcts/picquery
- Video tour (about a minute): https://gitdiagram.com/tabrejcts/picquery/video

## Overview

PicQuery is an offline, cross-platform image-search application. Its documented workflow is to index local folders or photo albums, then search the resulting on-device index with text or a similar image; text queries may be translated from Chinese to English, and searches may be folder-scoped. The supplied tree omits the Flutter/Dart application sources, so those domain stages have no supported implementation paths. The visible ONNX Runtime plugin provides native inference infrastructure; its sampled session and tensor managers are Windows/Linux implementations, not evidence of PicQuery’s full indexing pipeline.

Main entry points: [`packages/flutter_onnxruntime`](https://github.com/tabrejcts/picquery/tree/master/packages/flutter_onnxruntime) (Flutter ONNX plugin), [`packages/flutter_onnxruntime/windows/flutter_onnxruntime_plugin.cpp`](https://github.com/tabrejcts/picquery/blob/master/packages/flutter_onnxruntime/windows/flutter_onnxruntime_plugin.cpp) (Windows plugin bridge), [`packages/flutter_onnxruntime/linux/src/flutter_onnxruntime_plugin.cc`](https://github.com/tabrejcts/picquery/blob/master/packages/flutter_onnxruntime/linux/src/flutter_onnxruntime_plugin.cc) (Linux plugin bridge), [`packages/flutter_onnxruntime/windows/src/tensor_manager.cc`](https://github.com/tabrejcts/picquery/blob/master/packages/flutter_onnxruntime/windows/src/tensor_manager.cc) (Windows tensors)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["PicQuery workflow"]
  node_flutter_app["Flutter app"]
  node_sources["Folder or album sources"]
  node_indexing["Image indexing"]
  node_local_index[("On-device index")]
  node_query["Text or image query"]
  node_translation["Chinese translation"]
  node_search["Similarity search"]
  node_scoped_search["Folder-scoped search"]
  node_results["Search results"]
  node_updates["Incremental updates"]
  node_dark_mode["Dark mode"]
end

subgraph group_runtime["ONNX inference runtime"]
  node_onnx_plugin["Flutter ONNX plugin"]
  node_win_plugin["Windows plugin bridge"]
  node_win_sessions["Windows sessions<br/>[session_manager.cc]"]
  node_win_tensors["Windows tensors<br/>[tensor_manager.cc]"]
  node_linux_plugin["Linux plugin bridge"]
  node_linux_sessions["Linux sessions<br/>[session_manager.cc]"]
  node_linux_tensors["Linux tensors<br/>[tensor_manager.cc]"]
  node_mac_plugin["Apple plugin"]
  node_ios_plugin["iOS plugin"]
end

subgraph group_platform["Platform shells"]
  node_android_host["Android host<br/>[MainActivity.kt]"]
  node_linux_host["Linux host<br/>[my_application.cc]"]
  node_mac_host["macOS host"]
  node_windows_host["Windows host<br/>[main.cpp]"]
end

node_user(("App user"))

node_user -.->|"uses"| node_flutter_app
node_flutter_app -.->|"selects"| node_sources
node_sources -.->|"indexes"| node_indexing
node_indexing -.->|"writes"| node_local_index
node_user -.->|"submits"| node_query
node_query -->|"may translate"| node_translation
node_query -->|"searches"| node_search
node_search -.->|"searches"| node_local_index
node_search -->|"may scope"| node_scoped_search
node_search -.->|"returns"| node_results
node_indexing -->|"supports"| node_updates
node_flutter_app -->|"offers"| node_dark_mode
node_flutter_app -.->|"uses"| node_onnx_plugin
node_win_plugin -->|"delegates"| node_win_sessions
node_win_plugin -->|"delegates"| node_win_tensors
node_linux_plugin -.->|"delegates"| node_linux_sessions
node_linux_plugin -.->|"delegates"| node_linux_tensors
node_win_tensors -->|"uses declarations"| node_win_sessions
node_linux_tensors -->|"uses declarations"| node_linux_sessions
node_onnx_plugin -.->|"includes"| node_win_plugin
node_onnx_plugin -.->|"includes"| node_linux_plugin
node_onnx_plugin -.->|"includes"| node_mac_plugin
node_onnx_plugin -.->|"includes"| node_ios_plugin
node_android_host -.->|"hosts"| node_flutter_app
node_linux_host -.->|"hosts"| node_flutter_app
node_mac_host -.->|"hosts"| node_flutter_app
node_windows_host -.->|"launches"| node_flutter_app

click node_onnx_plugin "https://github.com/tabrejcts/picquery/tree/master/packages/flutter_onnxruntime"
click node_win_plugin "https://github.com/tabrejcts/picquery/blob/master/packages/flutter_onnxruntime/windows/flutter_onnxruntime_plugin.cpp"
click node_win_sessions "https://github.com/tabrejcts/picquery/blob/master/packages/flutter_onnxruntime/windows/src/session_manager.cc"
click node_win_tensors "https://github.com/tabrejcts/picquery/blob/master/packages/flutter_onnxruntime/windows/src/tensor_manager.cc"
click node_linux_plugin "https://github.com/tabrejcts/picquery/blob/master/packages/flutter_onnxruntime/linux/src/flutter_onnxruntime_plugin.cc"
click node_linux_sessions "https://github.com/tabrejcts/picquery/blob/master/packages/flutter_onnxruntime/linux/src/session_manager.cc"
click node_linux_tensors "https://github.com/tabrejcts/picquery/blob/master/packages/flutter_onnxruntime/linux/src/tensor_manager.cc"
click node_mac_plugin "https://github.com/tabrejcts/picquery/blob/master/packages/flutter_onnxruntime/macos/flutter_onnxruntime/Sources/flutter_onnxruntime/FlutterOnnxruntimePlugin.swift"
click node_ios_plugin "https://github.com/tabrejcts/picquery/blob/master/packages/flutter_onnxruntime/ios/flutter_onnxruntime/Sources/flutter_onnxruntime/FlutterOnnxruntimePlugin.swift"
click node_android_host "https://github.com/tabrejcts/picquery/blob/master/android/app/src/main/kotlin/me/grey/picquery/MainActivity.kt"
click node_linux_host "https://github.com/tabrejcts/picquery/blob/master/linux/runner/my_application.cc"
click node_mac_host "https://github.com/tabrejcts/picquery/blob/master/macos/Runner/MainFlutterWindow.swift"
click node_windows_host "https://github.com/tabrejcts/picquery/blob/master/windows/runner/main.cpp"

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_flutter_app,node_sources,node_indexing,node_local_index,node_query,node_translation,node_search,node_scoped_search,node_results,node_updates,node_dark_mode,node_user toneBlue
class node_onnx_plugin,node_win_plugin,node_win_sessions,node_win_tensors,node_linux_plugin,node_linux_sessions,node_linux_tensors,node_mac_plugin,node_ios_plugin toneAmber
class node_android_host,node_linux_host,node_mac_host,node_windows_host toneMint
```

## Components

### PicQuery workflow

- **Flutter app**
- **Folder or album sources**
- **Image indexing**
- **On-device index**
- **Text or image query**
- **Chinese translation**
- **Similarity search**
- **Folder-scoped search**
- **Search results**
- **Incremental updates**
- **Dark mode**

### ONNX inference runtime

- [Flutter ONNX plugin](https://github.com/tabrejcts/picquery/tree/master/packages/flutter_onnxruntime): `packages/flutter_onnxruntime`
- [Windows plugin bridge](https://github.com/tabrejcts/picquery/blob/master/packages/flutter_onnxruntime/windows/flutter_onnxruntime_plugin.cpp): `packages/flutter_onnxruntime/windows/flutter_onnxruntime_plugin.cpp`
- [Windows sessions](https://github.com/tabrejcts/picquery/blob/master/packages/flutter_onnxruntime/windows/src/session_manager.cc): `packages/flutter_onnxruntime/windows/src/session_manager.cc`
- [Windows tensors](https://github.com/tabrejcts/picquery/blob/master/packages/flutter_onnxruntime/windows/src/tensor_manager.cc): `packages/flutter_onnxruntime/windows/src/tensor_manager.cc`
- [Linux plugin bridge](https://github.com/tabrejcts/picquery/blob/master/packages/flutter_onnxruntime/linux/src/flutter_onnxruntime_plugin.cc): `packages/flutter_onnxruntime/linux/src/flutter_onnxruntime_plugin.cc`
- [Linux sessions](https://github.com/tabrejcts/picquery/blob/master/packages/flutter_onnxruntime/linux/src/session_manager.cc): `packages/flutter_onnxruntime/linux/src/session_manager.cc`
- [Linux tensors](https://github.com/tabrejcts/picquery/blob/master/packages/flutter_onnxruntime/linux/src/tensor_manager.cc): `packages/flutter_onnxruntime/linux/src/tensor_manager.cc`
- [Apple plugin](https://github.com/tabrejcts/picquery/blob/master/packages/flutter_onnxruntime/macos/flutter_onnxruntime/Sources/flutter_onnxruntime/FlutterOnnxruntimePlugin.swift): `packages/flutter_onnxruntime/macos/flutter_onnxruntime/Sources/flutter_onnxruntime/FlutterOnnxruntimePlugin.swift`
- [iOS plugin](https://github.com/tabrejcts/picquery/blob/master/packages/flutter_onnxruntime/ios/flutter_onnxruntime/Sources/flutter_onnxruntime/FlutterOnnxruntimePlugin.swift): `packages/flutter_onnxruntime/ios/flutter_onnxruntime/Sources/flutter_onnxruntime/FlutterOnnxruntimePlugin.swift`

### Platform shells

- [Android host](https://github.com/tabrejcts/picquery/blob/master/android/app/src/main/kotlin/me/grey/picquery/MainActivity.kt): `android/app/src/main/kotlin/me/grey/picquery/MainActivity.kt`
- [Linux host](https://github.com/tabrejcts/picquery/blob/master/linux/runner/my_application.cc): `linux/runner/my_application.cc`
- [macOS host](https://github.com/tabrejcts/picquery/blob/master/macos/Runner/MainFlutterWindow.swift): `macos/Runner/MainFlutterWindow.swift`
- [Windows host](https://github.com/tabrejcts/picquery/blob/master/windows/runner/main.cpp): `windows/runner/main.cpp`

### Other components

- **App user**

## Connections

- App user → Flutter app: uses
- Flutter app → Folder or album sources: selects
- Folder or album sources → Image indexing: indexes
- Image indexing → On-device index: writes
- App user → Text or image query: submits
- Text or image query → Chinese translation: may translate (evidence: `README.md`)
- Text or image query → Similarity search: searches (evidence: `README.md`)
- Similarity search → On-device index: searches
- Similarity search → Folder-scoped search: may scope (evidence: `README.md`)
- Similarity search → Search results: returns
- Image indexing → Incremental updates: supports (evidence: `README.md`)
- Flutter app → Dark mode: offers (evidence: `README.md`)
- Flutter app → Flutter ONNX plugin: uses
- Windows plugin bridge → Windows sessions: delegates (evidence: `packages/flutter_onnxruntime/windows/flutter_onnxruntime_plugin.cpp`)
- Windows plugin bridge → Windows tensors: delegates (evidence: `packages/flutter_onnxruntime/windows/flutter_onnxruntime_plugin.cpp`)
- Linux plugin bridge → Linux sessions: delegates
- Linux plugin bridge → Linux tensors: delegates
- Windows tensors → Windows sessions: uses declarations
- Linux tensors → Linux sessions: uses declarations (evidence: `packages/flutter_onnxruntime/linux/src/tensor_manager.cc`)
- Flutter ONNX plugin → Windows plugin bridge: includes (evidence: `packages/flutter_onnxruntime/windows/flutter_onnxruntime_plugin.cpp`)
- Flutter ONNX plugin → Linux plugin bridge: includes
- Flutter ONNX plugin → Apple plugin: includes
- Flutter ONNX plugin → iOS plugin: includes
- Android host → Flutter app: hosts
- Linux host → Flutter app: hosts
- macOS host → Flutter app: hosts
- Windows host → Flutter app: launches
