3.5 KiB
3.5 KiB
Butterfly Desktop Environment — Progress
Overview
A remote desktop environment with a Rust (Actix) backend and Angular 21 frontend. The system mimics a traditional Windows-like desktop in the browser, receiving display/audio from VM agents with minimal lag.
Architecture
┌─────────────┐ WebSocket ┌──────────────────┐ WebSocket ┌─────────────┐
│ Angular 21 │◄──────────────────►│ Rust Actix Server│◄──────────────────►│ VM Agent exe │
│ (Browser) │ display/audio │ (REST + WS) │ display/audio │ (Rust) │
│ │ HUD commands │ │ HUD commands │ │
└─────────────┘ └──────────────────┘ └─────────────┘
Checklist
Phase 1: Rust Backend ✅ (compiles)
server/Cargo.toml— Dependencies: actix-web 4, actix-ws 0.4, actix-cors, dashmap, parking_lot, serde, uuid, chronoserver/src/main.rs— Actix HTTP server with CORS, compression, static file serving, SPA fallbackserver/src/config.rs— Env-based config (BUTTERFLY_HOST, BUTTERFLY_PORT, etc.)server/src/models.rs— Session, AgentConnection, WsMessage enum (serde-tagged), ApiResponse, HealthInfoserver/src/state.rs— AppState with DashMap sessions/agents, FrameBuffer ring buffer for late-joinersserver/src/api/— REST endpoints: GET/POST/DELETE /api/sessions, GET /api/health, POST /api/sessions/{id}/hudserver/src/ws/— WebSocket handler: agent/viewer connect, display/audio frame relay, HUD forwarding, heartbeat timeoutserver/src/stream/— StreamStats tracker (frame count, byte relay, uptime)server/static/index.html— Placeholder loading page- Compiles with
cargo check(warnings only for future-use types)
Phase 2: Angular 21 Frontend 🔲 (next)
- Project scaffold with Angular CLI
- Windows-like desktop shell (taskbar, start menu, window manager)
- Remote display component (WebSocket frame rendering)
- Audio playback component
- HUD overlay (mouse/keyboard forwarding)
- Built-in apps: File Explorer, Terminal, Settings, Text Editor, Browser
Phase 3: VM Agent Executable 🔲
- Rust desktop agent that captures display and audio
- Streams display frames (JPEG/PNG) and audio (Opus/PCM) via WebSocket
- Receives HUD commands (mouse, keyboard, resize)
- Low-latency design for LAN usage
Phase 4: Integration & Polish 🔲
- End-to-end testing (agent → server → browser)
- Session management UI
- Multi-session support
- Authentication (JWT)
- Performance optimization
Recent Commits
bae17aeserver: fix pong bytes reference — backend compiles2e55d5cserver: add .gitignore, fix compile errors0c35db1server: main.rs — Actix entry pointb2f4f7fserver: fix Cargo.toml dependency versions94a992dserver: api/sessions.rs — CRUD endpointsa0b834eserver: stream/ — StreamStats tracker74591a4server: ws/handler.rs — WebSocket handler40bf516server: api/health.rs843c7bbserver: api/mod.rse00fbf4server: ws/mod.rsff476f1server: state.rs — AppStatefdde57cserver: config.rs5c8f848server: models.rsbf8e9f7server: Cargo.toml