# Leptos ShadCN UI Comprehensive Demo v0.9.1 A comprehensive demo showcasing all refactored Leptos ShadCN UI components with automated testing and port conflict resolution. ## πŸš€ Quick Start ### Option 1: All-in-One Build & Test ```bash cd examples/comprehensive-demo ./scripts/build-and-test.sh ``` ### Option 2: Step-by-Step ```bash # Install dependencies npm install # Build WASM components npm run build # Start server (handles port conflicts automatically) npm run serve # Run tests in another terminal npm run test ``` ## 🎯 What's Showcased ### βœ… Refactored Components (v0.9.1) 1. **Drawer Component** - Refactored from 15k to 12k bytes with 9 focused modules 2. **Context Menu Component** - Refactored from 13k to 14.8k bytes with 8 focused modules 3. **Alert Dialog Component** - Refactored from 12k to 9.5k bytes with 7 focused modules 4. **Select Component** - Refactored and modularized with improved structure 5. **Command Component** - Fixed compilation errors and improved structure ### πŸ§ͺ Comprehensive Testing - **Playwright Integration** - Automated testing across multiple browsers - **Component Integration Tests** - Tests all refactored components - **Responsive Testing** - Mobile and desktop compatibility - **Accessibility Testing** - Keyboard navigation and ARIA attributes - **Performance Testing** - Load times and component responsiveness ## πŸ› οΈ Port Conflict Resolution The demo includes intelligent port management: ### Automatic Port Detection - **Port Range**: 3000-3100 (configurable) - **Conflict Resolution**: Automatically finds available ports - **Health Checks**: Built-in health monitoring - **API Endpoints**: Demo information and status ## 🎭 Playwright Testing ### Test Commands ```bash # Run all tests npm run test # Run tests with UI npm run test:ui # Run tests in headed mode npm run test:headed # Debug tests npm run test:debug ``` ## πŸ—οΈ Architecture ### Server Architecture ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ WASM Build │───▢│ Express Server │───▢│ Playwright β”‚ β”‚ (Rust) β”‚ β”‚ (Node.js) β”‚ β”‚ Tests β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` ## πŸ“Š Features ### Interactive Components - **Real-time Counter** - Demonstrates reactive state management - **Drawer Component** - Shows refactored drawer with improved organization - **Context Menu** - Right-click functionality with refactored context menu - **Alert Dialog** - Modal dialogs with refactored alert dialog component - **Theme Switching** - Dark/light mode toggle - **Form Input** - Live input with reactive state ### Technical Features - **WASM Components** - All components compiled to WebAssembly - **Port Conflict Resolution** - Automatic port detection and management - **Health Monitoring** - Built-in health checks and status endpoints - **API Integration** - Demo information and component status APIs - **Responsive Design** - Mobile and desktop compatibility - **Accessibility** - Keyboard navigation and ARIA compliance ## πŸš€ Production Ready This demo is production-ready with: - βœ… **Zero Regressions** - All components work perfectly - βœ… **Comprehensive Testing** - Automated test coverage - βœ… **Port Management** - Conflict resolution - βœ… **Performance Optimized** - Fast loading and rendering - βœ… **Accessibility Compliant** - WCAG guidelines - βœ… **Mobile Responsive** - Works on all devices