# sachin1880/touchlessx architecture

> Architecture diagram of the GitHub repository sachin1880/touchlessx, 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/sachin1880/touchlessx
- Repository: https://github.com/sachin1880/touchlessx

## Overview

TouchlessX is a local desktop application that turns webcam hand motion into configurable computer controls. Its main workflow starts at the app entry point, captures frames, tracks hand landmarks, recognizes stable gestures, then dispatches mapped actions to the operating system. The UI also exposes profiles, gesture training, voice, clipboard, smart-home control, and insights. Major capabilities are documented in the README; some connections to those subsystems are documented rather than confirmed in sampled runtime code.

Main entry points: [`src/ui.py`](https://github.com/sachin1880/touchlessx/blob/main/src/ui.py) (Desktop UI), [`app.py`](https://github.com/sachin1880/touchlessx/blob/main/app.py) (App Entry), [`src/action_controller.py`](https://github.com/sachin1880/touchlessx/blob/main/src/action_controller.py) (Action Dispatcher), [`src/camera.py`](https://github.com/sachin1880/touchlessx/blob/main/src/camera.py) (Webcam Capture)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and Recognition"]
  node_app["App Entry<br/>[app.py]"]
  node_camera["Webcam Capture<br/>[camera.py]"]
  node_tracker["Hand Tracker<br/>[hand_tracker.py]"]
  node_gestures["Gesture Engine<br/>[gesture_engine.py]"]
end

subgraph group_control["Action Control"]
  node_actions["Action Dispatcher"]
  node_system_input["OS Input"]
  node_safety["Safety Controls<br/>[safety.py]"]
end

subgraph group_experience["Desktop Experience"]
  node_ui["Desktop UI<br/>[ui.py]"]
  node_pages["Feature Pages<br/>[ui_pages.py]"]
  node_widgets["UI Widgets<br/>[ui_widgets.py]"]
end

subgraph group_personalize["Personalization"]
  node_settings["Settings<br/>[config.py]"]
  node_profiles["Profiles<br/>[profiles.py]"]
  node_custom_gestures[("Custom Gesture Store<br/>[custom_gestures.py]")]
  node_training["Gesture Training<br/>[training.py]"]
  node_history[("Usage History<br/>[history.py]")]
  node_action_log[("Action Log<br/>[action_log.py]")]
end

subgraph group_integrations["Local and Optional Features"]
  node_clipboard["Clipboard<br/>[clipboard.py]"]
  node_voice["Voice Commands<br/>[voice.py]"]
  node_assistant["Voice Assistant<br/>[assistant.py]"]
  node_smart_home["Smart Home<br/>[smart_home.py]"]
  node_platform["Platform Services<br/>[system.py]"]
end

node_user(("User"))
node_webhook{{"Smart-Home Hub"}}

node_user -->|"starts"| node_app
node_app -->|"starts capture"| node_camera
node_app -->|"initializes"| node_tracker
node_app -->|"wires pipeline"| node_gestures
node_camera -.->|"provides frames"| node_tracker
node_tracker -.->|"provides landmarks"| node_gestures
node_gestures -.->|"dispatches gestures"| node_actions
node_actions -->|"sends controls"| node_system_input
node_ui -->|"controls camera"| node_camera
node_ui -->|"configures actions"| node_actions
node_ui -->|"loads settings"| node_settings
node_ui -->|"hosts pages"| node_pages
node_pages -->|"uses widgets"| node_widgets
node_ui -->|"manages profiles"| node_profiles
node_profiles -->|"validates against"| node_settings
node_ui -->|"manages training"| node_training
node_training -->|"uses classifier"| node_custom_gestures
node_ui -->|"reads insights"| node_history
node_ui -->|"records actions"| node_action_log
node_ui -->|"handles clipboard"| node_clipboard
node_ui -->|"starts listening"| node_voice
node_ui -->|"configures assistant"| node_assistant
node_assistant -->|"uses speech support"| node_voice
node_ui -->|"manages integration"| node_smart_home
node_smart_home -.->|"sends commands"| node_webhook
node_ui -->|"provides stop controls"| node_safety
node_ui -->|"uses platform services"| node_platform
node_voice -.->|"maps commands"| node_actions

click node_app "https://github.com/sachin1880/touchlessx/blob/main/app.py"
click node_camera "https://github.com/sachin1880/touchlessx/blob/main/src/camera.py"
click node_tracker "https://github.com/sachin1880/touchlessx/blob/main/src/hand_tracker.py"
click node_gestures "https://github.com/sachin1880/touchlessx/blob/main/src/gesture_engine.py"
click node_actions "https://github.com/sachin1880/touchlessx/blob/main/src/action_controller.py"
click node_safety "https://github.com/sachin1880/touchlessx/blob/main/src/safety.py"
click node_ui "https://github.com/sachin1880/touchlessx/blob/main/src/ui.py"
click node_pages "https://github.com/sachin1880/touchlessx/blob/main/src/ui_pages.py"
click node_widgets "https://github.com/sachin1880/touchlessx/blob/main/src/ui_widgets.py"
click node_settings "https://github.com/sachin1880/touchlessx/blob/main/src/config.py"
click node_profiles "https://github.com/sachin1880/touchlessx/blob/main/src/profiles.py"
click node_custom_gestures "https://github.com/sachin1880/touchlessx/blob/main/src/custom_gestures.py"
click node_training "https://github.com/sachin1880/touchlessx/blob/main/src/training.py"
click node_history "https://github.com/sachin1880/touchlessx/blob/main/src/history.py"
click node_action_log "https://github.com/sachin1880/touchlessx/blob/main/src/action_log.py"
click node_clipboard "https://github.com/sachin1880/touchlessx/blob/main/src/clipboard.py"
click node_voice "https://github.com/sachin1880/touchlessx/blob/main/src/voice.py"
click node_assistant "https://github.com/sachin1880/touchlessx/blob/main/src/assistant.py"
click node_smart_home "https://github.com/sachin1880/touchlessx/blob/main/src/smart_home.py"
click node_platform "https://github.com/sachin1880/touchlessx/blob/main/src/system.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_app,node_camera,node_tracker,node_gestures,node_user toneBlue
class node_actions,node_system_input,node_safety toneAmber
class node_ui,node_pages,node_widgets toneMint
class node_settings,node_profiles,node_custom_gestures,node_training,node_history,node_action_log toneRose
class node_clipboard,node_voice,node_assistant,node_smart_home,node_platform,node_webhook toneIndigo
```

## Components

### Capture and Recognition

- [App Entry](https://github.com/sachin1880/touchlessx/blob/main/app.py): `app.py`
- [Webcam Capture](https://github.com/sachin1880/touchlessx/blob/main/src/camera.py): `src/camera.py`
- [Hand Tracker](https://github.com/sachin1880/touchlessx/blob/main/src/hand_tracker.py): `src/hand_tracker.py`
- [Gesture Engine](https://github.com/sachin1880/touchlessx/blob/main/src/gesture_engine.py): `src/gesture_engine.py`

### Action Control

- [Action Dispatcher](https://github.com/sachin1880/touchlessx/blob/main/src/action_controller.py): `src/action_controller.py`
- **OS Input**
- [Safety Controls](https://github.com/sachin1880/touchlessx/blob/main/src/safety.py): `src/safety.py`

### Desktop Experience

- [Desktop UI](https://github.com/sachin1880/touchlessx/blob/main/src/ui.py): `src/ui.py`
- [Feature Pages](https://github.com/sachin1880/touchlessx/blob/main/src/ui_pages.py): `src/ui_pages.py`
- [UI Widgets](https://github.com/sachin1880/touchlessx/blob/main/src/ui_widgets.py): `src/ui_widgets.py`

### Personalization

- [Settings](https://github.com/sachin1880/touchlessx/blob/main/src/config.py): `src/config.py`
- [Profiles](https://github.com/sachin1880/touchlessx/blob/main/src/profiles.py): `src/profiles.py`
- [Custom Gesture Store](https://github.com/sachin1880/touchlessx/blob/main/src/custom_gestures.py): `src/custom_gestures.py`
- [Gesture Training](https://github.com/sachin1880/touchlessx/blob/main/src/training.py): `src/training.py`
- [Usage History](https://github.com/sachin1880/touchlessx/blob/main/src/history.py): `src/history.py`
- [Action Log](https://github.com/sachin1880/touchlessx/blob/main/src/action_log.py): `src/action_log.py`

### Local and Optional Features

- [Clipboard](https://github.com/sachin1880/touchlessx/blob/main/src/clipboard.py): `src/clipboard.py`
- [Voice Commands](https://github.com/sachin1880/touchlessx/blob/main/src/voice.py): `src/voice.py`
- [Voice Assistant](https://github.com/sachin1880/touchlessx/blob/main/src/assistant.py): `src/assistant.py`
- [Smart Home](https://github.com/sachin1880/touchlessx/blob/main/src/smart_home.py): `src/smart_home.py`
- [Platform Services](https://github.com/sachin1880/touchlessx/blob/main/src/system.py): `src/system.py`

### Other components

- **User**
- **Smart-Home Hub**

## Connections

- User → App Entry: starts (evidence: `README.md`)
- App Entry → Webcam Capture: starts capture (evidence: `app.py`)
- App Entry → Hand Tracker: initializes (evidence: `app.py`)
- App Entry → Gesture Engine: wires pipeline (evidence: `app.py`)
- Webcam Capture → Hand Tracker: provides frames
- Hand Tracker → Gesture Engine: provides landmarks
- Gesture Engine → Action Dispatcher: dispatches gestures (evidence: `src/action_controller.py`)
- Action Dispatcher → OS Input: sends controls (evidence: `README.md`)
- Desktop UI → Webcam Capture: controls camera (evidence: `src/ui.py`)
- Desktop UI → Action Dispatcher: configures actions (evidence: `src/ui.py`)
- Desktop UI → Settings: loads settings (evidence: `src/ui.py`)
- Desktop UI → Feature Pages: hosts pages (evidence: `src/ui.py`)
- Feature Pages → UI Widgets: uses widgets (evidence: `src/ui_pages.py`)
- Desktop UI → Profiles: manages profiles (evidence: `src/ui.py`)
- Profiles → Settings: validates against (evidence: `src/profiles.py`)
- Desktop UI → Gesture Training: manages training (evidence: `src/ui.py`)
- Gesture Training → Custom Gesture Store: uses classifier (evidence: `src/training.py`)
- Desktop UI → Usage History: reads insights (evidence: `src/ui.py`)
- Desktop UI → Action Log: records actions (evidence: `src/ui.py`)
- Desktop UI → Clipboard: handles clipboard (evidence: `src/ui.py`)
- Desktop UI → Voice Commands: starts listening (evidence: `src/ui.py`)
- Desktop UI → Voice Assistant: configures assistant (evidence: `src/ui.py`)
- Voice Assistant → Voice Commands: uses speech support (evidence: `src/assistant.py`)
- Desktop UI → Smart Home: manages integration (evidence: `src/ui.py`)
- Smart Home → Smart-Home Hub: sends commands (evidence: `README.md`)
- Desktop UI → Safety Controls: provides stop controls (evidence: `src/ui.py`)
- Desktop UI → Platform Services: uses platform services (evidence: `src/ui.py`)
- Voice Commands → Action Dispatcher: maps commands (evidence: `README.md`)
