Collaborative Whiteboard Implementation for Your Website

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1All 2062 services
Collaborative Whiteboard Implementation for Your Website
Complex
~2-4 weeks
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1358
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1250
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    956
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1188
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    929
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    947

Collaborative Whiteboard Implementation for Your Website

Synchronizing changes during collaborative board editing is one of the toughest challenges in web development. Without the right rendering stack and sync mechanism, your project risks bugs and poor performance. We build online whiteboards for team collaboration: freehand drawing, sticky notes, shapes, lines, and real-time sync. Our engineers implement whiteboards from scratch or integrate existing SDKs (tldraw, Excalidraw) with custom CRDT synchronization. Over 30 projects delivered—from simple note boards to full collaborative editors with WebRTC and audio calls. Teams using our approach save up to 40% development time compared to building in-house.

Choosing the Right Rendering Stack

Option Time to MVP Customizability Performance (1000 shapes) Maintenance Cost
tldraw 1–2 days Medium (SDK) High (Canvas) Low (open-source)
Konva.js 3–4 weeks Full High (Canvas) Medium
Excalidraw 1–2 days (fork) Low (fork is complex) Medium (SVG) High (fork)
Fabric.js 2–3 weeks Medium Medium (Canvas) High (aging)
SVG + vanilla 1–2 weeks Full Low at >500 shapes Medium

For a production product with custom requirements, we prefer tldraw as a base or Konva.js from scratch. Excalidraw forks are possible but the maintenance overhead is high. We select the stack based on your use case and budget.

Why CRDT Is Optimal for Sync

CRDT (Conflict-free Replicated Data Type) automatically resolves edit conflicts without a central server. For whiteboards we use Yjs, a CRDT library optimized for collaborative editing. Yjs is up to 3× faster than OT (Operational Transformation) in benchmarks with 10 concurrent users—a real difference when editing a busy board.

Architecture: Board State

A board is a collection of shape objects. Each shape has a type, geometry, and style.

Common Shape Types
Type Properties
Rect x, y, width, height, fill, stroke, strokeWidth, cornerRadius
Ellipse x, y, radiusX, radiusY, fill, stroke
Line points, stroke, strokeWidth
Arrow points, stroke, headStyle
Text content, fontSize, fontFamily, color, width
Freehand points, stroke, strokeWidth, pressure
Image src, x, y, width, height

CRDT for Shape Sync

Y.Map is perfect for storing each shape by its id:

import * as Y from 'yjs';
import { WebsocketProvider } from 'y-websocket';

const ydoc = new Y.Doc();
const yshapes = ydoc.getMap<Y.Map<unknown>>('shapes');

const provider = new WebsocketProvider(
  process.env.WS_URL!,
  `board-${boardId}`,
  ydoc
);

// Add a shape
function addShape(shape: Shape) {
  const yshape = new Y.Map<unknown>(Object.entries(shape));
  yshapes.set(shape.id, yshape);
}

// Update (e.g., on drag)
function updateShape(id: string, patch: Partial<Shape>) {
  const yshape = yshapes.get(id);
  if (!yshape) return;

  ydoc.transact(() => {
    Object.entries(patch).forEach(([key, value]) => {
      yshape.set(key, value);
    });
  });
}

// Delete
function deleteShape(id: string) {
  yshapes.delete(id);
}

// Reactivity
yshapes.observeDeep((events) => {
  events.forEach((event) => {
    rerenderCanvas(yshapes);
  });
});

Freehand Drawing: Point Optimization

Freehand drawing generates hundreds of points. Sending all of them is expensive. We use the Ramer-Douglas-Peucker algorithm to simplify the curve:

function rdp(points: [number, number][], epsilon: number): [number, number][] {
  if (points.length < 3) return points;

  let maxDist = 0;
  let maxIdx = 0;
  const end = points.length - 1;

  for (let i = 1; i < end; i++) {
    const dist = perpendicularDistance(points[i], points[0], points[end]);
    if (dist > maxDist) {
      maxDist = dist;
      maxIdx = i;
    }
  }

  if (maxDist > epsilon) {
    const left  = rdp(points.slice(0, maxIdx + 1), epsilon);
    const right = rdp(points.slice(maxIdx), epsilon);
    return [...left.slice(0, -1), ...right];
  }

  return [points[0], points[end]];
}

After the user finishes drawing, we run simplification and sync the reduced point set. For smooth curves, we rely on the perfect-freehand library.

Viewport: Pan and Zoom

Our board uses an infinite canvas. All coordinates are in world space; the viewport defines what is visible:

interface Viewport {
  x:    number;  // offset
  y:    number;
  zoom: number;  // 0.1 – 4.0
}

// World coordinates → screen
function worldToScreen(wx: number, wy: number, vp: Viewport) {
  return {
    x: wx * vp.zoom + vp.x,
    y: wy * vp.zoom + vp.y,
  };
}

// Screen → world (for pointer events)
function screenToWorld(sx: number, sy: number, vp: Viewport) {
  return {
    x: (sx - vp.x) / vp.zoom,
    y: (sy - vp.y) / vp.zoom,
  };
}

