This project is a React-based Chatbot Flow Builder developed as part of the BiteSpeed Frontend Task. It provides a visual, drag-and-drop interface for creating and managing chatbot conversation flows by connecting multiple message nodes together to determine their execution order.
Live Demo: https://bite-speed-assignment-lb849ii4t-hrithiks-projects-a05d4764.vercel.app/
The goal was to build a simple yet extensible chatbot flow builder that allows users to:
- Visually design chatbot conversation flows
- Connect multiple text message nodes to create conversation paths
- Edit and manage message content through an intuitive interface
- Validate flow integrity before saving
- Create a foundation that can be easily extended with additional node types
- Visual Flow Builder: Drag-and-drop interface for creating chatbot flows
- Text Message Nodes: Support for multiple text message nodes in a single flow
- Node Connections: Connect nodes using edges to define conversation flow
- Real-time Editing: Click on any node to edit its content instantly
- Flow Validation: Ensures flow integrity before saving
- Persistent State: Save and manage flow configurations
- Extensible Architecture: Designed to easily accommodate new node types
- React Flow Integration: Built using the powerful React Flow library
- Component-based Design: Modular components for easy maintenance and extension
- State Management: Efficient state handling for complex flow operations
- Responsive Design: Works across different screen sizes
- Central component that orchestrates the entire flow building experience
- Manages the canvas where nodes and edges are rendered
- Handles node selection, drag-and-drop operations, and flow state
- Contains draggable node types that can be added to the flow
- Currently features Text Message nodes
- Designed to be extensible for future node types (image, video, conditional, etc.)
- Dynamic panel that replaces the Nodes Panel when a node is selected
- Provides text editing capabilities for the selected node
- Can be extended to support different property types for various node kinds
- Custom node component representing a text message in the chatbot flow
- Features source and target handles for connections
- Displays message content and handles visual feedback
- Custom edges that connect nodes together
- Implements the rule that each source handle can only have one outgoing edge
- Target handles can accept multiple incoming edges
- Source Handle: Can only have one edge originating from it
- Target Handle: Can have multiple edges connecting to it
- This ensures proper flow control and prevents ambiguous conversation paths
The application implements validation logic to ensure:
- No nodes with empty target handles exist (except for start nodes)
- All nodes are properly connected in a meaningful conversation flow
- Proper error messaging when validation fails
- Frontend Framework: Next.js (React 18+)
- Flow Library: React Flow
- Styling: CSS Modules / Tailwind CSS
- State Management: React Hooks (useState, useCallback)
- Build Tool: Next.js built-in tooling
- Deployment: Vercel
- Node.js (version 14 or higher)
- npm, yarn, pnpm, or bun
-
Clone the repository
git clone https://github.com/HrithikSampson/Workflow.git cd Workflow
-
Install dependencies
npm install # or yarn install # or pnpm install
-
Run the development server
npm run dev # or yarn dev # or pnpm dev
-
Open the application Navigate to http://localhost:3000 in your browser
-
Adding Nodes
- Drag a Text Message node from the Nodes Panel
- Drop it onto the canvas to add it to your flow
-
Connecting Nodes
- Click and drag from the source handle (bottom) of one node
- Connect it to the target handle (top) of another node
- Each source can only connect to one target
-
Editing Node Content
- Click on any node to select it
- The Settings Panel will appear with a text field
- Edit the message content and see changes reflected immediately
-
Saving Your Flow
- Click the "Save Changes" button to persist your flow
- The system will validate your flow before saving
- Error messages will appear if validation fails
- All nodes should be connected in a meaningful way
- No orphaned nodes (nodes without proper connections)
- Proper start and end points should be defined
The project is architected with extensibility in mind. Here are planned enhancements:
- Decision Nodes: Conditional branching based on user input
- Media Nodes: Support for images, videos, and files
- API Integration Nodes: External service calls
- User Input Nodes: Forms and data collection
- Undo/Redo Functionality: Operation history management
- Flow Templates: Pre-built conversation templates
- Export/Import: Flow sharing and backup capabilities
- Analytics Integration: Flow performance tracking
src/
βββ components/
β βββ FlowBuilder.js # Main flow component
β βββ NodesPanel.js # Draggable nodes panel
β βββ SettingsPanel.js # Node editing interface
β βββ nodes/
β βββ TextNode.js # Text message node component
βββ hooks/
β βββ useFlowState.js # Flow state management
βββ utils/
β βββ validation.js # Flow validation logic
βββ styles/
βββ globals.css # Global styles
- React Flow Choice: Selected for its robust node-graph capabilities and extensive customization options
- Component Modularity: Each node type is a separate component for easy extension
- State Management: Used React hooks for lightweight state management suitable for the current scope
- Validation Strategy: Implemented client-side validation to provide immediate feedback
- Efficient Rendering: React Flow handles virtual rendering for large flows
- State Optimization: Minimal re-renders through proper state management
- Memory Management: Proper cleanup of event listeners and effects
- Handle Connection Logic: Implementing the one-to-many relationship between source and target handles
- Dynamic Panel Switching: Seamless transition between Nodes Panel and Settings Panel
- Flow Validation: Creating robust validation that prevents invalid flow configurations
- State Persistence: Managing complex flow state while maintaining performance
The application can be tested through:
- Manual Testing: Interactive flow creation and validation
- Edge Case Testing: Invalid connections and orphaned nodes
- Responsive Testing: Different screen sizes and devices
This project welcomes contributions. Key areas for improvement:
- Additional node types
- Enhanced UI/UX
- Performance optimizations
- Test coverage expansion
This project is developed as part of a technical assessment and is available for educational and demonstration purposes.
Author: Hrithik Sampson
Project Type: Frontend Technical Assessment
Company: BiteSpeed
Technology Focus: React, Node.js Development