# iabhnv19/lazzygallery architecture

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

- Interactive diagram: https://gitdiagram.com/iabhnv19/lazzygallery
- Repository: https://github.com/iabhnv19/lazzygallery

## Overview

Lazzy Gallery is an offline-first Android photo and video manager. The main flow is launch and navigate to a library view, load local media through the view model and repository, then browse, search, or manage items in dedicated screens. Albums, favorites, trash, full-screen viewing, OCR search, duplicate scanning, and customization are distinct product capabilities. Source excerpts establish several central calls; other feature links are included only where the README documents them, so unsampled implementation details remain uncertain.

Main entry points: [`app/src/main/java/com/lazzy/gallery/ui/viewmodel/MediaViewModel.kt`](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/viewmodel/MediaViewModel.kt) (Media view model), [`app/src/main/java/com/lazzy/gallery/ui/navigation/GalleryNavigation.kt`](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/navigation/GalleryNavigation.kt) (Screen navigation), [`app/src/main/java/com/lazzy/gallery/data/MediaRepository.kt`](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/data/MediaRepository.kt) (Media repository), [`app/src/main/java/com/lazzy/gallery/data/RustBridge.kt`](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/data/RustBridge.kt) (Rust JNI bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App navigation"]
  node_activity["Main activity<br/>[MainActivity.kt]"]
  node_navigation["Screen navigation"]
  node_nav_bar["Floating navigation"]
  node_theme["Theme and accents<br/>[Theme.kt]"]
end

subgraph group_views["Gallery screens"]
  node_recent["Recent timeline"]
  node_albums["Albums<br/>[AlbumsScreen.kt]"]
  node_album_detail["Album detail"]
  node_favorites["Favorites<br/>[FavoritesScreen.kt]"]
  node_search["Text search<br/>[SearchScreen.kt]"]
  node_trash["Recycle bin"]
  node_detail["Full-screen viewer"]
  node_settings["Settings<br/>[SettingsScreen.kt]"]
  node_media_components["Media display components<br/>[MediaComponents.kt]"]
  node_video_player["Video player<br/>[VideoPlayerView.kt]"]
end

subgraph group_media["Media services"]
  node_viewmodel["Media view model<br/>[MediaViewModel.kt]"]
  node_repository["Media repository<br/>[MediaRepository.kt]"]
  node_model["Media model<br/>[MediaModel.kt]"]
  node_thumbnail_fetcher["Thumbnail fetcher"]
  node_sync_worker["Media sync worker<br/>[MediaSyncWorker.kt]"]
end

subgraph group_storage["Local storage"]
  node_database[("Room database<br/>[GalleryDatabase.kt]")]
  node_dao["Media DAO<br/>[MediaDao.kt]"]
  node_entity["Media index entity<br/>[MediaEntity.kt]"]
  node_mediastore[("Android MediaStore")]
end

subgraph group_native["Native processing"]
  node_bridge["Rust JNI bridge<br/>[RustBridge.kt]"]
  node_rust["Rust media engine<br/>[lib.rs]"]
  node_mlkit["ML Kit OCR"]
end

node_user(("Gallery user"))

node_user -->|"opens app"| node_activity
node_activity -->|"shows routes"| node_navigation
node_activity -->|"provides state"| node_viewmodel
node_navigation -->|"routes to"| node_recent
node_navigation -->|"routes to"| node_albums
node_navigation -->|"routes to"| node_album_detail
node_navigation -->|"routes to"| node_favorites
node_navigation -->|"routes to"| node_search
node_navigation -->|"routes to"| node_trash
node_navigation -->|"routes to"| node_detail
node_navigation -->|"routes to"| node_settings
node_viewmodel -->|"requests media"| node_repository
node_repository -->|"opens database"| node_database
node_repository -->|"queries media"| node_mediastore
node_database -->|"exposes access"| node_dao
node_dao -->|"stores records"| node_entity
node_entity -->|"maps to"| node_model
node_repository -->|"produces media"| node_model
node_viewmodel -->|"exposes state"| node_model
node_sync_worker -->|"requests sync"| node_repository
node_thumbnail_fetcher -->|"calls native decode"| node_bridge
node_repository -->|"uses native core"| node_bridge
node_bridge -->|"invokes JNI"| node_rust
node_detail -->|"renders video"| node_video_player
node_detail -->|"requests metadata"| node_viewmodel
node_recent -->|"reads media"| node_viewmodel
node_albums -->|"reads albums"| node_viewmodel
node_album_detail -->|"reads album"| node_viewmodel
node_favorites -->|"reads favorites"| node_viewmodel
node_search -->|"searches media"| node_viewmodel
node_trash -->|"manages trash"| node_viewmodel
node_settings -->|"updates preferences"| node_viewmodel
node_viewmodel -.->|"preprocesses OCR"| node_bridge
node_bridge -.->|"provides OCR input"| node_mlkit
node_recent -.->|"renders thumbnails"| node_media_components
node_theme -->|"styles navigation"| node_nav_bar

click node_activity "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/MainActivity.kt"
click node_navigation "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/navigation/GalleryNavigation.kt"
click node_nav_bar "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/components/FloatingNavigationBar.kt"
click node_theme "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/theme/Theme.kt"
click node_viewmodel "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/viewmodel/MediaViewModel.kt"
click node_recent "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/screens/RecentPhotosScreen.kt"
click node_albums "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/screens/AlbumsScreen.kt"
click node_album_detail "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/screens/AlbumDetailScreen.kt"
click node_favorites "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/screens/FavoritesScreen.kt"
click node_search "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/screens/SearchScreen.kt"
click node_trash "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/screens/RecycleBinScreen.kt"
click node_detail "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/screens/PhotoDetailScreen.kt"
click node_settings "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/screens/SettingsScreen.kt"
click node_media_components "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/components/MediaComponents.kt"
click node_video_player "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/components/VideoPlayerView.kt"
click node_repository "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/data/MediaRepository.kt"
click node_model "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/data/MediaModel.kt"
click node_thumbnail_fetcher "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/data/MediaStoreThumbnailFetcher.kt"
click node_sync_worker "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/data/worker/MediaSyncWorker.kt"
click node_database "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/data/local/GalleryDatabase.kt"
click node_dao "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/data/local/MediaDao.kt"
click node_entity "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/data/local/MediaEntity.kt"
click node_bridge "https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/data/RustBridge.kt"
click node_rust "https://github.com/iabhnv19/lazzygallery/blob/main/rust_core/src/lib.rs"

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_activity,node_navigation,node_nav_bar,node_theme,node_user toneBlue
class node_recent,node_albums,node_album_detail,node_favorites,node_search,node_trash,node_detail,node_settings,node_media_components,node_video_player toneAmber
class node_viewmodel,node_repository,node_model,node_thumbnail_fetcher,node_sync_worker toneMint
class node_database,node_dao,node_entity,node_mediastore toneRose
class node_bridge,node_rust,node_mlkit toneIndigo
```

## Components

### App navigation

- [Main activity](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/MainActivity.kt): `app/src/main/java/com/lazzy/gallery/MainActivity.kt`
- [Screen navigation](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/navigation/GalleryNavigation.kt): `app/src/main/java/com/lazzy/gallery/ui/navigation/GalleryNavigation.kt`
- [Floating navigation](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/components/FloatingNavigationBar.kt): `app/src/main/java/com/lazzy/gallery/ui/components/FloatingNavigationBar.kt`
- [Theme and accents](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/theme/Theme.kt): `app/src/main/java/com/lazzy/gallery/ui/theme/Theme.kt`

### Gallery screens

- [Recent timeline](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/screens/RecentPhotosScreen.kt): `app/src/main/java/com/lazzy/gallery/ui/screens/RecentPhotosScreen.kt`
- [Albums](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/screens/AlbumsScreen.kt): `app/src/main/java/com/lazzy/gallery/ui/screens/AlbumsScreen.kt`
- [Album detail](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/screens/AlbumDetailScreen.kt): `app/src/main/java/com/lazzy/gallery/ui/screens/AlbumDetailScreen.kt`
- [Favorites](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/screens/FavoritesScreen.kt): `app/src/main/java/com/lazzy/gallery/ui/screens/FavoritesScreen.kt`
- [Text search](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/screens/SearchScreen.kt): `app/src/main/java/com/lazzy/gallery/ui/screens/SearchScreen.kt`
- [Recycle bin](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/screens/RecycleBinScreen.kt): `app/src/main/java/com/lazzy/gallery/ui/screens/RecycleBinScreen.kt`
- [Full-screen viewer](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/screens/PhotoDetailScreen.kt): `app/src/main/java/com/lazzy/gallery/ui/screens/PhotoDetailScreen.kt`
- [Settings](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/screens/SettingsScreen.kt): `app/src/main/java/com/lazzy/gallery/ui/screens/SettingsScreen.kt`
- [Media display components](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/components/MediaComponents.kt): `app/src/main/java/com/lazzy/gallery/ui/components/MediaComponents.kt`
- [Video player](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/components/VideoPlayerView.kt): `app/src/main/java/com/lazzy/gallery/ui/components/VideoPlayerView.kt`

### Media services

- [Media view model](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/ui/viewmodel/MediaViewModel.kt): `app/src/main/java/com/lazzy/gallery/ui/viewmodel/MediaViewModel.kt`
- [Media repository](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/data/MediaRepository.kt): `app/src/main/java/com/lazzy/gallery/data/MediaRepository.kt`
- [Media model](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/data/MediaModel.kt): `app/src/main/java/com/lazzy/gallery/data/MediaModel.kt`
- [Thumbnail fetcher](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/data/MediaStoreThumbnailFetcher.kt): `app/src/main/java/com/lazzy/gallery/data/MediaStoreThumbnailFetcher.kt`
- [Media sync worker](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/data/worker/MediaSyncWorker.kt): `app/src/main/java/com/lazzy/gallery/data/worker/MediaSyncWorker.kt`

### Local storage

- [Room database](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/data/local/GalleryDatabase.kt): `app/src/main/java/com/lazzy/gallery/data/local/GalleryDatabase.kt`
- [Media DAO](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/data/local/MediaDao.kt): `app/src/main/java/com/lazzy/gallery/data/local/MediaDao.kt`
- [Media index entity](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/data/local/MediaEntity.kt): `app/src/main/java/com/lazzy/gallery/data/local/MediaEntity.kt`
- **Android MediaStore**

### Native processing

- [Rust JNI bridge](https://github.com/iabhnv19/lazzygallery/blob/main/app/src/main/java/com/lazzy/gallery/data/RustBridge.kt): `app/src/main/java/com/lazzy/gallery/data/RustBridge.kt`
- [Rust media engine](https://github.com/iabhnv19/lazzygallery/blob/main/rust_core/src/lib.rs): `rust_core/src/lib.rs`
- **ML Kit OCR**

### Other components

- **Gallery user**

## Connections

- Gallery user → Main activity: opens app (evidence: `README.md`)
- Main activity → Screen navigation: shows routes (evidence: `app/src/main/java/com/lazzy/gallery/MainActivity.kt`)
- Main activity → Media view model: provides state (evidence: `app/src/main/java/com/lazzy/gallery/MainActivity.kt`)
- Screen navigation → Recent timeline: routes to
- Screen navigation → Albums: routes to
- Screen navigation → Album detail: routes to
- Screen navigation → Favorites: routes to
- Screen navigation → Text search: routes to
- Screen navigation → Recycle bin: routes to
- Screen navigation → Full-screen viewer: routes to
- Screen navigation → Settings: routes to
- Media view model → Media repository: requests media (evidence: `app/src/main/java/com/lazzy/gallery/ui/viewmodel/MediaViewModel.kt`)
- Media repository → Room database: opens database (evidence: `app/src/main/java/com/lazzy/gallery/data/MediaRepository.kt`)
- Media repository → Android MediaStore: queries media (evidence: `README.md`)
- Room database → Media DAO: exposes access (evidence: `app/src/main/java/com/lazzy/gallery/data/local/GalleryDatabase.kt`)
- Media DAO → Media index entity: stores records (evidence: `app/src/main/java/com/lazzy/gallery/data/local/MediaDao.kt`)
- Media index entity → Media model: maps to (evidence: `app/src/main/java/com/lazzy/gallery/data/local/MediaEntity.kt`)
- Media repository → Media model: produces media (evidence: `app/src/main/java/com/lazzy/gallery/data/MediaRepository.kt`)
- Media view model → Media model: exposes state (evidence: `app/src/main/java/com/lazzy/gallery/ui/viewmodel/MediaViewModel.kt`)
- Media sync worker → Media repository: requests sync (evidence: `app/src/main/java/com/lazzy/gallery/data/worker/MediaSyncWorker.kt`)
- Thumbnail fetcher → Rust JNI bridge: calls native decode (evidence: `app/src/main/java/com/lazzy/gallery/data/MediaStoreThumbnailFetcher.kt`)
- Media repository → Rust JNI bridge: uses native core (evidence: `README.md`)
- Rust JNI bridge → Rust media engine: invokes JNI (evidence: `README.md`)
- Full-screen viewer → Video player: renders video (evidence: `app/src/main/java/com/lazzy/gallery/ui/screens/PhotoDetailScreen.kt`)
- Full-screen viewer → Media view model: requests metadata (evidence: `app/src/main/java/com/lazzy/gallery/ui/screens/PhotoDetailScreen.kt`)
- Recent timeline → Media view model: reads media (evidence: `README.md`)
- Albums → Media view model: reads albums (evidence: `app/src/main/java/com/lazzy/gallery/ui/screens/AlbumsScreen.kt`)
- Album detail → Media view model: reads album (evidence: `app/src/main/java/com/lazzy/gallery/ui/screens/AlbumDetailScreen.kt`)
- Favorites → Media view model: reads favorites (evidence: `app/src/main/java/com/lazzy/gallery/ui/screens/FavoritesScreen.kt`)
- Text search → Media view model: searches media (evidence: `app/src/main/java/com/lazzy/gallery/ui/screens/SearchScreen.kt`)
- Recycle bin → Media view model: manages trash (evidence: `app/src/main/java/com/lazzy/gallery/ui/screens/RecycleBinScreen.kt`)
- Settings → Media view model: updates preferences (evidence: `app/src/main/java/com/lazzy/gallery/ui/screens/SettingsScreen.kt`)
- Media view model → Rust JNI bridge: preprocesses OCR
- Rust JNI bridge → ML Kit OCR: provides OCR input
- Recent timeline → Media display components: renders thumbnails
- Theme and accents → Floating navigation: styles navigation (evidence: `app/src/main/java/com/lazzy/gallery/ui/components/FloatingNavigationBar.kt`)
