A modern drag-and-drop chatbot flow builder built with:
- Next.js 15
- TypeScript
- ShadCN UI components
- Tailwind CSS
- Lucide icons
- React Flow
🔗 Live Demo • 🚀 Deployed on Vercel
- Drag-and-Drop Interface - Intuitive node placement and connections
- Real-Time Validation - Checks for empty nodes and disconnected flows
- Type-Safe Architecture - Full TypeScript support
- Responsive Design - Works across desktop, tablet and mobile devices
- Undo/Redo Support - (Planned for v2)
- Export/Import Flows - (Planned for v2)
- Framework: Next.js 15 (App Router)
- Styling: Tailwind CSS + ShadCN UI components
- Flow Builder: React Flow
- Icons: Lucide
- State Management: Zustand
- Form Validation: Custom validation (future improvement: add zod validations)
frontend/
├── src/
│ ├── app/ # Next.js app router
│ ├── components/
│ │ ├── flow-builder/
│ │ │ ├── flow-builder.tsx
│ │ │ ├── flow-canvas.tsx
│ │ │ ├── nodes/
│ │ │ │ ├── message-node.tsx
│ │ │ │ ├── node-types.ts
│ │ │ └── panels/
│ │ │ ├── nodes-panel.tsx
│ │ │ └── settings-panel.tsx
│ │ └── ui/ # ShadCN components
│ ├── constants/
│ │ └── flowConstants.ts
│ ├── lib/
│ │ ├── flow-helpers.ts
│ │ ├── flow-validation.ts
│ │ └── utils.ts
│ ├── store/
│ │ ├── flowStore.ts
│ │ └── slices/ # Zustand slices
│ ├── types/
│ │ └── flow.ts
│ └── styles/ # Global styles
├── public/ # Static assets
├── package.json
└── README.md| Component | Purpose | Key Technologies |
|---|---|---|
FlowBuilder |
Root provider | ReactFlow, ErrorBoundary |
FlowCanvas |
Main workspace | ReactFlow, Zustand |
MessageNode |
Message node UI | ReactFlow Handles, Tailwind |
NodesPanel |
Node library | Drag-and-Drop API |
SettingsPanel |
Property editor | Controlled forms |
-
Install dependencies
npm install
-
Run development server
npm run dev
-
Build for production
npm run build
Open http://localhost:3000 in your browser to see the application.
-
State Management
Uses Zustand for atomic flow state updates with middleware support -
Node Architecture
Component registry pattern enables pluggable node types -
Validation System
Decoupled validation rules with error recovery
// Example validation rule
const validateFlow = (nodes, edges) => {
// Check for empty nodes
return emptyNodes.length ? 'Empty nodes detected' : null;
}-
Chatbot Flows
Build conversational logic with message nodes -
Workflow Automation
Design approval processes and conditional paths -
Educational Tools
Create interactive learning diagrams
| Hook | Description |
|---|---|
useFlowStore |
Access nodes, edges, and actions |
useNodeTypes |
Get registered node components |
useFlowValidation |
Run integrity checks |
To add a new node type:
- Create a new component in
src/components/flow-builder/nodes/ - Add the node type to
node-types.ts - Register it in the nodes panel
The easiest way to deploy is via Vercel.
- Basic node connections
- Real-time validation
- Version history (undo/redo)
- Custom node templates
- Collaborative editing
- Fork the repository
- Create feature branch (
git checkout -b feature/xyz) - Commit changes (
git commit -am 'Add feature xyz') - Push to branch (
git push origin feature/xyz) - Open pull request
MIT © [SK Imtiaj Uddin] 2025