How seven-ljy77/desktop-pet works
Desktop Pet is a Windows/macOS desktop companion whose hover or short-click interaction fetches dynamic text and displays it in a separate bubble; dragging, tray controls, and pet settings are additional user flows. The desktop UI invokes Tauri commands, which bridge to the FastAPI interaction endpoint; the service selects fresh copy from a JSON file and returns presentation hints. The README also documents Caddy-based production routing. Some platform and deployment internals are represented at their enclosing directory because their source was not sampled.
Main entry points: lib.rs Tauri app commands · main.py Interaction API · main.ts Pet interaction UI · api.ts Tauri client API
Components 16
Desktop experience
- Pet interaction UI
apps/desktop/src/main.ts - Bubble and settings views
apps/desktop/src/main.ts - Tauri client API
apps/desktop/src/api.ts - Interaction timing
apps/desktop/src/config.ts
Tauri runtime
- Tauri app commands
apps/desktop/src-tauri/src/lib.rs - HTTP interaction client
apps/desktop/src-tauri/src/interaction.rs - Window and pet state
apps/desktop/src-tauri/src/windows.rs - Tray controls
apps/desktop/src-tauri/src/tray.rs - Platform window setup
apps/desktop/src-tauri/src/platform
Interaction service
- Interaction API
services/api/app/main.py - Request and response models
services/api/app/models.py - Copy selection
services/api/app/interaction_service.py - Dynamic message catalog
services/api/app/data/messages.json
Production access
- Caddy proxy
deploy
Other components
- Pet user
- Desktop client
Connections 20
- Pet user → Pet interaction UI: hovers or clicks
README.md - Pet interaction UI → Interaction timing: uses timing
apps/desktop/src/main.ts - Pet interaction UI → Tauri client API: invokes commands
apps/desktop/src/main.ts - Tauri client API → Tauri app commands: invokes Tauri
apps/desktop/src/api.ts - Tauri app commands → HTTP interaction client: dispatches request
apps/desktop/src-tauri/src/lib.rs - HTTP interaction client → Interaction API: posts interaction
README.md - Interaction API → Copy selection: creates response
services/api/app/main.py - Interaction API → Request and response models: validates payload
services/api/app/main.py - Copy selection → Request and response models: builds response
services/api/app/interaction_service.py - Copy selection → Dynamic message catalog: reads copy
README.md - Tauri app commands → Window and pet state: manages windows
apps/desktop/src-tauri/src/lib.rs - Tauri app commands → Platform window setup: configures platform
apps/desktop/src-tauri/src/lib.rs - Tauri app commands → Tray controls: creates tray
apps/desktop/src-tauri/src/lib.rs - Tray controls → Window and pet state: resets position
apps/desktop/src-tauri/src/tray.rs - Tauri client API → Tauri app commands: requests bubble and settings
apps/desktop/src/api.ts - Tauri app commands → Window and pet state: shows or hides bubble
apps/desktop/src-tauri/src/lib.rs - Pet interaction UI → Bubble and settings views: renders bubble view
apps/desktop/src/main.ts - Interaction API → Desktop client: serves HTTP
README.md - Desktop client → Caddy proxy: routes production traffic
README.md - Caddy proxy → Interaction API: forwards requests
README.md