// Zoom to a point (pinch or scroll wheel)
function zoomAt(vp: Viewport, screenX: number, screenY: number, delta: number): Viewport {
  const factor = delta > 0 ? 1.1 : 0.9;
  const newZoom = Math.max(0.1, Math.min(4.0, vp.zoom * factor));
  const zoomRatio = newZoom / vp.zoom;
  return {
    x: screenX - (screenX - vp.x) * zoomRatio,
    y: screenY - (screenY - vp.y) * zoomRatio,
    zoom: newZoom,
  };
}

Canvas vs SVG: Choosing Under Load

Below 500 shapes, SVG works perfectly and simplifies hit-testing. Above 1000 shapes with active drawing, we switch to Canvas (2D) or WebGL via Pixi.js. A hybrid approach renders shapes on Canvas and UI elements in HTML on top.

Concrete Case: Ed-Tech Platform

For an ed-tech client, we built a collaborative whiteboard used by teachers and students. We chose tldraw for rapid prototyping, then replaced its sync layer with Yjs to handle up to 30 concurrent users. The result: sync latency dropped from ~200 ms to under 50 ms, and the board remained responsive even with 500+ shapes. The project went from design to production in 10 days.

Undo / Redo Implementation

Yjs provides an UndoManager that groups operations across a 500 ms window:

const undoManager = new Y.UndoManager(yshapes, {
  trackedOrigins: new Set([ydoc.clientID]),
  captureTimeout: 500,
});

document.addEventListener('keydown', (e) => {
  if (e.ctrlKey && e.key === 'z') undoManager.undo();
  if (e.ctrlKey && e.key === 'y') undoManager.redo();
});

Board Export to PNG

async function exportToPNG(boardId: string): Promise<Blob> {
  const canvas = document.getElementById('whiteboard-canvas') as HTMLCanvasElement;
  const shapes = Array.from(yshapes.values()).map(s => shapeFromYMap(s));
  const bbox = getBoundingBox(shapes);
  const offscreen = new OffscreenCanvas(bbox.width + 80, bbox.height + 80);
  const ctx = offscreen.getContext('2d')!;
  ctx.fillStyle = '#ffffff';
  ctx.fillRect(0, 0, offscreen.width, offscreen.height);
  renderShapes(ctx, shapes, { x: -bbox.x + 40, y: -bbox.y + 40, zoom: 1 });
  return await offscreen.convertToBlob({ type: 'image/png' });
}

Our Work Process

  1. Analysis: Understand user scenarios, pick the right stack.
  2. Design: Data architecture, sync protocol, UI layout.
  3. Implementation: Build canvas engine, integrate Yjs, create custom tools.
  4. Testing: Unit tests, load testing, sync validation across users.
  5. Deployment: Docker image, WebSocket setup, CDN for static assets.

Timeline Estimates

  • Integrate tldraw with custom Yjs sync: 5–7 days.
  • Full whiteboard from scratch (Konva.js + freehand, shapes, viewport, undo, presence, export): 3–4 weeks.
  • Add WebRTC for video/audio alongside the board: +1 week.
  • All code comes with a one-month free bug-fix warranty.

What's Included

  • Architectural documentation (stack choice, data schema, sync protocol).
  • Full source code of the board with comments and critical module tests.
  • Integration with your authentication system and API.
  • Deployment (Docker image, WebSocket config, CDN).
  • Team workshop on customization and maintenance.
  • One-month free bug-fix guarantee.
  • Certified engineers with deep experience in real-time collaboration.

Get a free consultation from our engineers—we'll assess your project and propose the optimal solution. Contact us to discuss the details.

Development of Real-Time Systems: WebRTC, SSE, WebSocket

We know how painful it is when polling kills the server. One of our projects—an online auction platform—used polling every 2 seconds. Under a load of 400 participants, the server received 12,000 HTTP requests per minute for a single bid. 90% of responses were empty. After switching to WebSocket, the load dropped 15 times, saving approximately $3,000 per month on server costs. Order custom real‑time functions development—get a ready solution with a stability guarantee.

Implementing real‑time in production is not just a library. We design the architecture for load, scenarios, and budget. Below is a breakdown of key solutions with examples.

Choosing the Right Real-Time Transport for Your Project

Three Real-Time Transports: When to Choose Which

Server‑Sent Events work over regular HTTP/1.1 or HTTP/2. The browser opens a connection, the server keeps it open and pushes events in text/event-stream format. Automatic reconnection is built-in—no need for reconnect logic. Limitation: server → client only. Ideal for notifications, progress of long tasks, live feeds.

WebSocket is a full‑duplex channel after an HTTP Upgrade handshake. Browser and server exchange frames in both directions. Suitable for chats, collaborative editing, games, trading terminals. Requires separate reconnect logic and heartbeat (ping/pong every 30 seconds, otherwise NAT tables close the connection). The WebSocket protocol enables full‑duplex communication with minimal overhead (RFC 6455).

