Electron + React desktop application for sharing clipboard contents across devices.
- Cross-platform clipboard sharing between multiple devices
- οΏ½οΈ Enhanced Image Support - Copy and paste images seamlessly across devices with metadata preservation
- π Text & Rich Content - Full Unicode text support with automatic encoding handling
- Real-time WebSocket communication for instant updates
- Live client connection monitoring with connected devices display
- Modern React UI with Material-UI components and enhanced notifications
- Python backend with Flask and WebSocket support
- Intelligent fallback system - Gracefully degrades to text-only mode when image support unavailable
- Comprehensive test coverage with 100% test success rate
- High-quality code with automated linting and formatting
- Native Windows/macOS executables via GitHub Actions CI/CD
- Backward compatibility with text-only clients
The project uses GitHub Actions to build native Windows x64 executables:
# Download latest Windows executables using GitHub CLI
./scripts/download-windows-executables.sh
# Then build the Windows installer
./scripts/build-win11.shThe Windows build script automatically tries to download pre-built executables:
# This will automatically download Windows executables if available
./scripts/build-win11.sh- Go to the Releases page
- Download
clipbridge-windows-x64.zip - Extract to
dist/python-standalone/ - Run
./scripts/build-win11.sh
- True Windows compatibility: Built on Windows runners, not cross-compiled
- Proper x64 architecture: Native Windows x64 executables
- No compatibility errors: Eliminates "not compatible with Windows" issues
- Automated builds: Fresh executables with every code change
- Node.js 18+
- Python 3.9+
# Install Node.js dependencies
npm install
# Set up Python environment
cd utils
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
cd ..
# Enhanced image clipboard support is automatically enabled when available
# On Windows: pywin32 provides better clipboard integration
# On macOS/Linux: Pillow handles image processing
# Automatic fallback to text-only mode if image dependencies unavailable# Start the full application (React + Electron)
npm start
# Or start components separately
npm run react-start # React dev server
npm run electron-start # Electron appTo test the Connected Clients feature, you can use the demo script:
# Start the server first through the app UI, then run:
cd utils
source .venv/bin/activate
python demo_clients.py 3 # Simulate 3 test clients
# Or specify custom port
python demo_clients.py 2 8001 # 2 clients on port 8001This will simulate multiple clients connecting to your server, allowing you to see the Connected Clients UI in action.
ClipBridge now supports full image clipboard sharing across devices with the following capabilities:
- PNG - Lossless compression, transparency support
- JPEG - Compressed images with excellent compatibility
- BMP - Windows bitmap format
- GIF - Animated and static GIFs (static only for clipboard)
- Enhanced Mode: Automatic image detection and transfer when dependencies available
- Text-Only Mode: Graceful degradation when image support unavailable (CI environments)
- Backward Compatibility: Works seamlessly with older text-only clients
- Metadata Preservation: Image size, format, and properties maintained
- Efficient Transfer: Base64 encoding with size optimization
- Error Handling: Robust error recovery with detailed logging
- Platform Integration: Native clipboard API integration on Windows/macOS
# Copy an image on Windows β Automatically appears on Mac
# Copy a screenshot on Mac β Instantly available on Windows
# Mixed content workflows supported (text + images)- Recommended: Under 10MB for optimal performance
- Maximum: Limited by available system memory
- Auto-notification: Size warnings for large images in UI
If you encounter this error when starting the app:
# First, build the project to create the build directory
npm run build
# Then start the application
npm startThe build process creates the necessary build/electron.js file that Electron needs for production builds.
This error indicates a proxy authentication issue. Try these solutions:
-
Disable proxy for local connections:
# On Windows, temporarily disable proxy # Go to Settings > Network & Internet > Proxy > Turn off "Use a proxy server"
-
Check network connectivity:
# Test if the Mac server is reachable curl http://[MAC_IP]:8000/ # Or use telnet to test the port telnet [MAC_IP] 8000
-
Firewall issues:
- Make sure port 8000 is open on both devices
- Check if Windows Firewall or Mac Firewall is blocking the connection
- Try running on a different port:
PORT=8001 python server.py
-
Network configuration:
- Ensure both devices are on the same network
- Check if VPN is interfering with local connections
- Try using the Mac's IP address instead of 'localhost'
β All Tests Passing: 130/130 tests (100% success rate)
- JavaScript Tests: 74/74 passing with 84.37% statement coverage
- Python Tests: 56/56 passing with comprehensive edge case coverage
- Integration Tests: Full application workflow testing
- Code Quality: All flake8 and ESLint checks passing
# Quick test run (all platforms)
npm test -- --watchAll=false # JavaScript tests
python -m pytest utils/ -q # Python tests
# Full test suite with coverage
npm test -- --coverage --watchAll=false
python -m pytest utils/ --cov=. --cov-report=html- Component Tests: DeviceCard, App core functionality
- Integration Tests: Full application workflows, tab navigation, error handling
- Enhanced Coverage: Edge cases, accessibility, rapid state changes
- Performance Tests: Stress testing and stability validation
- Unit Tests: Server and client functionality
- Integration Tests: Client-server communication flows
- Edge Case Tests: Error handling, timeout scenarios, connection issues
- Mock Testing: WebSocket, HTTP requests, clipboard operations
# Python code quality
flake8 utils/*.py --count --select=E9,F63,F7,F82 --show-source --statistics
# JavaScript code quality
npm run lint# Clean build React app
npm run build:clean # Clean previous builds and rebuild
# Build distribution packages (outputs only .dmg and .exe files)
npm run dist:mac # Build ARM64 DMG for macOS (Apple Silicon)
npm run dist:win11 # Build x64 EXE for Windows
npm run dist:official # Build both platforms with cleanup
# Manual cleanup commands
npm run clean:temp # Remove temporary build files
npm run clean:artifacts # Keep only .dmg and .exe files in dist/electron/After building, you'll find only these files in dist/electron/:
ClipBridge-0.1.0-arm64.dmg- macOS installer for Apple SiliconClipBridge Setup 0.1.0.exe- Windows installer for x64
All other build artifacts (directories, config files, block maps) are automatically removed.
This project maintains high code quality through:
- Automated Testing: Comprehensive test suites for all components
- Code Linting: flake8 for Python, ESLint for JavaScript
- Test Coverage: 84%+ statement coverage for JavaScript, comprehensive Python coverage
- Integration Testing: Full application workflow validation
- Edge Case Testing: Error handling and boundary condition testing
- Test Files: 6 test suites
- Test Cases: 74 comprehensive tests
- Coverage: 84.37% statements, 83.17% branches, 76.19% functions
- Components Tested: App, DeviceCard, main process, preload script
- Integration Tests: 9 full workflow tests
- Test Files: 4 test modules
- Test Cases: 56 comprehensive tests
- Coverage Areas: Server, client, integration, edge cases
- Mock Testing: WebSocket, HTTP, clipboard operations
- Error Scenarios: Comprehensive error handling validation
- β Enhanced Image Clipboard Support - Full image copy/paste with metadata preservation
- β Smart Fallback System - Graceful degradation to text-only mode when needed
- β Picture Notification Fixes - Resolved image display issues in UI notifications
- β Signal Error Resolution - Fixed client signal handling for graceful shutdowns
- β Fixed all Python test failures (6 β 0 failures)
- β Enhanced JavaScript test coverage (+17% improvement)
- β Added comprehensive integration testing
- β Resolved all flake8 code quality issues
- β Achieved 100% test success rate across all platforms
- β Streamlined build process with automatic cleanup
- β Optimized for Apple Silicon (ARM64) and Windows x64
- Electron: Desktop application framework
- React: UI library with comprehensive testing
- Material-UI: Component library with accessibility support
- Jest + React Testing Library: Testing framework with 74 tests
- Python: Core language with type hints and best practices
- Flask: Web framework with REST API support
- WebSocket: Real-time communication with gevent
- pytest: Testing framework with 56 comprehensive tests
- ESLint: JavaScript code quality and consistency
- flake8: Python code quality and PEP 8 compliance
- Coverage.py: Python test coverage reporting
- Jest Coverage: JavaScript test coverage reporting
βββ src/ # Electron + React source
β βββ main.js # Electron main process
β βββ preload.js # Electron preload script
β βββ renderer/ # React application
β β βββ App.jsx # Main application component
β β βββ components/ # Reusable UI components
β β βββ __tests__/ # Frontend test suites
βββ utils/ # Python backend
β βββ server.py # Flask server with WebSocket support
β βββ client.py # WebSocket client implementation
β βββ tests/ # Python test suite (56 tests)
β β βββ test_server.py # Server functionality tests
β β βββ test_client.py # Client functionality tests
β β βββ test_integration.py # Integration tests
β β βββ test_edge_cases.py # Edge case and error handling tests
β βββ requirements.txt # Python dependencies
βββ config/ # Configuration files
β βββ electron-builder.json # Electron packaging configuration
β βββ eslint.config.mjs # ESLint rules and settings
β βββ jsconfig.json # JavaScript/TypeScript project settings
β βββ jest.config.json # Jest testing framework configuration
β βββ pyproject.toml # Python project configuration
βββ scripts/ # Build and automation scripts
βββ package.json # Node.js dependencies and scripts
βββ jsconfig.json # β config/jsconfig.json (symlink)
βββ eslint.config.mjs # β config/eslint.config.mjs (symlink)
βββ README.md # This documentation
Note: Some config files (jsconfig.json, eslint.config.mjs) have symlinks in the root directory for tool compatibility, but the actual files are organized in the
config/folder.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and add tests
- Ensure all tests pass:
npm test -- --watchAll=false python -m pytest utils/ -q - Check code quality:
npm run lint flake8 utils/*.py --count --select=E9,F63,F7,F82 --show-source --statistics - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Submit a pull request
- All new code must include comprehensive tests
- Python code must pass flake8 linting
- JavaScript code must pass ESLint checks
- Test coverage should be maintained or improved
- Integration tests should be added for new features
- Testing: Write tests for all new features and bug fixes
- Documentation: Update README and inline documentation
- Code Style: Follow existing patterns and linting rules
- Git Commits: Use clear, descriptive commit messages
- Pull Requests: Include test results and coverage information
- Testing Guide - Comprehensive test suite documentation
- GitHub Actions - CI/CD workflow documentation
- Packaging Guide - Application distribution and packaging
This project is licensed under the MIT License. See the LICENSE file for details.