How mahammed-gaber/pixmirror works
PixMirror is a Windows desktop app for mirroring and controlling Android phones over USB. The main workflow detects ADB devices, lets the user select a phone and mirroring options, then starts a scrcpy session; a separate toolbar provides controls, screenshots, and recording. Settings, device diagnostics, performance presets, screen-off control, and localization are supporting capabilities. The frontend-to-backend command boundary is documented by Tauri command registration, but many command implementations were not sampled, so those links are shown as unverified.
Main entry points: ConnectPage.tsx Connect screen · ToolbarPage.tsx Toolbar screen · service.rs Mirror service · useMirrorSession.ts Session lifecycle
Components 22
Connect and devices
- App routing
src/app/App.tsx - Connect screen
src/pages/connect/ConnectPage.tsx - Device discovery UI
src/features/devices/components/ConnectGuide.tsx - Device polling
src/features/devices/hooks/useDevices.ts - Device API
src/features/devices/api.ts - Live device stats
src/features/devices/hooks/useDeviceStats.ts
Mirroring session
- Mirror preferences
src/features/mirroring/hooks/useDevicePrefs.ts - Performance presets
src/features/mirroring/components/PresetPicker.tsx - Session lifecycle
src/features/mirroring/hooks/useMirrorSession.ts - Mirroring API
src/features/mirroring/api.ts
Capture and controls
- Toolbar screen
src/pages/toolbar/ToolbarPage.tsx - Mirror toolbar
src/features/toolbar/components/MirrorToolbar.tsx - Capture actions
src/features/capture/hooks/useRecording.ts - Capture API
src/features/capture/api.ts - Save directory settings
src/features/settings/components/SettingsDialog.tsx
Rust backend
- Tauri command registry
src-tauri/src/lib.rs - ADB device commands
src-tauri/src/devices/commands.rs - Mirror service
src-tauri/src/mirror/service.rs - scrcpy process
src-tauri/src/mirror/scrcpy.rs - Settings persistence
src-tauri/src/settings/store.rs - ADB device bridge
src-tauri/src/shared/adb.rs
Other components
- User
Connections 25
- User → Connect screen: selects phone
README.md - Connect screen → Device polling: lists devices
src/pages/connect/ConnectPage.tsx - Device polling → Device API: requests list
src/features/devices/hooks/useDevices.ts - Connect screen → Live device stats: polls stats
src/pages/connect/ConnectPage.tsx - Live device stats → Device API: requests stats
src/features/devices/hooks/useDeviceStats.ts - Connect screen → Mirror preferences: loads preferences
src/pages/connect/ConnectPage.tsx - Connect screen → Performance presets: chooses preset
src/pages/connect/ConnectPage.tsx - Connect screen → Session lifecycle: starts session
src/pages/connect/ConnectPage.tsx - App routing → Session lifecycle: tracks status
src/app/App.tsx - Session lifecycle → Mirroring API: starts and polls
src/features/mirroring/hooks/useMirrorSession.ts - App routing → Connect screen: shows when idle
src/app/App.tsx - App routing → Toolbar screen: shows when active
src/app/App.tsx - Toolbar screen → Mirror toolbar: renders controls
src/pages/toolbar/ToolbarPage.tsx - Toolbar screen → Capture actions: controls recording
src/pages/toolbar/ToolbarPage.tsx - Capture actions → Capture API: invokes capture
src/features/capture/hooks/useRecording.ts - Toolbar screen → Session lifecycle: stops session
src/pages/toolbar/ToolbarPage.tsx - Connect screen → Save directory settings: opens settings
src/pages/connect/ConnectPage.tsx - Tauri command registry → ADB device commands: registers commands
src-tauri/src/lib.rs - Tauri command registry → Mirror service: registers commands
src-tauri/src/lib.rs - Mirror service → scrcpy process: uses process
src-tauri/src/mirror/service.rs - Mirror service → Settings persistence: reads settings
src-tauri/src/mirror/service.rs - ADB device commands → ADB device bridge: uses ADB
- Device API → ADB device commands: calls device commands
- Mirroring API → Mirror service: calls mirror commands
- Capture API → Tauri command registry: calls capture commands