# jayesh-cmd/doomscrolling-stop architecture

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

- Interactive diagram: https://gitdiagram.com/jayesh-cmd/doomscrolling-stop
- Repository: https://github.com/jayesh-cmd/doomscrolling-stop

## Overview

Doomscroller Controller is a single-file macOS webcam application. Its main loop captures frames, uses MediaPipe face landmarks and OpenCV-based head-pose/eye measurements to classify looking away, applies frame-count thresholds, and starts or stops a QuickTime video alarm. The preview overlays show face, gaze, and alarm status; ESC exits and releases the camera. The source excerpt shows these responsibilities, while README documents the user workflow and permissions. There are no separate domain modules or persistent stores.

Main entry points: [`main.py`](https://github.com/jayesh-cmd/doomscrolling-stop/blob/master/main.py) (Webcam loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sensing["Camera and gaze"]
  node_loop["Webcam loop<br/>[main.py]"]
  node_landmarks["Face landmarks<br/>[main.py]"]
  node_gaze["Gaze classification<br/>[main.py]"]
end

subgraph group_control["Alarm control"]
  node_thresholds["Frame thresholds<br/>[main.py]"]
  node_quicktime["QuickTime Player"]
end

subgraph group_preview["Live preview"]
  node_preview["Status preview<br/>[main.py]"]
end

node_user(("Viewer"))

node_user -->|"faces camera"| node_loop
node_loop -->|"processes frames"| node_landmarks
node_landmarks -->|"provides landmarks"| node_gaze
node_gaze -->|"updates gaze state"| node_thresholds
node_thresholds -->|"starts or stops"| node_quicktime
node_loop -->|"renders overlay"| node_preview
node_user -->|"views status"| node_preview

click node_loop "https://github.com/jayesh-cmd/doomscrolling-stop/blob/master/main.py"
click node_landmarks "https://github.com/jayesh-cmd/doomscrolling-stop/blob/master/main.py"
click node_gaze "https://github.com/jayesh-cmd/doomscrolling-stop/blob/master/main.py"
click node_thresholds "https://github.com/jayesh-cmd/doomscrolling-stop/blob/master/main.py"
click node_preview "https://github.com/jayesh-cmd/doomscrolling-stop/blob/master/main.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_loop,node_landmarks,node_gaze,node_user toneBlue
class node_thresholds,node_quicktime toneAmber
class node_preview toneMint
```

## Components

### Camera and gaze

- [Webcam loop](https://github.com/jayesh-cmd/doomscrolling-stop/blob/master/main.py): `main.py`
- [Face landmarks](https://github.com/jayesh-cmd/doomscrolling-stop/blob/master/main.py): `main.py`
- [Gaze classification](https://github.com/jayesh-cmd/doomscrolling-stop/blob/master/main.py): `main.py`

### Alarm control

- [Frame thresholds](https://github.com/jayesh-cmd/doomscrolling-stop/blob/master/main.py): `main.py`
- **QuickTime Player**

### Live preview

- [Status preview](https://github.com/jayesh-cmd/doomscrolling-stop/blob/master/main.py): `main.py`

### Other components

- **Viewer**

## Connections

- Viewer → Webcam loop: faces camera (evidence: `README.md`)
- Webcam loop → Face landmarks: processes frames (evidence: `main.py`)
- Face landmarks → Gaze classification: provides landmarks (evidence: `main.py`)
- Gaze classification → Frame thresholds: updates gaze state (evidence: `main.py`)
- Frame thresholds → QuickTime Player: starts or stops (evidence: `main.py`)
- Webcam loop → Status preview: renders overlay (evidence: `main.py`)
- Viewer → Status preview: views status (evidence: `README.md`)
