A real-time collaborative whiteboard application that enables multiple users to work together seamlessly with live cursors, video/audio communication, and an infinite canvas experience.
- Infinite pannable and zoomable canvas
- Live cursor tracking with user names and colors
- Real-time synchronization across all connected users
- Mobile-responsive touch interactions
- Stickers: Add fun visual elements to your canvas
- Polaroids: Create note-like elements with custom colors
- Drag and drop functionality for all canvas items
- Built-in video/audio rooms using 100ms
- Mute/unmute controls
- Join with audio/video disabled by default
- Real-time user presence indicators
- Minimap: Quick navigation across large canvas areas
- Toolbar: Easy access to canvas tools and options
- Pan Mode: Navigate the canvas efficiently
- Online user counter
- Responsive design for desktop and mobile
- Personal color picker for user identification
- Custom usernames (up to 10 characters)
- Modern, clean UI with dark/light themes
- Node.js 18+
- npm or yarn package manager
Create a .env.local file in the root directory with the following variables:
NEXT_PUBLIC_LIVEBLOCKS_KEY=your_liveblocks_public_key
NEXT_PUBLIC_HMS_ROOM_ID=your_100ms_room_code-
Clone the repository
git clone https://github.com/yourusername/virtual-space.git cd virtual-space -
Install dependencies
npm install # or yarn install -
Set up environment variables
- Get your Liveblocks API key from Liveblocks Dashboard
- Get your 100ms room code from 100ms Dashboard
- Add them to your
.env.localfile
-
Start the development server
npm run dev # or yarn dev -
Open your browser Navigate to http://localhost:3000
- Next.js 14 - React framework with App Router
- React 18 - UI library
- TypeScript - Type safety
- Liveblocks - Real-time collaboration infrastructure
- 100ms - Video/audio communication platform
- Jotai - Atomic state management
- Jotai DevTools - Development debugging
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Accessible component primitives
- Lucide React - Icon library
- Framer Motion - Animation library
- React Color - Color picker component
- Vaul - Drawer component
- ESLint - Code linting
- PostCSS - CSS processing
- Autoprefixer - CSS vendor prefixing
virtual-space/
โโโ app/ # Next.js App Router
โ โโโ globals.css # Global styles
โ โโโ layout.tsx # Root layout
โ โโโ page.tsx # Home page (user setup)
โ โโโ room/ # Collaborative room
โ โโโ page.tsx # Main whiteboard interface
โโโ components/
โ โโโ providers/ # Context providers
โ โ โโโ 100ms-provider.tsx # Video/audio provider
โ โ โโโ jotai-provider.tsx # State management
โ โ โโโ liveblocks-room.tsx # Real-time collaboration
โ โโโ ui/ # Reusable UI components
โ โโโ whiteboard/ # Whiteboard-specific components
โ โโโ canvas.tsx # Main canvas component
โ โโโ cursor.tsx # User cursor display
โ โโโ minimap.tsx # Canvas minimap
โ โโโ note.tsx # Note/polaroid elements
โ โโโ other-cursors.tsx # Other users' cursors
โ โโโ toolbar.tsx # Canvas toolbar
โโโ hooks/ # Custom React hooks
โโโ lib/ # Utilities and configuration
โ โโโ constants.ts # App constants
โ โโโ jotai-state.ts # Global state atoms
โ โโโ type.ts # TypeScript type definitions
โ โโโ utils.ts # Utility functions
โโโ public/ # Static assets
โ โโโ stickers/ # Sticker assets
โโโ liveblocks.config.ts # Liveblocks configuration
- Enter your username (max 10 characters)
- Pick a unique color for your cursor
- Click "Join Room" to enter the collaborative space
- Mouse/Trackpad: Scroll to pan around the canvas
- Touch: Use pinch and drag gestures on mobile
- Minimap: Click to jump to different areas
- Use the toolbar to add stickers and polaroids
- Drag elements around the canvas
- Elements are synced in real-time with other users
- Video/audio features are automatically available
- Users join with audio/video muted by default
- Use 100ms controls to manage your media
- Public Canvas: This is a public workspace accessible to anyone
- No Data Persistence: Video, audio, and user data are not stored
- Demo Project: Intended for demonstration and testing purposes
- Security: While effort has been made to ensure security, use responsibly
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Liveblocks for real-time collaboration infrastructure
- 100ms for video/audio capabilities
- Radix UI for accessible components
- Tailwind CSS for styling
- Vercel for deployment platform
Built with โค๏ธ using Next.js, Liveblocks, and 100ms