This server handles real-time synchronization for the collaborative Blockly editor using Yjs.
- Built with Yjs for conflict-free real-time collaboration
- Uses WebSockets for efficient real-time communication
- Handles multiple rooms for separate collaboration spaces
This WebSocket server needs to be deployed to a service that supports WebSockets and persistent connections.
- Create an account at Render.com
- Create a new Web Service
- Connect to your GitHub repository
- Use the following settings:
- Environment: Node
- Build Command:
npm install - Start Command:
node server.js - Plan: Free or Starter ($7/month for better uptime)
- Install the Fly CLI:
curl -L https://fly.io/install.sh | sh - Login to Fly:
fly auth login - Launch the app:
fly launch - Deploy:
fly deploy
- Install the Heroku CLI and login
- Create a new app:
heroku create your-app-name - Add the heroku remote:
git remote add heroku https://git.heroku.com/your-app-name.git - Deploy:
git push heroku main
PORT: The port the server will listen on (provided by the hosting service)HOST: Host address to bind to (default: '0.0.0.0')
npm install
npm startThe server will run on port 1234 by default (or the PORT environment variable).