# nexind/motion-mouse architecture

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

- Interactive diagram: https://gitdiagram.com/nexind/motion-mouse
- Repository: https://github.com/nexind/motion-mouse

## Overview

Motion Mouse is a paired Android–Windows application that uses phone motion or controls to operate a PC. The documented workflow is to discover and connect the phone to the Windows app, then send motion or mode commands to control the PC. The README also describes settings synchronization, calibration, background operation, and Wi-Fi/Bluetooth connectivity. Source code is not present in the provided tree, so internal components and relationships below reflect documented behavior only; implementation paths and uncertain wiring are omitted.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_android["Android app"]
  node_android_app["Android app"]
  node_discovery["PC discovery"]
  node_motion_input["Motion sensing"]
  node_motion_processing["Motion processing"]
  node_phone_controls["Phone controls"]
  node_android_settings["Android settings"]
  node_background_service["Background service"]
end

subgraph group_windows["Windows app"]
  node_windows_app["Windows app"]
  node_connection_listener["Connection listener"]
  node_settings_sync["Settings sync"]
  node_cursor_control["Cursor control"]
  node_controller_mode["Controller mode"]
  node_media_modes["Media and presentation"]
end

subgraph group_connectivity["Connectivity"]
  node_wifi_tcp["Wi-Fi TCP"]
  node_bluetooth_rfcomm["Bluetooth RFCOMM"]
end

node_phone_user(("Phone user"))
node_pc_user(("PC user"))
node_pc_pointer["PC cursor"]

node_phone_user -->|"uses"| node_android_app
node_pc_user -->|"uses"| node_windows_app
node_android_app -->|"discovers PCs"| node_discovery
node_discovery -->|"discovers over"| node_wifi_tcp
node_discovery -->|"discovers over"| node_bluetooth_rfcomm
node_windows_app -->|"starts"| node_connection_listener
node_android_app -->|"connects over"| node_wifi_tcp
node_android_app -->|"connects over"| node_bluetooth_rfcomm
node_motion_input -->|"provides sensor motion"| node_motion_processing
node_android_app -->|"reads"| node_motion_input
node_android_app -->|"offers"| node_phone_controls
node_phone_controls -->|"adjusts"| node_android_settings
node_android_settings -->|"syncs settings"| node_settings_sync
node_settings_sync -->|"updates settings"| node_android_settings
node_windows_app -->|"provides settings"| node_settings_sync
node_motion_processing -->|"sends motion"| node_wifi_tcp
node_motion_processing -->|"sends motion"| node_bluetooth_rfcomm
node_phone_controls -->|"sends commands"| node_wifi_tcp
node_phone_controls -->|"sends commands"| node_bluetooth_rfcomm
node_connection_listener -->|"listens over"| node_wifi_tcp
node_connection_listener -->|"listens over"| node_bluetooth_rfcomm
node_windows_app -->|"handles input"| node_cursor_control
node_cursor_control -->|"moves"| node_pc_pointer
node_windows_app -->|"provides"| node_controller_mode
node_windows_app -->|"provides"| node_media_modes
node_android_app -->|"runs as"| node_background_service
node_background_service -->|"reads motion"| node_motion_input

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_android_app,node_discovery,node_motion_input,node_motion_processing,node_phone_controls,node_android_settings,node_background_service,node_phone_user,node_pc_user toneBlue
class node_windows_app,node_connection_listener,node_settings_sync,node_cursor_control,node_controller_mode,node_media_modes toneAmber
class node_wifi_tcp,node_bluetooth_rfcomm toneMint
class node_pc_pointer toneIndigo
```

## Components

### Android app

- **Android app**
- **PC discovery**
- **Motion sensing**
- **Motion processing**
- **Phone controls**
- **Android settings**
- **Background service**

### Windows app

- **Windows app**
- **Connection listener**
- **Settings sync**
- **Cursor control**
- **Controller mode**
- **Media and presentation**

### Connectivity

- **Wi-Fi TCP**
- **Bluetooth RFCOMM**

### Other components

- **Phone user**
- **PC user**
- **PC cursor**

## Connections

- Phone user → Android app: uses
- PC user → Windows app: uses
- Android app → PC discovery: discovers PCs
- PC discovery → Wi-Fi TCP: discovers over
- PC discovery → Bluetooth RFCOMM: discovers over
- Windows app → Connection listener: starts
- Android app → Wi-Fi TCP: connects over
- Android app → Bluetooth RFCOMM: connects over
- Motion sensing → Motion processing: provides sensor motion
- Android app → Motion sensing: reads
- Android app → Phone controls: offers
- Phone controls → Android settings: adjusts
- Android settings → Settings sync: syncs settings
- Settings sync → Android settings: updates settings
- Windows app → Settings sync: provides settings
- Motion processing → Wi-Fi TCP: sends motion
- Motion processing → Bluetooth RFCOMM: sends motion
- Phone controls → Wi-Fi TCP: sends commands
- Phone controls → Bluetooth RFCOMM: sends commands
- Connection listener → Wi-Fi TCP: listens over
- Connection listener → Bluetooth RFCOMM: listens over
- Windows app → Cursor control: handles input
- Cursor control → PC cursor: moves
- Windows app → Controller mode: provides
- Windows app → Media and presentation: provides
- Android app → Background service: runs as
- Background service → Motion sensing: reads motion
