A real-time collaborative whiteboard application built with FastAPI, Vue.js, and Valkey. Draw, collaborate, and share ideas in real-time with multiple users.
- Real-time collaborative drawing
- Multiple users can draw simultaneously
- WebSocket-based synchronization
- Persistent storage with Valkey
- Responsive web interface
Choose one of the following methods to run the application:
- Docker (v20.10+)
- Docker Compose (v2.0+)
This is the easiest way to get started. Docker will handle all dependencies and setup automatically.
-
Clone the repository
git clone <repository-url> cd demo
-
Start the application
docker-compose up -d
This will start:
- Valkey server on port 6379
- Whiteboard backend on port 8000
-
Access the application
Open your browser and navigate to:
http://localhost:8000 -
View logs (optional)
docker-compose logs -f whiteboard-backend
-
Stop the application
docker-compose down
To remove volumes as well:
docker-compose down -v
For local development without Docker, use uv for faster dependency installation.
-
Clone the repository
git clone <repository-url> cd demo
-
Install uv (if not already installed)
# On macOS and Linux curl -LsSf https://astral.sh/uv/install.sh | sh # On Windows powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
-
Install Valkey
On macOS:
brew install valkey brew services start valkey
On Ubuntu/Debian:
sudo apt-get install valkey-server sudo systemctl start valkey-server
On Windows:
- Use Valkey Docker image [https://valkey.io/download/]
-
Create a virtual environment and install dependencies
uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate uv pip install -r requirements.txt
-
Configure environment variables (optional)
Create a
.envfile in the root directory:VALKEY_HOST=localhost VALKEY_PORT=6379 VALKEY_DB=0
-
Run the application
cd backend uvicorn main:app --host 0.0.0.0 --port 8000 --reload -
Access the application
Open your browser and navigate to:
http://localhost:8000
demo/
├── backend/
│ ├── __init__.py
│ ├── main.py # FastAPI application entry point
│ ├── api.py # API routes and WebSocket handlers
│ ├── database.py # Valkey connection and operations
│ ├── models.py # Data models
│ └── connections.py # WebSocket connection management
├── frontend/
│ ├── index.html # Main HTML file
│ └── assets/ # Static assets (CSS, JS)
├── docker-compose.yml # Docker Compose configuration
├── Dockerfile # Docker image configuration
├── requirements.txt # Python dependencies
└── README.md # This file
When running with Docker, the application automatically reloads when you make changes to the code (hot reload enabled).
For local development with uv, the --reload flag enables hot reloading.
GET /- Serve the frontend applicationGET /assets/*- Serve static assets
WS /ws- Real-time collaboration WebSocket connection
- Backend: FastAPI, Python 3.11
- Database: Valkey
- Frontend: Vue.js, HTML5 Canvas
- Real-time: WebSocket (Socket.IO)
- Containerization: Docker, Docker Compose
Port already in use:
# Check what's using the port
netstat -ano | findstr :8000 # Windows
lsof -i :8000 # macOS/Linux
# Change the port in docker-compose.yml
ports:
- "8001:8000" # Use 8001 insteadContainer won't start:
# Check logs
docker-compose logs whiteboard-backend
# Rebuild containers
docker-compose up --buildModule not found:
# Reinstall dependencies
uv pip install -r requirements.txtPort 8000 already in use:
# Run on a different port
uvicorn main:app --host 0.0.0.0 --port 8001- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is open source and available under the MIT License.
For issues, questions, or contributions, please open an issue on the repository.