# yuva-raj444/photosence architecture

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

- Interactive diagram: https://gitdiagram.com/yuva-raj444/photosence
- Repository: https://github.com/yuva-raj444/photosence

## Overview

Photosense is an offline Android gallery search app. The documented workflow is to grant photo access, index an album on-device, then search from the home screen with natural-language queries. The README identifies the main search and indexing screens and the ML and data layers; the source excerpts do not show their call relationships, so the graph avoids guessing at internal wiring.

Main entry points: [`app/src/main/java/com/example/clipgallery/IndexAlbumsActivity.kt`](https://github.com/yuva-raj444/photosence/blob/main/app/src/main/java/com/example/clipgallery/IndexAlbumsActivity.kt) (Album indexing), [`app/src/main/java/com/example/clipgallery/MainActivity.kt`](https://github.com/yuva-raj444/photosence/blob/main/app/src/main/java/com/example/clipgallery/MainActivity.kt) (Search home), [`app/src/main/java/com/example/clipgallery/ml`](https://github.com/yuva-raj444/photosence/tree/main/app/src/main/java/com/example/clipgallery/ml) (Embedding and tokenization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_screens["App screens"]
  node_main["Search home<br/>[MainActivity.kt]"]
  node_index["Album indexing"]
  node_filter["Search filters"]
  node_results["Search results"]
end

subgraph group_media["Gallery browsing"]
  node_album["Album view<br/>[AlbumActivity.kt]"]
  node_viewer["Photo viewer"]
  node_mediahelper["Media access"]
end

subgraph group_ml["On-device search"]
  node_ml["Embedding and tokenization"]
  node_tokenizer["Tokenizer assets"]
end

subgraph group_data["Local data"]
  node_database[("Room data access")]
end

node_user(("User"))

node_user -->|"chooses album"| node_index
node_index -->|"indexes on-device"| node_ml
node_user -->|"searches from home"| node_main

click node_main "https://github.com/yuva-raj444/photosence/blob/main/app/src/main/java/com/example/clipgallery/MainActivity.kt"
click node_index "https://github.com/yuva-raj444/photosence/blob/main/app/src/main/java/com/example/clipgallery/IndexAlbumsActivity.kt"
click node_filter "https://github.com/yuva-raj444/photosence/blob/main/app/src/main/java/com/example/clipgallery/SearchFilterActivity.kt"
click node_results "https://github.com/yuva-raj444/photosence/blob/main/app/src/main/java/com/example/clipgallery/SearchResultsActivity.kt"
click node_album "https://github.com/yuva-raj444/photosence/blob/main/app/src/main/java/com/example/clipgallery/AlbumActivity.kt"
click node_viewer "https://github.com/yuva-raj444/photosence/blob/main/app/src/main/java/com/example/clipgallery/PhotoViewerActivity.kt"
click node_mediahelper "https://github.com/yuva-raj444/photosence/blob/main/app/src/main/java/com/example/clipgallery/MediaStoreHelper.kt"
click node_ml "https://github.com/yuva-raj444/photosence/tree/main/app/src/main/java/com/example/clipgallery/ml"
click node_tokenizer "https://github.com/yuva-raj444/photosence/tree/main/app/src/main/assets/tokenizer"
click node_database "https://github.com/yuva-raj444/photosence/tree/main/app/src/main/java/com/example/clipgallery/data"

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_index,node_filter,node_results,node_user toneBlue
class node_album,node_viewer,node_mediahelper toneAmber
class node_ml,node_tokenizer toneMint
class node_database toneRose
```

## Components

### App screens

- [Search home](https://github.com/yuva-raj444/photosence/blob/main/app/src/main/java/com/example/clipgallery/MainActivity.kt): `app/src/main/java/com/example/clipgallery/MainActivity.kt`
- [Album indexing](https://github.com/yuva-raj444/photosence/blob/main/app/src/main/java/com/example/clipgallery/IndexAlbumsActivity.kt): `app/src/main/java/com/example/clipgallery/IndexAlbumsActivity.kt`
- [Search filters](https://github.com/yuva-raj444/photosence/blob/main/app/src/main/java/com/example/clipgallery/SearchFilterActivity.kt): `app/src/main/java/com/example/clipgallery/SearchFilterActivity.kt`
- [Search results](https://github.com/yuva-raj444/photosence/blob/main/app/src/main/java/com/example/clipgallery/SearchResultsActivity.kt): `app/src/main/java/com/example/clipgallery/SearchResultsActivity.kt`

### Gallery browsing

- [Album view](https://github.com/yuva-raj444/photosence/blob/main/app/src/main/java/com/example/clipgallery/AlbumActivity.kt): `app/src/main/java/com/example/clipgallery/AlbumActivity.kt`
- [Photo viewer](https://github.com/yuva-raj444/photosence/blob/main/app/src/main/java/com/example/clipgallery/PhotoViewerActivity.kt): `app/src/main/java/com/example/clipgallery/PhotoViewerActivity.kt`
- [Media access](https://github.com/yuva-raj444/photosence/blob/main/app/src/main/java/com/example/clipgallery/MediaStoreHelper.kt): `app/src/main/java/com/example/clipgallery/MediaStoreHelper.kt`

### On-device search

- [Embedding and tokenization](https://github.com/yuva-raj444/photosence/tree/main/app/src/main/java/com/example/clipgallery/ml): `app/src/main/java/com/example/clipgallery/ml`
- [Tokenizer assets](https://github.com/yuva-raj444/photosence/tree/main/app/src/main/assets/tokenizer): `app/src/main/assets/tokenizer`

### Local data

- [Room data access](https://github.com/yuva-raj444/photosence/tree/main/app/src/main/java/com/example/clipgallery/data): `app/src/main/java/com/example/clipgallery/data`

### Other components

- **User**

## Connections

- User → Album indexing: chooses album (evidence: `README.md`)
- Album indexing → Embedding and tokenization: indexes on-device (evidence: `README.md`)
- User → Search home: searches from home (evidence: `README.md`)
