How aanasmahfouz/figma-clone works
FigPro is a browser-based collaborative vector editor. A designer enters the editor, creates or modifies canvas objects, and sees shared changes alongside collaborators’ cursors, reactions, and spatial comment threads; the canvas can also be exported as PDF. The graph combines sampled call sites and imports with README-documented capabilities. Several feature implementations and the room setup were not excerpted, so their connections are included only where documentation or the source index supports them.
Main entry points: app.tsx Editor orchestrator · live.tsx Collaboration UI · liveblocks.config.ts Presence and storage · canvas.ts Fabric canvas
Components 24
Editor entry
- Editor page
app/page.tsx - Root layout
app/layout.tsx - Room setup
app/room.tsx - Editor orchestrator
app/app.tsx
Canvas editing
- Fabric canvas
lib/canvas.ts - Shape creation
lib/shapes.ts - Keyboard actions
lib/key-events.ts - PDF export
components/settings/export.tsx
Live collaboration
- Collaboration UI
components/live.tsx - Presence and storage
liveblocks.config.ts - Active users
components/users/active-users.tsx - Cursor chat
components/cursor/cursor-chat.tsx - Live cursors
components/cursor/live-cursors.tsx - Flying reactions
components/reaction/flying-reaction.tsx
Spatial comments
- Thread placement
components/comments/new-thread.tsx - Pinned composer
components/comments/pinned-composer.tsx - Comment threads
components/comments/comments.tsx - Comment overlay
components/comments/comments-overlay.tsx
Editor interface
- Design inspector
components/right-sidebar.tsx - Layer list
components/left-sidebar.tsx - Editor toolbar
components/navbar.tsx - Shape menu
components/shapes-menu.tsx
Other components
- Designer
- Liveblocks service
Connections 29
- Designer → Editor page: opens
- Editor page → Editor orchestrator: loads
app/page.tsx - Root layout → Room setup: wraps in
app/layout.tsx - Editor orchestrator → Fabric canvas: initializes and renders
app/app.tsx - Editor orchestrator → Shape creation: syncs drawn shapes
app/app.tsx - Fabric canvas → Shape creation: creates shapes
lib/canvas.ts - Editor orchestrator → Keyboard actions: dispatches delete
app/app.tsx - Editor orchestrator → Design inspector: renders
app/app.tsx - Editor orchestrator → Layer list: renders
app/app.tsx - Editor orchestrator → Collaboration UI: renders
app/app.tsx - Editor orchestrator → Editor toolbar: provides editor controls
app/app.tsx - Editor toolbar → Shape menu: renders
components/navbar.tsx - Editor toolbar → Thread placement: opens
components/navbar.tsx - Design inspector → PDF export: offers export
components/right-sidebar.tsx - Fabric canvas → PDF export: exports canvas
- Room setup → Presence and storage: configures room
- Editor orchestrator → Presence and storage: mutates shared shapes
app/app.tsx - Presence and storage → Liveblocks service: syncs presence and storage
- Collaboration UI → Presence and storage: uses collaboration hooks
components/live.tsx - Collaboration UI → Live cursors: renders
components/live.tsx - Collaboration UI → Cursor chat: renders
components/live.tsx - Collaboration UI → Flying reactions: renders
components/live.tsx - Collaboration UI → Comment threads: renders
components/live.tsx - Presence and storage → Active users: supplies collaborator state
components/users/active-users.tsx - Thread placement → Pinned composer: renders
components/comments/new-thread.tsx - Thread placement → Presence and storage: creates threads
components/comments/new-thread.tsx - Comment overlay → Comment threads: displays threads
- Liveblocks service → Live cursors: broadcasts presence
- Liveblocks service → Flying reactions: broadcasts reactions