Skip to content

About

Visual node-based workflow editor with drag-drop interface, SQLite backend, and real-time parameter editing

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Node Flow Editor

A visual node-based workflow editor for configuring data processing pipelines. Built with vanilla JavaScript, Tailwind CSS, Flask, and SQLite.

Node Flow Editor Python License

Features

  • 🎨 Modern Dark UI - Professional OLED dark theme optimized for developer tools
  • 🔌 Drag & Drop - Intuitive drag-and-drop interface for building workflows
  • 🔗 Visual Connections - Smooth bezier curves connecting node inputs and outputs
  • ⚙️ Live Parameter Editing - Edit node parameters in real-time with type-aware inputs
  • 💾 SQLite Backend - All component data stored in SQLite, easy to extend
  • 📱 Responsive Design - Works on desktop, tablet, and mobile
  • ⌨️ Keyboard Shortcuts - Full keyboard navigation support
  • 💨 Auto-save - Automatic persistence to localStorage

Demo

Visual Node Editor

  • Drag components from sidebar to canvas
  • Connect nodes by dragging between ports
  • Edit parameters in the properties panel
  • Pan and zoom the canvas
  • Delete nodes and connections

Supported Parameter Types

  • Float - Decimal numbers with step control
  • Integer - Whole numbers
  • Boolean - True/False radio buttons
  • String - Text input or dropdown (with options)

Quick Start

1. Install Dependencies

pip install -r requirements.txt

2. Start the API Server

python3 api.py

This will:

3. Open the Editor

Option A - Direct file:

open node-editor.html

Option B - Local server:

python3 -m http.server 9999
# Then open: http://localhost:9999/node-editor.html

Project Structure

autora2/
├── node-editor.html          # Main frontend application
├── api.py                    # Flask REST API server
├── components.db.sql         # Database schema and sample data
├── components.db             # SQLite database (auto-generated)
├── requirements.txt          # Python dependencies
├── setup.sh                  # Setup script
├── NODE_EDITOR_DESIGN.md     # Complete design specification
├── NODE_EDITOR_README.md     # User guide
└── README_SQLITE.md          # SQLite backend documentation

Architecture

┌─────────────────┐      HTTP       ┌─────────────────┐      SQL      ┌─────────────────┐
│  node-editor    │  ──────────────> │   Flask API     │ ────────────> │  SQLite DB      │
│  .html          │   GET /api/     │   (api.py)      │   SELECT *    │  (components    │
│  (Frontend)     │   components    │   (Backend)     │   FROM ...    │  .db)           │
└─────────────────┘  <────────────── └─────────────────┘ <──────────── └─────────────────┘
                         JSON                               Results

Usage

Creating Nodes

  1. Drag a component from the left sidebar (e.g., darts.json)
  2. Drop it anywhere on the canvas
  3. Repeat to add more nodes

Connecting Nodes

  1. Click and hold the output port (right side) of a node
  2. Drag to the input port (left side) of another node
  3. Release to create the connection
  4. Valid ports highlight green when hovering

Editing Parameters

  1. Click a node to select it
  2. The properties panel slides in from the right
  3. Modify parameter values
  4. Click "Save Changes" to apply

Canvas Navigation

  • Pan: Click and drag on empty canvas
  • Zoom: Mouse wheel or +/- buttons
  • Fit: Click fit-to-screen button

Keyboard Shortcuts

Shortcut Action
Delete / Backspace Delete selected node
Escape Close properties panel
Ctrl/Cmd + S Save canvas

API Endpoints

GET /api/components

Returns all components with their parameters.

Response:

[
  {
    "name": "darts",
    "parameters": [
      {
        "name": "x",
        "datatype": "float",
        "defaultValue": 0.0,
        "description": "X coordinate"
      }
    ]
  }
]

Database Schema

Components Table

CREATE TABLE components (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    name TEXT NOT NULL UNIQUE,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Parameters Table

CREATE TABLE parameters (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    component_id INTEGER NOT NULL,
    name TEXT NOT NULL,
    datatype TEXT NOT NULL,
    default_value TEXT,
    description TEXT,
    options TEXT,
    FOREIGN KEY (component_id) REFERENCES components(id)
);

Adding New Components

Method 1: SQL

sqlite3 components.db
INSERT INTO components (name) VALUES ('my_component');

INSERT INTO parameters (component_id, name, datatype, default_value, description)
VALUES (6, 'my_param', 'float', '1.0', 'My parameter description');

Method 2: Python

import sqlite3

conn = sqlite3.connect('components.db')
cursor = conn.cursor()

cursor.execute("INSERT INTO components (name) VALUES (?)", ('my_component',))
component_id = cursor.lastrowid

cursor.execute("""
    INSERT INTO parameters (component_id, name, datatype, default_value, description)
    VALUES (?, ?, ?, ?, ?)
""", (component_id, 'my_param', 'float', '1.0', 'Description'))

conn.commit()
conn.close()

Method 3: Edit Schema

Edit components.db.sql, then:

rm components.db
python3 api.py  # Recreates from schema

Sample Components

The editor includes 5 pre-configured components:

  1. darts - Coordinate-based processing (2 parameters)
  2. linear_model - ML model configuration (4 parameters)
  3. data_processor - Data pipeline settings (3 parameters)
  4. evaluator - Model evaluation metrics (2 parameters)
  5. neural_network - Neural network architecture (3 parameters)

Technologies

  • Frontend: Vanilla JavaScript, Tailwind CSS, HTML5
  • Backend: Flask 3.0, Python 3.8+
  • Database: SQLite 3
  • Icons: SVG (Heroicons style)
  • Fonts: IBM Plex Sans, JetBrains Mono (Google Fonts)

Browser Support

  • Chrome 90+
  • Firefox 88+
  • Safari 14+
  • Edge 90+

Design Principles

  • KISS - Keep it simple, no over-engineering
  • No unnecessary features - Only what's needed
  • Simple code structure - Easy to understand and modify
  • Minimal dependencies - Vanilla JS, no heavy frameworks

Development

View Database

sqlite3 components.db
sqlite> .tables
sqlite> SELECT * FROM components;

Reset Database

rm components.db
python3 api.py

Test API

curl http://localhost:5000/api/components | jq

Documentation

Troubleshooting

"Failed to load components" error

  • Ensure Flask API is running: python3 api.py
  • Check API is accessible: curl http://localhost:5000/api/components

CORS errors

  • flask-cors should handle this automatically
  • Check browser console for details

Database locked

  • Only one process can write to SQLite at a time
  • Close other connections to components.db

Future Enhancements

  • Undo/redo functionality
  • Multi-node selection
  • Connection type validation
  • Grid snapping toggle
  • Minimap for large canvases
  • Node grouping
  • Copy/paste nodes
  • Import/export JSON workflows
  • Export to image
  • Touch gestures for mobile

License

MIT License - feel free to use and modify

Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

Author

Created with Claude Code


Version: 1.0.0 Last Updated: 2026-01-16

About

Visual node-based workflow editor with drag-drop interface, SQLite backend, and real-time parameter editing

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages