# altunsumerve/hava-fare architecture

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

- Interactive diagram: https://gitdiagram.com/altunsumerve/hava-fare
- Repository: https://github.com/altunsumerve/hava-fare

## Overview

Air Mouse is a Windows desktop app that turns webcam hand gestures into mouse actions and microphone double-claps into website launches. Its main loop handles camera frames, hand tracking, gesture interpretation, mouse control, and the preview/overlay; the clap listener runs separately and signals the app through a callback. The README documents the gesture and clap behavior, while the excerpts show the main app’s configuration and listener wiring. Some display and callback details are documented but not visible in the sampled code.

Main entry points: [`hava_fare.py`](https://github.com/altunsumerve/hava-fare/blob/main/hava_fare.py) (Gesture app loop), [`alkis_dinleyici.py`](https://github.com/altunsumerve/hava-fare/blob/main/alkis_dinleyici.py) (Clap listener), [`ayarlar.py`](https://github.com/altunsumerve/hava-fare/blob/main/ayarlar.py) (App settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_hand_control["Hand Control"]
  node_main_loop["Gesture app loop<br/>[hava_fare.py]"]
  node_gesture_rules["Gesture interpretation<br/>[hava_fare.py]"]
  node_mouse_actions["Mouse actions<br/>[hava_fare.py]"]
end

subgraph group_clap_control["Clap Control"]
  node_clap_listener["Clap listener<br/>[alkis_dinleyici.py]"]
  node_clap_callback["Clap callback<br/>[hava_fare.py]"]
  node_websites["Configured websites<br/>[ayarlar.py]"]
end

subgraph group_app_display["App Display"]
  node_preview["Preview window<br/>[hava_fare.py]"]
  node_overlay["Overlay window<br/>[hava_fare.py]"]
end

subgraph group_settings["Configuration"]
  node_settings["App settings<br/>[ayarlar.py]"]
end

node_user(("User"))
node_webcam["Webcam"]
node_mediapipe["MediaPipe hand tracking"]
node_microphone["Microphone"]
node_browser["Web browser"]

node_user -->|"shows gestures"| node_webcam
node_webcam -->|"supplies frames"| node_main_loop
node_main_loop -->|"tracks hands"| node_mediapipe
node_main_loop -->|"processes landmarks"| node_gesture_rules
node_gesture_rules -->|"selects actions"| node_mouse_actions
node_mouse_actions -->|"moves or clicks"| node_user
node_microphone -->|"supplies audio"| node_clap_listener
node_main_loop -->|"starts listener"| node_clap_listener
node_clap_listener -->|"calls on double clap"| node_clap_callback
node_clap_callback -->|"opens configured sites"| node_websites
node_clap_callback -->|"opens sites"| node_browser
node_main_loop -->|"renders feedback"| node_preview
node_preview -->|"shows status"| node_user
node_main_loop -->|"configures overlay"| node_overlay
node_settings -->|"configures behavior"| node_main_loop
node_settings -->|"sets audio thresholds"| node_clap_listener

click node_main_loop "https://github.com/altunsumerve/hava-fare/blob/main/hava_fare.py"
click node_gesture_rules "https://github.com/altunsumerve/hava-fare/blob/main/hava_fare.py"
click node_mouse_actions "https://github.com/altunsumerve/hava-fare/blob/main/hava_fare.py"
click node_clap_listener "https://github.com/altunsumerve/hava-fare/blob/main/alkis_dinleyici.py"
click node_clap_callback "https://github.com/altunsumerve/hava-fare/blob/main/hava_fare.py"
click node_websites "https://github.com/altunsumerve/hava-fare/blob/main/ayarlar.py"
click node_preview "https://github.com/altunsumerve/hava-fare/blob/main/hava_fare.py"
click node_overlay "https://github.com/altunsumerve/hava-fare/blob/main/hava_fare.py"
click node_settings "https://github.com/altunsumerve/hava-fare/blob/main/ayarlar.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_main_loop,node_gesture_rules,node_mouse_actions,node_user,node_browser toneBlue
class node_clap_listener,node_clap_callback,node_websites toneAmber
class node_preview,node_overlay,node_mediapipe toneMint
class node_settings toneRose
class node_webcam,node_microphone toneIndigo
```

## Components

### Hand Control

- [Gesture app loop](https://github.com/altunsumerve/hava-fare/blob/main/hava_fare.py): `hava_fare.py`
- [Gesture interpretation](https://github.com/altunsumerve/hava-fare/blob/main/hava_fare.py): `hava_fare.py`
- [Mouse actions](https://github.com/altunsumerve/hava-fare/blob/main/hava_fare.py): `hava_fare.py`

### Clap Control

- [Clap listener](https://github.com/altunsumerve/hava-fare/blob/main/alkis_dinleyici.py): `alkis_dinleyici.py`
- [Clap callback](https://github.com/altunsumerve/hava-fare/blob/main/hava_fare.py): `hava_fare.py`
- [Configured websites](https://github.com/altunsumerve/hava-fare/blob/main/ayarlar.py): `ayarlar.py`

### App Display

- [Preview window](https://github.com/altunsumerve/hava-fare/blob/main/hava_fare.py): `hava_fare.py`
- [Overlay window](https://github.com/altunsumerve/hava-fare/blob/main/hava_fare.py): `hava_fare.py`

### Configuration

- [App settings](https://github.com/altunsumerve/hava-fare/blob/main/ayarlar.py): `ayarlar.py`

### Other components

- **User**
- **Webcam**
- **MediaPipe hand tracking**
- **Microphone**
- **Web browser**

## Connections

- User → Webcam: shows gestures (evidence: `README.md`)
- Webcam → Gesture app loop: supplies frames (evidence: `hava_fare.py`)
- Gesture app loop → MediaPipe hand tracking: tracks hands (evidence: `README.md`)
- Gesture app loop → Gesture interpretation: processes landmarks (evidence: `hava_fare.py`)
- Gesture interpretation → Mouse actions: selects actions (evidence: `README.md`)
- Mouse actions → User: moves or clicks (evidence: `hava_fare.py`)
- Microphone → Clap listener: supplies audio (evidence: `README.md`)
- Gesture app loop → Clap listener: starts listener (evidence: `hava_fare.py`)
- Clap listener → Clap callback: calls on double clap (evidence: `alkis_dinleyici.py`)
- Clap callback → Configured websites: opens configured sites (evidence: `README.md`)
- Clap callback → Web browser: opens sites (evidence: `README.md`)
- Gesture app loop → Preview window: renders feedback (evidence: `README.md`)
- Preview window → User: shows status (evidence: `README.md`)
- Gesture app loop → Overlay window: configures overlay (evidence: `hava_fare.py`)
- App settings → Gesture app loop: configures behavior (evidence: `hava_fare.py`)
- App settings → Clap listener: sets audio thresholds (evidence: `alkis_dinleyici.py`)
