← Back to selected work

ENGINEERING CASE STUDY / 03

Multiplayer Cursor.

One shared space. Explicit state synchronization, from pointer input to the remote canvas.

DISTRIBUTED SYSTEMS / REAL-TIME
TypeScriptWebSocketsNode.jsCanvas
SHARED CANVASLOCAL SIMULATION
YouRemote
MOVE YOUR POINTER OR USE ARROW KEYS2 SIMULATED PEERS

PROJECT SCOPESingle-process rooms. The portfolio demo is a local simulation, not a live multi-user session.

01 / CONTEXT

The problem worth solving.

Pointer movement is frequent. Network delivery is irregular. Naive broadcasting makes movement expensive and uneven.

Engineering objectives

  • Synchronize current room state.
  • Validate messages at runtime.
  • Restore presence after disconnection.

02 / SYSTEM DESIGN

Follow the flow.

LOGICAL DATA FLOWFLOW / 06
STEP 1 — POINTER INPUTINPUT BOUNDARY

Implementation details

  • The throttler sends the newest position.
  • Room state tracks participants and canonical events.
  • Interpolation smooths incoming samples; heartbeats and backoff manage reconnects.

03 / TRADEOFFS

The reasoning behind the code.

01

Ephemeral state

Keep current positions, not durable movement history.

02

Native WebSockets

Make protocol guarantees explicit.

Engineering challenges

Stale updates, uneven delivery, and duplicate presence need distinct recovery rules.

Security & performance boundaries

Messages have size and coordinate bounds. Resume tokens are not authentication.

04 / EVIDENCE

What’s there. What’s next.

Public source includes protocol, interpolation, and reconnect tests. Try the local illustration below or open the linked deployment.

Explore the source, documentation, and tests to inspect the implementation and its current boundaries.

Read the repository
NEXT CASE STUDY / 04CyberShield AI