Skip to content

rishab11250/HackStreet-2K26

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 

Repository files navigation

🎨 Pixel-Collab (CollabBoard)

Deployed Link React Vite Tailwind CSS Zustand

Pixel-Collab is a high-performance, professional-grade collaborative whiteboard application built for the modern web. It features a custom-built HTML5 Canvas engine, advanced drawing tools, and a sophisticated "mock" collaboration system that simulates a real-time multi-user environment.


πŸš€ Live Demo

Experience the board: https://pixel-collab-chi.vercel.app/


πŸ“Ί Feature Deep-Dive

πŸ–ŒοΈ Advanced Canvas Engine

Built from the ground up with a pure JS renderer (CanvasRenderer.js), Pixel-Collab offers:

  • Professional Toolset: Pencil (with smoothing), Shapes (Rect, Circle, Line, Arrow), Text, and Sticky Notes.
  • Infinite Canvas feel: Seamless Zoom (10% - 400%) and Pan support.
  • Dynamic Minimap: A persistent viewport overview that renders real-time stroke previews using a specialized low-fidelity drawer (minimapDraw.js).
  • High-DPI Support: Automatically scales for Retina/4K displays for crisp lines.

πŸ“ Precision & Alignment (The "Pro" Touch)

  • Magnetic Snapping: Figma-style alignment that "snaps" elements to edges and centers of other elements with visual guide rails (snapAlignment.js).
  • Snap-to-Grid: A customizable dot grid that guides placement while remaining visually subtle.
  • Z-Index Controls: Full "Bring to Front" / "Send to Back" stack management.
  • Element Locking: Secure your work by locking elements to prevent accidental modifications.

πŸ‘₯ Living Collaboration System

  • Mock Presence: Simulated multi-user activity with dynamic cursors, name tags, and color-coded avatars.
  • Typing Indicators: Real-time visual feedback when other "users" are adding text.
  • Activity Feed: A scrolling sidebar log capturing every move, resize, and creation on the board.
  • URL Persistence: Share your entire board state via compressed URL hashes. We use the CompressionStream API (GZIP) to keep links short and shareable even with complex drawings.

πŸ—οΈ Architecture & Folder Structure

The project follows a modular architecture designed for performance and maintainability:

Pixel-Collab/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ canvas/          # Core rendering engine
β”‚   β”‚   β”œβ”€β”€ CanvasRenderer.js    # Pure JS drawing logic (High Performance)
β”‚   β”‚   β”œβ”€β”€ minimapDraw.js       # Optimized drawer for the viewport overview
β”‚   β”‚   β”œβ”€β”€ useCanvasEvents.js   # Event orchestration (The Brain of the canvas)
β”‚   β”‚   └── SelectionOverlay.jsx # DOM-based handles for resizing/moving
β”‚   β”œβ”€β”€ components/      # React UI Layer
β”‚   β”‚   β”œβ”€β”€ collaboration/       # Cursors, Activity Feed, Typing Indicators
β”‚   β”‚   β”œβ”€β”€ elements/            # Canvas-aligned DOM overlays (Text inputs, Stickies)
β”‚   β”‚   β”œβ”€β”€ layout/              # Shell, TopBar, Side panels
β”‚   β”‚   └── toolbar/             # Main tools, color pickers, and tool options
β”‚   β”œβ”€β”€ hooks/           # Custom Logic
β”‚   β”‚   β”œβ”€β”€ useKeyboard.js       # Global hotkeys (V, H, T, P, Ctrl+Z, etc.)
β”‚   β”‚   β”œβ”€β”€ useMockCollaboration.js # The simulation engine
β”‚   β”‚   └── useViewport.js       # Camera math (Zoom/Pan transformations)
β”‚   β”œβ”€β”€ store/           # Global State
β”‚   β”‚   └── useStore.js          # Central Zustand store with undo/redo & history
β”‚   β”œβ”€β”€ tools/           # Modular Tool Logic
β”‚   β”‚   β”œβ”€β”€ SelectTool.js        # Complex selection/move/marquee logic
β”‚   β”‚   └── ... (Pencil, Shape, Text, Eraser, Pan)
β”‚   └── utils/           # Math & System Helpers
β”‚       β”œβ”€β”€ snapAlignment.js     # Magnetic alignment math
β”‚       β”œβ”€β”€ persistence.js       # GZIP compression for URL state
β”‚       └── geometry.js          # Hit-testing and bounding box math
└── tests/               # Vitest + React Testing Library suite

πŸ› οΈ Tech Stack & Credits

Technology Usage
React 19 Modern UI components and hooks
Vite 8 Ultra-fast build tool and HMR
Zustand Lightweight, high-performance state management
Tailwind CSS 4 Utility-first styling with the new v4 engine
Lucide React Clean, consistent iconography
CompressionStream Native browser GZIP for URL state serialization
jsPDF Professional PDF export capabilities
Vitest Reliable unit and integration testing

πŸ“¦ Installation & Setup

  1. Clone the Repository:

    git clone https://github.com/rishab11250/HackStreet-2K26.git
    cd HackStreet-2K26/Pixel-Collab
  2. Install Dependencies:

    npm install # or pnpm install
  3. Run Development Server:

    npm run dev
  4. Build for Production:

    npm run build

πŸ§ͺ Quality Assurance

We maintain high code quality with 27+ automated tests.

npm run test

πŸ“„ License

Created for HackStreet 2026. Open source under the MIT License.

About

🎨 High-performance collaborative whiteboard with React 19, custom canvas engine, magnetic snapping, and GZIP-compressed state sharing.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors