A modern, interactive web application for building chatbot conversation flows using React and React Flow. Create, connect, and manage message nodes with an intuitive drag-and-drop interface.
ChatFlow in action - Building a conversational flow with multiple connected message nodes
- Drag & Drop Interface: Easily add message nodes to the canvas
- Visual Flow Builder: Connect nodes with intuitive edge connections
- Real-time Editing: Edit node text content in the settings panel
- Flow Validation: Ensure all nodes are properly connected before saving
- Modern UI: Clean, responsive design with professional styling
- React Flow Integration: Powered by React Flow for smooth node interactions
- State Management: Efficient state handling with React hooks
- Component Architecture: Modular, reusable components
- Validation System: Comprehensive flow validation with error handling
- Responsive Design: Works seamlessly across different screen sizes
- Node.js (version 14 or higher)
- npm or yarn package manager
-
Clone the repository
git clone <repository-url> cd chatflow
-
Install dependencies
npm install
-
Start the development server
npm start
-
Open your browser Navigate to
http://localhost:3000to see the application
- Drag a "Message" node from the left panel onto the canvas
- Drop it anywhere on the canvas to create a new message node
- Click and drag from the bottom handle (source) of one node
- Connect to the top handle (target) of another node
- Release to create a connection between the nodes
- Click on any node to select it
- Edit the text in the settings panel on the right
- Changes are reflected immediately on the canvas
- Click the "💾 Save Flow" button in the top-right corner
- Validation ensures all nodes are connected and have content
- Success/Error messages provide clear feedback
src/
├── components/
│ ├── FlowCanvas.jsx # Main canvas with React Flow
│ ├── NodesPanel.jsx # Left panel with draggable nodes
│ ├── SettingsPanel.jsx # Right panel for node editing
│ ├── TextNode.jsx # Custom message node component
│ └── SaveButton.jsx # Save and validation button
├── utils/
│ └── validation.js # Flow validation logic
├── App.js # Main application component
└── App.css # Global styles
- React 18: Modern React with hooks
- React Flow: Node-based editor library
- CSS3: Custom styling and responsive design
- UUID: Unique identifier generation
- HTML5 Drag & Drop: Native drag and drop functionality
The application enforces the following validation rules:
- Minimum Nodes: Flow must contain at least one node
- Connection Requirements:
- Single node flows are always valid
- Multiple node flows require all nodes to have at least one connection
- Content Requirements: All nodes must have non-empty text content
- Error Handling: Clear error messages for validation failures
- Draggable "Message" node template
- Usage instructions and guidelines
- Clean, organized layout
- Interactive React Flow canvas
- Grid background for visual reference
- Zoom controls and minimap
- Node selection and connection tools
- Node text editor for selected nodes
- Real-time content updates
- Clear visual feedback for selection state
- Prominent save functionality
- Validation feedback
- Success/error message display
- ✅ Drag & Drop: Fixed node persistence on canvas
- ✅ Text Editing: Real-time text updates on nodes
- ✅ State Management: Resolved circular update issues
- ✅ Validation: Improved flow validation logic
- ✅ Branding: Updated to ChatFlow branding with custom favicon
- Memoized node types to prevent React Flow warnings
- Optimized state management between components
- Added proper error handling and debugging
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add 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.
- React Flow for the excellent node-based editor library
- React for the powerful UI framework
- The open-source community for inspiration and best practices
Built with ❤️ for creating amazing chatbot experiences
