A comprehensive web-based interface for the ESP32 Rainbow hardware - a ZX Spectrum clone built using the ESP32 microcontroller. This website provides file management, real-time communication, and development tools specifically designed for the ESP32 Rainbow.
🌐 Live Site: https://esp32rainbow.com
🔧 Firmware Source: https://github.com/atomic14/esp32-zxspectrum
🔩 Hardware Design: https://github.com/atomic14/esp32-zxspectrum-hardware
🛒 Where can I get one?: https://www.crowdsupply.com/atomic14/esp32-rainbow
The ESP32 Rainbow Website provides a modern web interface for managing and developing with the ESP32 Rainbow hardware. The ESP32 Rainbow is a ZX Spectrum clone that recreates the classic computer experience using modern ESP32 technology.
- Flash File System Browser - Manage files on ESP32 Rainbow's flash storage
- ZX Spectrum Emulator - Full emulation with WASM integration
- Game Database - 13,000+ games from ZXDB with advanced search
- Real-time Serial Communication - Direct WebSerial API communication
- Development Tools - File conversion utilities (TAP to WAV, SCR to PNG)
- File Management - Create, edit, delete, and rename files and directories
- A modern web browser that supports WebSerial API (Chrome, Edge)
- ESP32 Rainbow hardware with the appropriate firmware flashed
Clone the repository and install dependencies:
git clone <repository-url>
cd esp32-rainbow-website
npm install
npm run dev # Runs both Vite dev server and Cloudflare Worker
npm run dev:vite # Vite dev server only (with --host)
npm run dev:worker # Cloudflare Worker dev server only
npm run build # TypeScript compilation + Vite build
npm run lint # ESLint with TypeScript rules
npm run test # Jest testing
npm run preview # Preview production build
- Connect to Device - Use the "Connect" button to establish WebSerial connection
- Browse Files - Navigate the ESP32 Rainbow's file system
- Play Games - Access 13,000+ ZX Spectrum games through the emulator
- Manage Files - Create, edit, and organize files on the device
- Use Tools - Convert files between different formats
- React 18 with TypeScript for the frontend
- Vite for build tooling and development
- Tailwind CSS for styling
- Cloudflare Workers for proxy functionality
- WebSerial API for ESP32 device communication
The application uses a sophisticated device communication layer:
- Device.ts - Main device class handling serial communication
- MessageHandler.ts - Custom binary message protocol implementation
- Messages/ - Type-safe message classes for device operations
- DeviceProvider.tsx - React context for device state management
Communication Protocol:
- Custom binary protocol over WebSerial API
- File operations (read, write, delete, rename, list)
- Flash and SD card storage support
- Real-time processing with 1ms intervals
- Automatic reconnection capabilities
Main Pages:
- Home - Landing page with marketing content
- Games - Game browser with search/filtering
- Emulator - Full ZX Spectrum emulator with WASM integration
- File Browser - Device file management interface
- Tools - Conversion utilities
- Documentation - FAQ, Quick Start, Firmware updates
- Paginated JSON data in
/public/data/
(50 games per page) - FlexSearch integration for fast text search
- Genre filtering with 13 categories
- Alphabetical navigation with letter-based routing
- Python scripts in
/scripts/
for data generation from ZXDB
- zx_emulator4.wasm - ZX Spectrum emulator core
- tap_to_z80.wasm - TAP file to Z80 snapshot conversion
- tap_to_audio.wasm - TAP file to audio conversion
- react (18.3.1) - UI framework
- react-router-dom (7.0.2) - Client-side routing
- typescript (5.6.2) - Type safety
- esptool-js (0.4.7) - ESP32 tool integration
- crypto-js (4.2.0) - Cryptographic utilities
- vite (6.0.1) - Build tool and dev server
- wrangler (4.12.0) - Cloudflare Workers development
- concurrently (9.1.0) - Run multiple commands
- jszip (3.10.1) - ZIP file handling
- flexsearch (0.7.43) - Full-text search
- @ffmpeg/ffmpeg (0.12.15) - Audio/video processing
All device operations use typed message classes:
const message = new ReadFileMessage(filename);
await device.sendMessage(message);
Device state is managed through React context:
const { device, isConnected, version } = useDevice();
Components are organized by feature with clear separation:
- Device-aware components use DeviceProvider context
- Reusable UI components in
/src/components/
- Page-specific components in
/src/pages/
/src/main.tsx
- React application bootstrap/src/App.tsx
- Main router configuration/src/context/DeviceProvider.tsx
- Device state management/src/device/
- Device communication layer
/package.json
- Build scripts and dependencies/tsconfig.json
- TypeScript configuration/vite.config.ts
- Vite build configuration/wrangler.toml
- Cloudflare Worker configuration/tailwind.config.js
- Tailwind CSS configuration
/public/data/
- Game database (paginated JSON)/public/wasm/
- WebAssembly modules/scripts/
- Python data generation scripts
The flash file browser is a core feature that allows direct management of files on the ESP32 Rainbow's flash storage through your web browser.
- Browse directories on ESP32 flash storage
- Create, edit, and delete files
- Create and delete directories
- Rename files and directories
- View file information (size, last modified date)
- Edit text files directly in the browser
The communication between the frontend and ESP32 Rainbow uses a custom message protocol:
ListFolder
- Browse directoriesReadFile
- Read file contentsWriteFile
- Create or update filesDeleteFile
- Delete files or directoriesMakeDirectory
- Create new directoriesRenameFile
- Rename files or directoriesGetFileInfo
- Get metadata about files
- Full ZX Spectrum emulation via WASM
- Virtual keyboard with visual feedback
- Game loading from ZIP archives
- 48K/128K machine support
- Save state functionality
- Direct WebSerial API communication with ESP32 devices
- File system browsing on device
- Real-time file operations with progress tracking
- Automatic device detection and reconnection
- 13,000+ games from ZXDB integration
- Advanced search with FlexSearch
- Genre categorization and filtering
- Optimized pagination for performance
- Jest configured for testing
- ESLint with TypeScript and React rules
- Husky configured for git hooks
npm run test # Run Jest tests
npm run lint # Run ESLint
- Static hosting with Vite-generated assets
- Cloudflare Workers for proxy functionality
- CDN optimization for game data and WASM files
- WebSerial API requires HTTPS for device communication
npm run build # Creates optimized production build
npm run preview # Preview production build locally
This project uses modern web technologies and follows React best practices. Key development principles:
- TypeScript for type safety
- Message-based architecture for device communication
- Context-based state management
- Modular component structure
- Test-driven development (Jest)
This project is licensed under the MIT License.
- Based on the ESP32 Rainbow Website project
- ZX Spectrum games data from ZXDB
- WebAssembly emulation cores
- ESP32 development community