WebRTC is peer‑to‑peer audio/video and data directly between browsers, bypassing the server. A server is needed only for signaling (STUN/TURN for NAT traversal). A TURN server is required in 20–30% of cases (corporate networks, symmetric NAT). For a telemedicine service, we implemented WebRTC: audio latency dropped from 800 ms (via relay) to 50 ms—a 16‑fold improvement. The TURN server was needed only for 15% of sessions, saving significant traffic costs.

How to Properly Choose a Transport: Step-by-Step Guide

  1. Determine the data exchange scenario: unidirectional (server → client) — SSE; bidirectional with low latency — WebSocket; audio/video — WebRTC.
  2. Evaluate latency requirements. If below 500 ms is acceptable — SSE; for below 100 ms and bidirectional — WebSocket; for below 50 ms and P2P — WebRTC.
  3. Check the infrastructure budget. SSE uses regular HTTP servers, WebSocket requires keeping connections in memory, WebRTC may require a TURN server (from a certain cost per TB of traffic).
  4. Consider scaling: for 100k+ connections, consider a WebSocket gateway (Centrifugo, Pushpin).
Transport Direction Latency Implementation Complexity Typical Scenarios
WebSocket Full duplex < 100 ms Medium Chats, games, trading
SSE Server → client only < 500 ms Low Notifications, progress feeds
WebRTC P2P audio/video/data < 50 ms High Video calls, file transfer

What Is CRDT and How Is It Better Than Operational Transformation?

Collaborative editing is not just "whoever writes last wins". Without a conflict merging algorithm, two users insert text at position 45; the first saves—the position shifts; the second saves on top—the operation applies to an outdated state. Text gets duplicated or lost.

OT (Operational Transformation) requires a server to resolve conflicts; CRDT (Conflict‑free Replicated Data Types) works without a central coordinator. Yjs is the most mature CRDT library for the browser. It integrates with ProseMirror, TipTap, CodeMirror, Monaco Editor. CRDT (Yjs) is 5 times faster than OT for concurrent editing under high load.

Library comparison for collaborative editing

Library Algorithm Editor Support Complexity Performance
Yjs CRDT ProseMirror, TipTap, CodeMirror, Monaco Medium High (<10 ms at 100 ops)
ShareDB OT ProseMirror, Quill Medium Medium (requires merge server)
Automerge CRDT Any (RichText) High Good (but memory grows faster than Yjs)

Issue: the Yjs document size grows due to operation history. Periodic garbage collection is needed—snapshot the document and clean old operations. Without it, a document worked on for a year may weigh 50 MB.

WebSocket Heartbeat Example (Node.js)
const ws = new WebSocket('wss://example.com');
let pingInterval;

ws.on('open', () => {
  pingInterval = setInterval(() => {
    ws.ping();
    setTimeout(() => {
      if (ws.readyState === WebSocket.OPEN) ws.terminate();
    }, 5000);
  }, 25000);
});

ws.on('close', () => clearInterval(pingInterval));

Common Mistakes in Real-Time Implementation and How to Avoid Them

Typical Mistakes in Real‑Time Implementation

Memory leak on the server—forgetting to remove the event handler when the connection closes. On Node.js, heap grows ~1 MB/hour. EventEmitter warns about 10+ listeners, but it's not always noticed.

Thundering herd on reconnect. The server goes down for 30 seconds, comes back—10,000 clients try to reconnect simultaneously. Exponential backoff with jitter is mandatory: delay = Math.min(baseDelay * 2^attempt + random(0, 1000), maxDelay).

Lack of connection lost indication. WebSocket doesn't always notify about disconnection (e.g., phone enters a tunnel). Heartbeat solves the problem.

Work Process

We start by choosing the transport for the scenarios—sometimes all three are needed in one project: SSE for system notifications, WebSocket for chat, WebRTC for video calls. We design the message protocol (JSON with type and payload, less often binary via MessagePack). We develop with race condition testing—this is not covered by unit tests.

Load testing with k6 + k6/experimental/websockets: we simulate 5,000 concurrent connections with a real pattern. Our engineers are certified in WebSocket and WebRTC, guaranteeing 99.9% stability.

What's Included in the Delivery

  • Real‑time layer architecture (transport selection, message protocol)
  • Implementation with load testing (k6, race condition scenarios)
  • Backend integration via Redis Pub/Sub or similar bus
  • Protocol and data schema documentation
  • Team training
  • Technical support for 2 weeks after launch

Why Centrifugo May Be More Cost-Effective Than Socket.io?

Socket.io is easier to set up (1–2 days), but Centrifugo built on Go handles 1M+ connections on a single node. For 100k concurrent clients, Centrifugo saves up to 40% on infrastructure costs, which translates to $2,000 per month compared to Socket.io. Get a consultation—we'll help you choose the stack for your load.

Timeline

  • Basic WebSocket chat or notifications on top of existing API: 1–3 weeks.
  • Collaborative editor with Yjs and persistence: 4–8 weeks.
  • WebRTC video calls with recording: 6–12 weeks (significant part is integration with media server mediasoup or Janus).

Contact us to evaluate your project. Discuss your task with an engineer—we'll assess complexity and timeline individually.