# Figma Clone
Table of Contents
Figma Clone
A minimalist Figma clone built with Next.js, Fabric.js, and Liveblocks for real-time collaborative design editing.
Tech Stack
- Next.js 14 - React framework
- Fabric.js - Canvas manipulation library
- Liveblocks - Real-time collaboration
- TypeScript - Type safety
- Tailwind CSS - Styling
- Radix UI - UI components
Setup
- Install dependencies:
npm install- Create
.env.localfile:
NEXT_PUBLIC_LIVEBLOCKS_PUBLIC_KEY=your_liveblocks_public_key- Run development server:
npm run devKey Features
- Real-time Collaboration - Multiple users can edit simultaneously with live cursors
- Shape Tools - Rectangle, Circle, Triangle, Line, Free Drawing
- Text Editing - Add and edit text with font customization
- Image Upload - Upload and place images on canvas
- Comments - Add comments and threads for collaboration
- Undo/Redo - History management (โ+Z / โ+Y)
- Export - Export canvas as PDF or image
- Shape Properties - Edit dimensions, colors, fonts, alignment
Project Structure
app/- Next.js app router pages and layoutcomponents/- React components (UI, canvas, comments, cursors)lib/- Canvas utilities, shape handlers, key eventsliveblocks.config.ts- Liveblocks configurationtypes/- TypeScript type definitions
Scripts
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint