FlowCanvas is an interactive visual editor built with React and @xyflow/react (React Flow), where users can drag predefined blocks, place them on a canvas, and connect them with meaningful restrictions (e.g., only Block A ➝ Block B connections are allowed). The application supports undo/redo, dark/light themes, and a modern aesthetic using glassmorphism.
- ✅ Drag & Drop Block A and B onto the canvas
- 🔗 Only valid connection allowed (Block A ➝ Block B)
⚠️ Error handled visually when invalid connections attempted- 🌗 Dark/Light theme toggle with matching designs
- ♻️ Undo/Redo (Ctrl+Z / Ctrl+Y) and Delete support
- 🌈 Stylish UI using gradients, glassmorphism, shadows
- 📍 Context menu popup on right-click (e.g., “Hello World”)
- ⚡ Responsive and smooth animations
- React (CRA)
- @xyflow/react (React Flow library)
- CSS Modules & custom styles
- UUID for unique node IDs
👉 https://flowcanvas.vercel.app
Follow these steps to run locally:
git clone https://github.com/yourusername/flowcanvas.git
cd flowcanvasMake sure you have Node.js and npm installed.
npm installnpm startThe app should open at http://localhost:3000
-
All nodes have both source and target handles.
-
Connections are validated in onConnect handler.
-
If invalid (e.g., B ➝ A or A ➝ A), an alert message is shown.
-
light mode: soft pastel gradient background, dark edges
-
dark mode: deep purple/blue with neon borders
-
Toggle button on canvas top-right (🌞 / 🌙)
-
FlowCanvas.jsx – Canvas, logic for connection and node state
-
Sidebar.jsx – Draggable block options (A and B)
-
blocks.json – Static block definitions
-
customStyles.css – UI styling, transitions, themes
src/
│
├── components/
│ ├── FlowCanvas.jsx
│ └── Sidebar.jsx
│
├── data/
│ └── blocks.json
│
├── App.jsx
├── customStyles.css
└── index.js-
Push your project to GitHub
-
Go to vercel.com → Import GitHub repo
-
Choose root directory (where package.json is)
-
Click Deploy
-
Copy the live link shown at the end