How namidev-79/selyh-desktop works
Selyh is a Tauri desktop agent that lives in the system tray and surfaces check-ins, scales, and guided exercises during suitable pauses. The user journey runs from device pairing and setup through scheduled prompts, local-first responses, and optional synchronization; the dashboard exposes status, history, transparency, and preferences. Rust owns credentials, API access, scheduling, and local storage, while React windows call the core through a typed command bridge. The README documents major capabilities not fully visible in the excerpts; edges for those flows cite the README, and unsampled implementation details are not inferred.
Main entry points: main.tsx Window view router · Dashboard.tsx Dashboard · agent.ts Typed command bridge · api.rs Authenticated API client
Components 22
Desktop experience
- Window view router
src/main.tsx - Device onboarding
src/windows/onboarding/Onboarding.tsx - Check-in window
src/windows/checkin/Checkin.tsx - Scale window
src/windows/scale/Scale.tsx - Exercise window
src/windows/exercise/Exercise.tsx - Dashboard
src/windows/dashboard/Dashboard.tsx - Shared UI and copy
src/components/ui.tsx - Typed command bridge
src/lib/agent.ts
Agent runtime
- Tauri commands
src-tauri/src/commands.rs - Tray and windows
src-tauri/src/tray.rs - Shared agent state
src-tauri/src/state.rs - Service configuration
src-tauri/src/config.rs
API and storage
- Device pairing
src-tauri/src/auth.rs - Authenticated API client
src-tauri/src/api.rs - System keychain
src-tauri/src/keychain.rs - Offline sync store
src-tauri/src/sync.rs
Wellbeing features
- Prompt scheduler
src-tauri/src/scheduler.rs - Idle and busy detection
src-tauri/src/activity.rs - Passive daily sensor
src-tauri/src/sensor.rs
Other components
- User
- Selyh web
- Selyh API
Connections 41
- User → Window view router: opens app
src/main.tsx - Window view router → Device onboarding: routes view
src/main.tsx - Window view router → Check-in window: routes view
src/main.tsx - Window view router → Scale window: routes view
src/main.tsx - Window view router → Exercise window: routes view
src/main.tsx - Window view router → Dashboard: routes view
src/main.tsx - Device onboarding → Typed command bridge: invokes commands
src/lib/agent.ts - Check-in window → Typed command bridge: invokes commands
src/lib/agent.ts - Scale window → Typed command bridge: invokes commands
src/lib/agent.ts - Exercise window → Typed command bridge: invokes commands
src/lib/agent.ts - Dashboard → Typed command bridge: invokes commands
src/lib/agent.ts - Device onboarding → Shared UI and copy: renders
src/windows/onboarding/Onboarding.tsx - Check-in window → Shared UI and copy: renders
src/windows/checkin/Checkin.tsx - Scale window → Shared UI and copy: renders
src/windows/scale/Scale.tsx - Exercise window → Shared UI and copy: renders
src/windows/exercise/Exercise.tsx - Dashboard → Shared UI and copy: renders
src/windows/dashboard/Dashboard.tsx - Typed command bridge → Tauri commands: invokes
src/lib/agent.ts - User → Selyh web: approves pairing
README.md - Device onboarding → Device pairing: starts pairing
README.md - Device pairing → Selyh API: requests device token
README.md - Device pairing → Authenticated API client: uses client
src-tauri/src/auth.rs - Authenticated API client → System keychain: loads and saves tokens
src-tauri/src/api.rs - Authenticated API client → Service configuration: uses API URL
src-tauri/src/api.rs - Tauri commands → Authenticated API client: calls API
README.md - Authenticated API client → Selyh API: HTTP requests
README.md - Tauri commands → Offline sync store: flushes queued data
src-tauri/src/commands.rs - Offline sync store → Selyh API: posts sync batches
README.md - Tauri commands → Prompt scheduler: snoozes prompts
src-tauri/src/commands.rs - Prompt scheduler → Idle and busy detection: checks idle and busy
src-tauri/src/scheduler.rs - Prompt scheduler → Tray and windows: shows prompt windows
src-tauri/src/scheduler.rs - Prompt scheduler → Selyh API: requests next prompt
README.md - Passive daily sensor → Idle and busy detection: measures inactivity
src-tauri/src/sensor.rs - Passive daily sensor → Shared agent state: checks consent state
src-tauri/src/sensor.rs - Passive daily sensor → Offline sync store: stores daily summaries
README.md - User → Tray and windows: uses tray menu
README.md - Tray and windows → Dashboard: opens panel
src-tauri/src/tray.rs - Check-in window → Offline sync store: queues response
README.md - Scale window → Selyh API: saves progress
README.md - Exercise window → Selyh API: sends response
README.md - Dashboard → Offline sync store: reads check-in history
- Dashboard → Passive daily sensor: views signal summary
README.md