abbas-mesolitica/LeRobot-Arena
๐ค LeRobot Arena
A web-based robotics control and simulation platform that bridges digital twins and physical robots. Built with Svelte for the frontend and FastAPI for the backend.
๐ Quick Start with Docker
The easiest way to run LeRobot Arena is using Docker, which sets up both the frontend and backend automatically.
Prerequisites
- Docker installed on your system
- Docker Compose (usually included with Docker Desktop)
Step-by-Step Instructions
- Clone the repository
git clone <your-repo-url>
cd lerobot-arena- Build and start the services
docker-compose up --build- Access the application
- Frontend: http://localhost:7860
- Backend API: http://localhost:8080
- API Documentation: http://localhost:8080/docs
- Stop the services
# Press Ctrl+C to stop, or in another terminal:
docker-compose downAlternative Docker Commands
If you prefer using Docker directly:
# Build the image
docker build -t lerobot-arena .
# Run the container
docker run -p 7860:7860 lerobot-arena๐ ๏ธ Development Setup
For local development with hot-reload capabilities:
Frontend Development
# Install dependencies
bun install
# Start the development server
bun run dev
# Or open in browser automatically
bun run dev -- --openBackend Development
# Navigate to Python backend
cd src-python
# Install Python dependencies (using uv)
uv sync
# Or using pip
pip install -e .
# Start the backend server
python start_server.pyBuilding Standalone Executable
The backend can be packaged as a standalone executable using box-packager:
# Navigate to Python backend
cd src-python
# Install box-packager (if not already installed)
uv pip install box-packager
# Package the application
box package
# The executable will be in target/release/lerobot-arena-server
./target/release/lerobot-arena-serverNote: Requires Rust/Cargo to be installed for box-packager to work.
๐ Project Structure
lerobot-arena/
โโโ src/ # Svelte frontend source
โ โโโ lib/ # Reusable components and utilities
โ โโโ routes/ # SvelteKit routes
โ โโโ app.html # App template
โโโ src-python/ # Python backend
โ โโโ src/ # Python source code
โ โโโ start_server.py # Server entry point
โ โโโ target/ # Box-packager build output (excluded from git)
โ โโโ pyproject.toml # Python dependencies
โโโ static/ # Static assets
โโโ Dockerfile # Docker configuration
โโโ docker-compose.yml # Docker Compose setup
โโโ package.json # Node.js dependencies๐ณ Docker Information
The Docker setup includes:
- Multi-stage build: Optimized for production using Bun and uv
- Automatic startup: Both services start together
- Port mapping: Backend on 8080, Frontend on 7860 (HF Spaces compatible)
- Static file serving: Compiled Svelte app served efficiently
- User permissions: Properly configured for Hugging Face Spaces
- Standalone executable: Backend packaged with box-packager for faster startup
For detailed Docker documentation, see DOCKER_README.md.
๐ง Building for Production
Frontend Only
bun run buildBackend Standalone Executable
cd src-python
box packageComplete Docker Build
docker-compose up --build๐ What's Included
- Real-time Robot Control: WebSocket-based communication
- 3D Visualization: Three.js integration for robot visualization
- URDF Support: Load and display robot models
- Multi-robot Management: Control multiple robots simultaneously
- WebSocket API: Real-time bidirectional communication
- Standalone Distribution: Self-contained executable with box-packager
๐จ Troubleshooting
Port Conflicts
If ports 8080 or 7860 are already in use:
# Check what's using the ports
lsof -i :8080
lsof -i :7860
# Use different ports
docker run -p 8081:8080 -p 7861:7860 lerobot-arenaContainer Issues
# View logs
docker-compose logs lerobot-arena
# Rebuild without cache
docker-compose build --no-cache
docker-compose upDevelopment Issues
# Clear node modules and reinstall
rm -rf node_modules
bun install
# Clear Svelte kit cache
rm -rf .svelte-kit
bun run devBox-packager Issues
# Clean build artifacts
cd src-python
box clean
# Rebuild executable
box package
# Install cargo if missing
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh๐ Hugging Face Spaces Deployment
This project is configured for deployment on Hugging Face Spaces:
- Fork this repository to your GitHub account
- Create a new Space on Hugging Face Spaces
- Connect your GitHub repository
- Select Docker SDK (should be auto-detected from the frontmatter)
- Deploy - The Space will automatically build and run
The frontend will be available at your Space URL, and the backend API will be accessible at /api/ endpoints.
๐ Additional Documentation
- Docker Setup Guide - Detailed Docker instructions
- Robot Architecture - System architecture overview
- Robot Instancing Guide - Multi-robot setup
๐ค Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test with Docker:
docker-compose up --build - Submit a pull request
๐ License
This project is licensed under the MIT License.
Built with โค๏ธ for the robotics community ๐ค
