Building CollabyDraw: A Deep Dive into a Real-Time, Secure Collaborative Whiteboard

October 20, 2025

A few months ago, I set out to build CollabyDraw, a web-based collaborative whiteboard. My goal was to create a tool that was not only functional but also secure, intuitive, and a little bit different, with a unique hand-drawn feel. This project became one of my most rewarding, pushing me to learn and implement solutions for real-time communication, security, and modern web architecture. In this post, I'll take you on a deep dive into the technical decisions and architecture behind it.

The Core Drawing Experience

The heart of CollabyDraw is, of course, the canvas. I used the standard HTML Canvas API as the foundation. However, I wanted to avoid the sterile, overly perfect lines of typical digital drawing tools. To achieve a more organic, hand-drawn aesthetic, I integrated two fantastic libraries:

The Magic of Real-Time Collaboration

Real-time collaboration was a must-have feature. I opted to use native WebSockets for this, as they provide a persistent, low-latency, bidirectional communication channel between the client and the server.

To make the user experience as smooth as possible, I implemented a couple of key reliability features:

A Fortress of Privacy: End-to-End Encryption (E2EE)

Security was a top priority, especially for a tool where users might be brainstorming sensitive ideas. I implemented End-to-End Encryption (E2EE) with a design that ensures no one—not even the server—can see the content of a drawing.

Here's how it works: When a user creates or joins a room, the app generates a URL like this: https://collabydraw.xyz#room=abc123,xyz456

The key insight is that the encryption key is in the URL fragment (everything after the #). Browsers never send the URL fragment to the server in an HTTP request. This means the key lives exclusively on the client-side. All drawing data is encrypted on the client before being sent over the WebSocket, and it can only be decrypted by other clients in the room who have the key from the URL.

The Architectural Decisions

CollabyDraw is built as a monorepo using pnpm workspaces. The tech stack is modern and designed for a great developer experience:

I also made a clear distinction between two modes of operation:

Conclusion

Building CollabyDraw was a fantastic learning experience, teaching me invaluable lessons about real-time systems, security, and modern full-stack development. But beyond the technical skills, the most rewarding part was the response from the community.

I shared my progress in the 100xDevs cohort, and I was incredibly humbled when someone I deeply respect in the Indian tech community, Harkirat Singh, reviewed the project live and gave it his praise. It was a huge confidence boost and validated all the late nights I'd put in. I shared that moment on LinkedIn, and the support was amazing.

I also shared it on X (formerly Twitter), where it received similar support.

The project is fully open-source, and I encourage you to check out the repository on GitHub. Whether you're a student, a developer, or just curious, feel free to explore the code. If you have ideas for improvements, I'd love to see your issues and pull requests!