Skip to content

Comments

Real-time Collaborative Whiteboard Feature#1

Merged
vimalyad merged 4 commits intomainfrom
feature/whiteboard
Oct 29, 2025
Merged

Real-time Collaborative Whiteboard Feature#1
vimalyad merged 4 commits intomainfrom
feature/whiteboard

Conversation

@vimalyad
Copy link
Owner

Real-time Collaborative Whiteboard Feature

Description

This PR implements the real-time collaborative whiteboard feature for Studi.io study rooms.

Key Functionality:

  • Users can draw on a shared canvas using a pencil tool within a study room.
  • Drawing actions (creating paths) are broadcast instantly to other members in the same room via Socket.IO.
  • Includes basic toolbar controls for switching between draw/select modes, changing brush color, and adjusting brush size.
  • A "Clear Canvas" button allows users to wipe the board.
  • The whiteboard state is periodically saved to the database (StudyRoom.whiteboardState) via a Socket.IO event.
  • When a user joins a room, the currently saved whiteboard state is loaded onto their canvas.
  • The canvas is responsive and adjusts to window resizing.

Technical Implementation:

  • Frontend: Uses fabric.js library for canvas manipulation within a React (Whiteboard.tsx) component. Socket.IO client handles sending/receiving drawing events (drawing, load-whiteboard-state, save-whiteboard-state).
  • Backend: Added Socket.IO event handlers (drawing, save-whiteboard-state) in socketHandler.js to relay drawing data and persist the canvas state to MongoDB. Updated join-room handler to emit load-whiteboard-state.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Testing

  • I have tested these changes locally
  • All tests pass
  • I have added tests for new features

Checklist

  • My code follows the project's style guidelines
  • I have commented my code where necessary
  • I have updated the documentation
  • My changes generate no new warnings

@netlify
Copy link

netlify bot commented Oct 29, 2025

Deploy Preview for studiio ready!

Name Link
🔨 Latest commit c67a6c9
🔍 Latest deploy log https://app.netlify.com/projects/studiio/deploys/69023af936ad4a0008720b39
😎 Deploy Preview https://deploy-preview-1--studiio.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vimalyad vimalyad merged commit cc768df into main Oct 29, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant