{"repo":"tldraw/tldraw-sync-cloudflare","free":true,"listed":false,"github":"https://github.com/tldraw/tldraw-sync-cloudflare","clone":"git clone https://github.com/tldraw/tldraw-sync-cloudflare.git","description":"Bring multiplayer mode to your tldraw canvas app. Self-hosted and powered by tldraw sync and Cloudflare Durable Objects.","language":"TypeScript","stars":136,"topics":[],"license":"MIT","category":"self-hosted-apps","readme_excerpt":"tldraw sync server This is a production-ready backend for tldraw sync. - Your client-side tldraw-based app can be served from anywhere you want. - This backend uses Cloudflare Workers, and will need to be deployed to your own Cloudflare account. - Each whiteboard is synced via WebSockets to a Cloudflare Durable Object, which persists room state in its built-in SQLite storage. - Uploaded images and videos are stored in a Cloudflare R2 bucket. - Although unrelated to tldraw sync, this server also includes a component to fetch link previews for URLs added to the canvas. This is a minimal setup of the same system that powers multiplayer collaboration for hundreds of thousands of rooms & users on www.tldraw.com. Because durable objects effectively create a mini server instance for every single active room, we've never needed to worry about scale. Cloudflare handles the tricky infrastructure work of ensuring there's only ever one instance of each room, and making sure that every user gets connected to that instance. We've found that with this approach, each room is able to handle about 50 simultaneous collaborators. When a user opens a room, they connect via Workers to a durable object. Each durable object is like its own miniature server. There's only ever one for each room, and all the users of that room connect to it. When a user makes a change to the drawing, it's sent via a websocket connection to the durable object for that room. The durable object applies the change to its i","default_branch":null,"files":null,"tree":[],"storefront":"/r/tldraw","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/tldraw/tldraw-sync-cloudflare/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}