How shreyansh-shankar/nodebox works
Project type and purpose
• A native desktop application (PyQt6) for visually building Python-based automation workflows.
• Key goal: drag-drop nodes (each a Python snippet), connect them into pipelines, integrate local LLM models via Ollama.
File structure
• Top-level executables and configs:
• main.py – application entry point.
• requirements.txt, .pre-commit, CI workflows.
• Core modules by directory:
• ui/ – all Qt window classes (main window, automation dialogs, placeholders).
• canvasmanager/ – logic for the node canvas, connection handling, save/load.
• automation_manager/ – node definitions, editor window, palette, port abstractions.
• browsemodels_manager/ – UI and logic to browse/download/manage Ollama models.
• features/ – plug-ins: debug console, export/import, scheduler, performance monitor, node templates.
• predefined/ – built-in node implementations and registry.
• utils/ – shared utilities: font loading, node execution runner, path management, performance bus.
• Other assets:
• qss/ – custom Qt styles.
• public/ – static website files (docs, downloads).
• firebase.json – hosting config for docs site.
• test_predefined_nodes.py – unit tests for predefined nodes.
README for additional insights
• Confirms three high-level concerns: UI, node/graph engine, model management.
• Emphasizes Ollama integration (local LLM service).
Main components & interactions
A. Components
1. User Interface Layer
• MainWindow, CanvasWidget, NodeEditorWindow, BrowseModelWindow, etc.
2. Canvas & Graph Engine
• canvasmanager classes handle drawing, connections, serialization (save/load).
3. Automation Manager
• Core node abstractions (Node, Port), node palette, node editor dialogs.
4. Model Browser & Download Manager
• Communicates with local Ollama server to list/download models.
5. Execution Engine
• utils/node_runner executes graph by invoking node code in order.
6. Predefined Node Library
• Built-in nodes for file I/O, data processing, LLM calls.
7. Feature Modules
• Debug console, workflow scheduler, performance monitor, export/import, templates.
8. File System / Persistence
• Saves workflows, node definitions, downloaded model files.
9. External Services
• Ollama local server (LLM inference).
B. Interactions and data flow
• UI events (drag/drop, connect nodes) → Canvas Engine updates graph model.
• Node creation/editing → Automation Manager (NodeEditor) persists node code.
• Running a workflow → Execution Engine reads graph model → invokes NodeRunner → Python code execution in each node.
• Browse Models UI → BrowseModels Manager sends HTTP to Ollama server → downloads model artifacts to local disk.
• Saving/loading workflows → File I/O flows through canvasmanager.saveload_methods.
• Feature modules attach via event hooks or menu actions.
Architectural patterns & principles
• Model-View-Controller (MVC) or Model-View-Presenter in UI: separate Qt widgets (views) from canvas model / node model.
• Plugin-style features loaded dynamically (features/ directory).
• Modular separation: each concern in its own package.
• Event bus or signal/slot pattern (Qt signals, utils/performance_bus).