From feee9229fa156a5ea206be4c8889bf95616f0162 Mon Sep 17 00:00:00 2001 From: ddidderr Date: Sun, 7 Dec 2025 08:18:25 +0100 Subject: [PATCH] claude: updated CLAUDE.md --- CLAUDE.md | 46 +++++++++++++++++----------------------------- 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 48e41e9..eae4548 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -17,7 +17,7 @@ cargo tauri dev # Debug build for very quick testing (without bundle) cargo tauri build --debug --no-bundle -# Relase build for testing (without bundling) +# Release build for testing (without bundling) cargo tauri build --no-bundle # Production (with bundling) @@ -62,6 +62,13 @@ cargo test -- --nocapture deno outdated --update --latest ``` +### Wayland Users + +```bash +# Set this environment variable if running on Wayland +WEBKIT_DISABLE_DMABUF_RENDERER=1 +``` + ## Architecture LanSpread follows a layered, modular architecture with clear separation of concerns: @@ -89,13 +96,16 @@ The project is organized as a Cargo workspace with 7 crates: - Converts `EtiGame` structs to modern `Game` struct **Core P2P Engine:** -- **lanspread-peer**: (~97KB) Central orchestration for all P2P functionality - - QUIC-based networking with length-delimited frame codec (`tokio-util`) - - Manages peer-to-peer connections and game synchronization - - Handles file streaming with chunk transfers and path validation +- **lanspread-peer**: Central orchestration for all P2P functionality + - Entry point: `start_peer()` in `lib.rs` - Communicates via unbounded channels (`PeerEvent`, `PeerCommand`) - - Implements retry logic for requesting games from peers - - Entry point: `start_peer()` function + - Key modules: + - `services.rs`: Background tasks (server, discovery, ping, local game monitor) + - `handlers.rs`: Command handlers for UI requests + - `network.rs`: QUIC connection management with length-delimited frames + - `download.rs`: Chunked file transfer logic + - `peer_db.rs`: Peer tracking and game availability + - `path_validation.rs`: Security for file operations **Application Layer:** - **lanspread-tauri-deno-ts**: Tauri desktop application @@ -174,25 +184,3 @@ File transfers validate paths to prevent directory traversal attacks. All file o **Why not Tauri + Leptos?** Leptos adds unnecessary complexity. Tauri is designed to transfer backend Rust to frontend JavaScript world, but with Leptos the frontend becomes Rust, creating a double translation. The current Tauri + Deno/TypeScript approach is cleaner. **Why Tauri?** Simple setup, easy development with `cargo tauri dev`, easy testing and bundling with installers, small final binary (~13MB). - -## File Organization - -``` -crates/ -├── lanspread-db/ # Core data models -├── lanspread-utils/ # Macros & utilities -├── lanspread-proto/ # Protocol definitions -├── lanspread-compat/ # Legacy ETI compatibility -├── lanspread-mdns/ # mDNS discovery -├── lanspread-peer/ # P2P engine (largest, most complex) -└── lanspread-tauri-deno-ts/ - ├── src-tauri/ # Rust Tauri backend - └── (sibling dirs) # Deno/TypeScript frontend code -``` - -## Additional Resources - -- **README.md**: Build and development prerequisites -- **LESSONS_LEARNED.md**: Architectural decisions and trade-offs -- **AGENTS.md**: Code quality guidelines -- **TODO.md**: Tracked work items