# rharshith2005/glanceflowai architecture

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

- Interactive diagram: https://gitdiagram.com/rharshith2005/glanceflowai
- Repository: https://github.com/rharshith2005/glanceflowai

## Overview

GlanceFlow turns camera, voice, or pasted input into structured tasks and deadlines, then presents and stores them as visual “glances.” The README documents offline OCR/ASR, local and optional cloud understanding, calendar/archive views, companion sync, and reminders. The supplied source excerpts contain no runtime code, so relationships below are based on README statements; implementation-level wiring cannot be verified.

Main entry points: [`app/src/main/java/com/example/ai/understanding/AIUnderstandingEngine.kt`](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ai/understanding/AIUnderstandingEngine.kt) (Understanding Interface), [`app/src/main/java/com/example/ui/capture/CaptureScreen.kt`](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ui/capture/CaptureScreen.kt) (Capture Screen), [`app/src/main/java/com/example/ai/preprocessing/ImagePreprocessor.kt`](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ai/preprocessing/ImagePreprocessor.kt) (Image Preprocessor), [`app/src/main/java/com/example/ai/ocr/TextRecognitionEngine.kt`](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ai/ocr/TextRecognitionEngine.kt) (Text Recognition)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture &amp; Recognition"]
  node_capture_screen["Capture Screen<br/>[CaptureScreen.kt]"]
  node_preprocessor["Image Preprocessor"]
  node_ocr["Text Recognition"]
  node_speech["Speech Recognition"]
end

subgraph group_ai["Understanding"]
  node_understanding["Understanding Interface"]
  node_gemma["Local Gemma"]
  node_offline["Offline Rules"]
  node_gemini["Cloud Gemini"]
end

subgraph group_data["Glance Data"]
  node_glance_model["Glance Models<br/>[GlanceModels.kt]"]
  node_repository["Glance Repository"]
  node_database[("Room Database<br/>[GlanceDatabase.kt]")]
end

subgraph group_experience["App Experience"]
  node_viewmodel["Glance ViewModel<br/>[GlanceViewModel.kt]"]
  node_home["Home Screen<br/>[HomeScreen.kt]"]
  node_calendar["Calendar Screen<br/>[CalendarScreen.kt]"]
  node_archive["Glances Archive<br/>[GlancesScreen.kt]"]
  node_settings["Settings Screen<br/>[SettingsScreen.kt]"]
  node_sync_screen["Sync Screen<br/>[SyncScreen.kt]"]
end

subgraph group_services["Device Services"]
  node_sync_engine["Companion Sync<br/>[SyncEngine.kt]"]
  node_reminders["Reminder Receiver"]
  node_notification_manager["Notification Manager"]
end

node_person(("User"))
node_cloud_service["Gemini Service"]
node_laptop(("Laptop Browser"))

node_person -->|"captures input"| node_capture_screen
node_capture_screen -->|"enhances images"| node_preprocessor
node_preprocessor -->|"feeds images"| node_ocr
node_capture_screen -->|"records voice"| node_speech
node_ocr -->|"provides text"| node_understanding
node_speech -->|"provides speech"| node_understanding
node_understanding -->|"uses local model"| node_gemma
node_understanding -->|"falls back"| node_offline
node_understanding -.->|"optionally uses"| node_gemini
node_gemini -.->|"sends requests"| node_cloud_service
node_understanding -->|"structures results"| node_glance_model
node_glance_model -->|"persists glances"| node_repository
node_repository -->|"stores locally"| node_database
node_person -->|"views glances"| node_home
node_person -->|"views upcoming"| node_calendar
node_person -->|"browses archive"| node_archive
node_person -->|"manages AI"| node_settings
node_person -->|"opens sync"| node_sync_screen
node_sync_screen -->|"starts server"| node_sync_engine
node_sync_engine -->|"serves dashboard"| node_laptop
node_reminders -->|"schedules alerts"| node_notification_manager

click node_capture_screen "https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ui/capture/CaptureScreen.kt"
click node_preprocessor "https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ai/preprocessing/ImagePreprocessor.kt"
click node_ocr "https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ai/ocr/TextRecognitionEngine.kt"
click node_speech "https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ai/speech/SpeechRecognitionEngine.kt"
click node_understanding "https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ai/understanding/AIUnderstandingEngine.kt"
click node_gemma "https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ai/understanding/GemmaLocalEngine.kt"
click node_offline "https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ai/understanding/OfflineUnderstandingEngine.kt"
click node_gemini "https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ai/understanding/GeminiUnderstandingEngine.kt"
click node_glance_model "https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/domain/model/GlanceModels.kt"
click node_repository "https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/data/repository/GlanceRepository.kt"
click node_database "https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/data/local/GlanceDatabase.kt"
click node_viewmodel "https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ui/viewmodel/GlanceViewModel.kt"
click node_home "https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ui/home/HomeScreen.kt"
click node_calendar "https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ui/calendar/CalendarScreen.kt"
click node_archive "https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ui/glances/GlancesScreen.kt"
click node_settings "https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ui/settings/SettingsScreen.kt"
click node_sync_screen "https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ui/sync/SyncScreen.kt"
click node_sync_engine "https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/sync/SyncEngine.kt"
click node_reminders "https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/notifications/AssignmentReminderReceiver.kt"
click node_notification_manager "https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/notifications/GlanceNotificationManager.kt"

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_capture_screen,node_preprocessor,node_ocr,node_speech,node_person,node_laptop toneBlue
class node_understanding,node_gemma,node_offline,node_gemini toneAmber
class node_glance_model,node_repository,node_database toneMint
class node_viewmodel,node_home,node_calendar,node_archive,node_settings,node_sync_screen toneRose
class node_sync_engine,node_reminders,node_notification_manager,node_cloud_service toneIndigo
```

## Components

### Capture & Recognition

- [Capture Screen](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ui/capture/CaptureScreen.kt): `app/src/main/java/com/example/ui/capture/CaptureScreen.kt`
- [Image Preprocessor](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ai/preprocessing/ImagePreprocessor.kt): `app/src/main/java/com/example/ai/preprocessing/ImagePreprocessor.kt`
- [Text Recognition](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ai/ocr/TextRecognitionEngine.kt): `app/src/main/java/com/example/ai/ocr/TextRecognitionEngine.kt`
- [Speech Recognition](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ai/speech/SpeechRecognitionEngine.kt): `app/src/main/java/com/example/ai/speech/SpeechRecognitionEngine.kt`

### Understanding

- [Understanding Interface](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ai/understanding/AIUnderstandingEngine.kt): `app/src/main/java/com/example/ai/understanding/AIUnderstandingEngine.kt`
- [Local Gemma](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ai/understanding/GemmaLocalEngine.kt): `app/src/main/java/com/example/ai/understanding/GemmaLocalEngine.kt`
- [Offline Rules](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ai/understanding/OfflineUnderstandingEngine.kt): `app/src/main/java/com/example/ai/understanding/OfflineUnderstandingEngine.kt`
- [Cloud Gemini](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ai/understanding/GeminiUnderstandingEngine.kt): `app/src/main/java/com/example/ai/understanding/GeminiUnderstandingEngine.kt`

### Glance Data

- [Glance Models](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/domain/model/GlanceModels.kt): `app/src/main/java/com/example/domain/model/GlanceModels.kt`
- [Glance Repository](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/data/repository/GlanceRepository.kt): `app/src/main/java/com/example/data/repository/GlanceRepository.kt`
- [Room Database](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/data/local/GlanceDatabase.kt): `app/src/main/java/com/example/data/local/GlanceDatabase.kt`

### App Experience

- [Glance ViewModel](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ui/viewmodel/GlanceViewModel.kt): `app/src/main/java/com/example/ui/viewmodel/GlanceViewModel.kt`
- [Home Screen](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ui/home/HomeScreen.kt): `app/src/main/java/com/example/ui/home/HomeScreen.kt`
- [Calendar Screen](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ui/calendar/CalendarScreen.kt): `app/src/main/java/com/example/ui/calendar/CalendarScreen.kt`
- [Glances Archive](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ui/glances/GlancesScreen.kt): `app/src/main/java/com/example/ui/glances/GlancesScreen.kt`
- [Settings Screen](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ui/settings/SettingsScreen.kt): `app/src/main/java/com/example/ui/settings/SettingsScreen.kt`
- [Sync Screen](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/ui/sync/SyncScreen.kt): `app/src/main/java/com/example/ui/sync/SyncScreen.kt`

### Device Services

- [Companion Sync](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/sync/SyncEngine.kt): `app/src/main/java/com/example/sync/SyncEngine.kt`
- [Reminder Receiver](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/notifications/AssignmentReminderReceiver.kt): `app/src/main/java/com/example/notifications/AssignmentReminderReceiver.kt`
- [Notification Manager](https://github.com/rharshith2005/glanceflowai/blob/main/app/src/main/java/com/example/notifications/GlanceNotificationManager.kt): `app/src/main/java/com/example/notifications/GlanceNotificationManager.kt`

### Other components

- **User**
- **Gemini Service**
- **Laptop Browser**

## Connections

- User → Capture Screen: captures input (evidence: `README.md`)
- Capture Screen → Image Preprocessor: enhances images (evidence: `README.md`)
- Image Preprocessor → Text Recognition: feeds images (evidence: `README.md`)
- Capture Screen → Speech Recognition: records voice (evidence: `README.md`)
- Text Recognition → Understanding Interface: provides text (evidence: `README.md`)
- Speech Recognition → Understanding Interface: provides speech (evidence: `README.md`)
- Understanding Interface → Local Gemma: uses local model (evidence: `README.md`)
- Understanding Interface → Offline Rules: falls back (evidence: `README.md`)
- Understanding Interface → Cloud Gemini: optionally uses (evidence: `README.md`)
- Cloud Gemini → Gemini Service: sends requests (evidence: `README.md`)
- Understanding Interface → Glance Models: structures results (evidence: `README.md`)
- Glance Models → Glance Repository: persists glances (evidence: `README.md`)
- Glance Repository → Room Database: stores locally (evidence: `README.md`)
- User → Home Screen: views glances (evidence: `README.md`)
- User → Calendar Screen: views upcoming (evidence: `README.md`)
- User → Glances Archive: browses archive (evidence: `README.md`)
- User → Settings Screen: manages AI (evidence: `README.md`)
- User → Sync Screen: opens sync (evidence: `README.md`)
- Sync Screen → Companion Sync: starts server (evidence: `README.md`)
- Companion Sync → Laptop Browser: serves dashboard (evidence: `README.md`)
- Reminder Receiver → Notification Manager: schedules alerts (evidence: `README.md`)
