PROJECT / 08Jul 2026 — Aug 2026

DrawScape

A shared canvas for turning architecture ideas into diagrams.

DrawScape canvas with connected diagram shapes
DrawScape canvas with connected diagram shapes

Overview

DrawScape is a collaborative architecture whiteboard built with HTML Canvas. It combines familiar drawing interactions with shared WebSocket rooms and PostgreSQL persistence. The interface supports shapes, arrows, text, and images, along with selection, resizing, undo/redo, zoom, and pan.

Architecture

System architecture
100%

Scroll to explore the connections, or use Fit to see the full diagram.

HTTP writes first; room events synchronize connected canvasesThe Next.js app reuses the Express API. PostgreSQL is the shared event source for WebSocket delivery and reconnect replay, with HTTP polling as a fallback.Canvas ADraw + edit shapesRoom event cursorHTTP write APINext.js → ExpressAuthenticate + validatePrisma + PostgreSQLShapes + roomsOrdered event logWebSocket roomsAuthenticate first frameRead events after cursorCanvas BReceive room eventsReconnect + replaySave changePersist firstOrdered eventsLive room updatesBroadcast + replayHTTP polling fallback

HTTP writes first; room events synchronize connected canvases

  1. Canvas changes go through the authenticated HTTP API and are persisted before the request succeeds.
  2. WebSocket connections authenticate, join rooms with an after cursor, and read the shared ordered event log. Connections in different processes can observe the same durable events.
  3. Clients reconnect with a cursor to replay missed changes. HTTP polling provides a fallback when WebSockets are unavailable.

DrawScape · System architecture

Component responsibilities
  1. Durable HTTP writes

    The Next.js app reuses the Express API. Changes are authenticated, validated, and persisted before HTTP success is returned.

  2. Shared event log

    Prisma/PostgreSQL stores room and shape data with ordered events that can be read across server processes.

  3. Realtime and recovery

    WebSocket clients authenticate and join with an after cursor for live events and replay. HTTP polling is the fallback when WebSockets are unavailable.

Why I built this

I wanted a practical way to sketch architecture ideas with other people while learning how a drawing editor works underneath the interface. DrawScape combines canvas interactions, shared state, and persistence in one project.

Use case

Developers discussing an application design can draw shapes, connect them with arrows, add text, and collaborate in a shared room before returning to the saved canvas later.

What I learned

  • Implementing editor interactions such as selection, resizing, undo/redo, zoom, and pan.
  • Keeping a shared canvas synchronized through authenticated WebSocket rooms.
  • Connecting canvas state to a Prisma and PostgreSQL persistence layer.

Key features

  1. A complete drawing toolkit

    Combine shapes, arrows, text, and images to communicate an architecture or idea.

  2. Canvas interactions

    Select and resize elements, undo or redo edits, and navigate the canvas with zoom and pan.

  3. Shared, persistent canvases

    Authenticated WebSocket rooms keep collaborators in sync, with PostgreSQL persistence for saved work.

More projects

View all
GitHub
LinkedIn
X