# chater-marzougui/screensolver architecture

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

- Interactive diagram: https://gitdiagram.com/chater-marzougui/screensolver
- Repository: https://github.com/chater-marzougui/screensolver

## Overview

ScreenSolver is a single-file desktop study aid: a user launches its floating Tkinter interface, which coordinates timed or manually triggered screen capture, Gemini question analysis, and answer display. The README documents monitoring, controls, countdown, and custom context; sampled code confirms the main capture-to-AI-to-display path. Responsibilities share app.py because the implementation is monolithic. Some UI behavior and configuration details are documented but not fully shown in the excerpts.

Main entry points: [`app.py`](https://github.com/chater-marzougui/screensolver/blob/main/app.py) (AI processor), [`context.txt`](https://github.com/chater-marzougui/screensolver/blob/main/context.txt) (Custom context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop controls"]
  node_entry["App entry<br/>[app.py]"]
  node_floating_ui["Floating interface<br/>[app.py]"]
  node_hotkeys_menu["Hotkeys and menu<br/>[app.py]"]
  node_timer_controls["Timer and pause<br/>[app.py]"]
  node_answer_display["Answer display<br/>[app.py]"]
end

subgraph group_analysis["Question analysis"]
  node_capture_flow["Capture coordinator<br/>[app.py]"]
  node_screen_capture["Screen capture<br/>[app.py]"]
  node_ai_processor["AI processor<br/>[app.py]"]
  node_response_parser["JSON answer parsing<br/>[app.py]"]
end

subgraph group_inputs["Inputs and services"]
  node_context["Custom context<br/>[context.txt]"]
  node_key_config["API key setup<br/>[app.py]"]
  node_gemini{{"Gemini API"}}
end

node_user(("User"))

node_user -->|"launches"| node_entry
node_entry -->|"creates"| node_floating_ui
node_user -->|"controls"| node_hotkeys_menu
node_hotkeys_menu -->|"triggers capture"| node_capture_flow
node_hotkeys_menu -->|"toggles pause"| node_timer_controls
node_timer_controls -->|"updates periodically"| node_floating_ui
node_capture_flow -->|"captures screen"| node_screen_capture
node_screen_capture -->|"submits image"| node_ai_processor
node_ai_processor -->|"uses keys"| node_key_config
node_ai_processor -->|"loads context"| node_context
node_ai_processor -->|"requests analysis"| node_gemini
node_ai_processor -->|"parses response"| node_response_parser
node_capture_flow -->|"sends result"| node_answer_display
node_answer_display -->|"updates text"| node_floating_ui

click node_entry "https://github.com/chater-marzougui/screensolver/blob/main/app.py"
click node_floating_ui "https://github.com/chater-marzougui/screensolver/blob/main/app.py"
click node_hotkeys_menu "https://github.com/chater-marzougui/screensolver/blob/main/app.py"
click node_timer_controls "https://github.com/chater-marzougui/screensolver/blob/main/app.py"
click node_answer_display "https://github.com/chater-marzougui/screensolver/blob/main/app.py"
click node_capture_flow "https://github.com/chater-marzougui/screensolver/blob/main/app.py"
click node_screen_capture "https://github.com/chater-marzougui/screensolver/blob/main/app.py"
click node_ai_processor "https://github.com/chater-marzougui/screensolver/blob/main/app.py"
click node_response_parser "https://github.com/chater-marzougui/screensolver/blob/main/app.py"
click node_context "https://github.com/chater-marzougui/screensolver/blob/main/context.txt"
click node_key_config "https://github.com/chater-marzougui/screensolver/blob/main/app.py"

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_floating_ui,node_hotkeys_menu,node_timer_controls,node_answer_display,node_user toneBlue
class node_capture_flow,node_screen_capture,node_ai_processor,node_response_parser toneAmber
class node_context,node_key_config,node_gemini toneMint
```

## Components

### Desktop controls

- [App entry](https://github.com/chater-marzougui/screensolver/blob/main/app.py): `app.py`
- [Floating interface](https://github.com/chater-marzougui/screensolver/blob/main/app.py): `app.py`
- [Hotkeys and menu](https://github.com/chater-marzougui/screensolver/blob/main/app.py): `app.py`
- [Timer and pause](https://github.com/chater-marzougui/screensolver/blob/main/app.py): `app.py`
- [Answer display](https://github.com/chater-marzougui/screensolver/blob/main/app.py): `app.py`

### Question analysis

- [Capture coordinator](https://github.com/chater-marzougui/screensolver/blob/main/app.py): `app.py`
- [Screen capture](https://github.com/chater-marzougui/screensolver/blob/main/app.py): `app.py`
- [AI processor](https://github.com/chater-marzougui/screensolver/blob/main/app.py): `app.py`
- [JSON answer parsing](https://github.com/chater-marzougui/screensolver/blob/main/app.py): `app.py`

### Inputs and services

- [Custom context](https://github.com/chater-marzougui/screensolver/blob/main/context.txt): `context.txt`
- [API key setup](https://github.com/chater-marzougui/screensolver/blob/main/app.py): `app.py`
- **Gemini API**

### Other components

- **User**

## Connections

- User → App entry: launches (evidence: `README.md`)
- App entry → Floating interface: creates (evidence: `app.py`)
- User → Hotkeys and menu: controls (evidence: `README.md`)
- Hotkeys and menu → Capture coordinator: triggers capture (evidence: `app.py`)
- Hotkeys and menu → Timer and pause: toggles pause (evidence: `app.py`)
- Timer and pause → Floating interface: updates periodically (evidence: `README.md`)
- Capture coordinator → Screen capture: captures screen (evidence: `app.py`)
- Screen capture → AI processor: submits image (evidence: `app.py`)
- AI processor → API key setup: uses keys (evidence: `app.py`)
- AI processor → Custom context: loads context (evidence: `app.py`)
- AI processor → Gemini API: requests analysis (evidence: `app.py`)
- AI processor → JSON answer parsing: parses response (evidence: `app.py`)
- Capture coordinator → Answer display: sends result (evidence: `app.py`)
- Answer display → Floating interface: updates text (evidence: `app.py`)
