Skip to content

akhileshverma92/WHITEBOARD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Here’s a detailed project report formatted for a GitHub README file:

# Collaborative Whiteboard Application

This project is a Collaborative Whiteboard application built using ReactJS, Socket.IO, and Node.js. It allows users to draw collaboratively in real-time, chat with participants, and use various tools for enhanced productivity.


Table of Contents

  1. Overview
  2. Features
  3. Tech Stack
  4. Project Structure
  5. Installation
  6. Detailed Routes
  7. Code Highlights
  8. Future Enhancements
  9. Conclusion

Overview

The Collaborative Whiteboard is a real-time application that facilitates collaborative drawing and communication among users in a shared space. Users can join rooms, use multiple tools like pencil, shapes, and erasers, and communicate via a chat feature.


Features

  • Real-time Drawing: Synchronized drawing across users in the same room.
  • Multiple Tools: Includes pencil, rectangle, circle, eraser, and color picker.
  • Chat Functionality: Communicate with participants in the room.
  • Participant List: View and manage room participants.
  • Undo/Redo: Maintain a drawing history for corrections.
  • Responsive Design: Adapts to different screen sizes.

Tech Stack

  • Frontend: ReactJS, Tailwind CSS
  • Backend: Node.js, Express.js
  • Real-Time Communication: Socket.IO
  • Icons: Lucide-React
  • Routing: React Router

Project Structure

src/
│
├── components/
│   ├── Navbar.js         # Top navigation bar
│   ├── Sidebar.js        # Sidebar for tools
│   ├── Chat.js           # Chat component
│   └── Canvas.js         # Canvas component for drawing
│
├── pages/
│   ├── Home.js           # Home route
│   ├── About.js          # About route
│   ├── Whiteboard.js     # Main whiteboard component
│
├── App.js                # Entry point for the app
├── index.js              # Main React rendering logic
└── styles.css            # Global styles
</code></pre>
<hr>
<h2 id="installation">Installation</h2>
<p>Follow these steps to set up the project locally:</p>
<ol>
<li><p>Clone the repository:</p>
<pre><code class="language-bash">git clone https://github.com/&lt;your-username&gt;/collaborative-whiteboard.git
cd collaborative-whiteboard
</code></pre>
</li>
<li><p>Install dependencies:</p>
<pre><code class="language-bash">npm install
</code></pre>
</li>
<li><p>Start the development server:</p>
<pre><code class="language-bash">npm start
</code></pre>
</li>
<li><p>Run the backend server (from the backend directory):</p>
<pre><code class="language-bash">node server.js
</code></pre>
</li>
</ol>
<hr>
<h2 id="detailed-routes">Detailed Routes</h2>
<h3 id="home">Home</h3>
<ul>
<li><strong>Path</strong>: <code>/</code></li>
<li><strong>Description</strong>: This is the landing page of the application, showcasing its features and functionality.</li>
</ul>
<h4 id="code">Code</h4>
<pre><code class="language-jsx">import React from &#39;react&#39;;
import { Link } from &#39;react-router-dom&#39;;

const Home = () =&gt; (
  &lt;div className=&quot;home&quot;&gt;
    &lt;h1&gt;Welcome to Collaborative Whiteboard&lt;/h1&gt;
    &lt;p&gt;Collaborate and create together in real time.&lt;/p&gt;
    &lt;Link to=&quot;/whiteboard&quot; className=&quot;btn&quot;&gt;Get Started&lt;/Link&gt;
  &lt;/div&gt;
);

export default Home;
</code></pre>
<hr>
<h3 id="about">About</h3>
<ul>
<li><strong>Path</strong>: <code>/about</code></li>
<li><strong>Description</strong>: Provides detailed information about the application and its purpose.</li>
</ul>
<h4 id="code-1">Code</h4>
<pre><code class="language-jsx">import React from &#39;react&#39;;

const About = () =&gt; (
  &lt;div className=&quot;about&quot;&gt;
    &lt;h1&gt;About Collaborative Whiteboard&lt;/h1&gt;
    &lt;p&gt;This application allows users to collaborate in real time...&lt;/p&gt;
  &lt;/div&gt;
);

export default About;
</code></pre>
<hr>
<h3 id="whiteboard">Whiteboard</h3>
<ul>
<li><strong>Path</strong>: <code>/whiteboard</code></li>
<li><strong>Description</strong>: The core of the application where users can draw, chat, and collaborate.</li>
</ul>
<h4 id="key-functionalities">Key Functionalities</h4>
<ol>
<li><strong>Real-time Drawing</strong>:<ul>
<li>Synchronizes drawing using Socket.IO.</li>
</ul>
</li>
<li><strong>Toolset</strong>:<ul>
<li>Pencil, shapes, eraser, color picker, and undo/redo.</li>
</ul>
</li>
<li><strong>Chat Integration</strong>:<ul>
<li>Real-time chat with other participants.</li>
</ul>
</li>
<li><strong>Responsive Design</strong>:<ul>
<li>Scales for desktop, tablet, and mobile views.</li>
</ul>
</li>
</ol>
<h4 id="code-2">Code</h4>
<p>Refer to the detailed whiteboard component provided earlier in this project.</p>
<hr>
<h2 id="code-highlights">Code Highlights</h2>
<h3 id="real-time-drawing-with-socketio">Real-Time Drawing with Socket.IO</h3>
<pre><code class="language-javascript">socketRef.current.on(&#39;draw&#39;, (drawData) =&gt; {
  const ctx = contextRef.current;
  ctx.strokeStyle = drawData.color;
  ctx.lineWidth = drawData.lineWidth;

  ctx.beginPath();
  ctx.moveTo(drawData.startX, drawData.startY);
  ctx.lineTo(drawData.endX, drawData.endY);
  ctx.stroke();
});
</code></pre>
<h3 id="chat-integration">Chat Integration</h3>
<pre><code class="language-javascript">const handleMessageSubmit = (e) =&gt; {
  e.preventDefault();
  const messageData = {
    roomId,
    username,
    message: currentMessage,
    timestamp: new Date().toLocaleTimeString(),
  };
  socketRef.current.emit(&#39;chat message&#39;, messageData);
  setCurrentMessage(&#39;&#39;);
};
</code></pre>
<hr>
<h2 id="future-enhancements">Future Enhancements</h2>
<ol>
<li><strong>Authentication</strong>: Add user login and authentication.</li>
<li><strong>File Upload</strong>: Allow users to upload images to the canvas.</li>
<li><strong>Video Conferencing</strong>: Integrate video conferencing for better collaboration.</li>
<li><strong>Performance Optimization</strong>: Improve scalability and reduce latency for large rooms.</li>
</ol>
<hr>
<h2 id="conclusion">Conclusion</h2>
<p>This <strong>Collaborative Whiteboard</strong> project showcases the power of real-time collaboration with an intuitive UI. It leverages modern web technologies to create a responsive and interactive platform for teamwork.</p>
<p>For contributions, feel free to fork the repository and create a pull request.</p>
<hr>
<h2 id="author">Author</h2>
<p>Developed by <a href="https://github.com/akhileshverma92">Your Name</a>.</p>
<pre><code>
You can copy and paste this into your `README.md` file for your GitHub repository. Let me know if you need further adjustments!
</code></pre>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published