Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

docs(16-1): Complete Workflow Canvas Foundation plan

Juan Denis87771103e55c
diff --git a/.planning/ROADMAP.md b/.planning/ROADMAP.md
index f0b44cec..6b8feb71 100644
--- a/.planning/ROADMAP.md
+++ b/.planning/ROADMAP.md
@@ -27,7 +27,7 @@ Completed 2026-01-19 | 5 phases | Multi-environment app linking, shared DB suppo
| Phase | Name | Status | Goal |
|-------|------|--------|------|
-| 16 | Workflow Canvas Foundation | pending | React Flow canvas with pan/zoom, node rendering, connection system |
+| 16 | Workflow Canvas Foundation | **completed** | React Flow canvas with pan/zoom, node rendering, connection system |
| 17 | Resource Node Types | pending | Create node types for Docker apps, databases, domains |
| 18 | Node Configuration Panels | pending | Side panels for configuring each node type |
| 19 | Connection Logic | pending | Define and validate connections between nodes |
@@ -36,24 +36,26 @@ Completed 2026-01-19 | 5 phases | Multi-environment app linking, shared DB suppo
---
-## Phase 16: Workflow Canvas Foundation
+## Phase 16: Workflow Canvas Foundation ✓
**Goal**: Set up React Flow canvas with pan/zoom, basic node rendering, and connection system
-**Research**: Yes - evaluate React Flow library, understand canvas patterns
+**Status**: Completed 2026-01-19
-### Tasks
-1. Install and configure React Flow library
-2. Create WorkflowBuilder page with canvas
-3. Implement pan/zoom controls
-4. Add basic node rendering system
-5. Implement edge/connection drawing
-6. Add minimap and controls overlay
+### What Was Built
+- Installed @xyflow/react (React Flow) library
+- Created WorkflowBuilder page with canvas at /workflow
+- Added Background, Controls, and MiniMap components
+- Created BaseNode component with connection handles
+- Added node toolbar for adding Docker/Database/Domain nodes
+- Comprehensive LESS styles for workflow UI
### Success Criteria
-- [ ] Canvas renders with pan/zoom
-- [ ] Can add placeholder nodes
-- [ ] Can draw connections between nodes
-- [ ] Minimap shows overview
+- [x] Canvas renders with pan/zoom
+- [x] Can add placeholder nodes
+- [x] Can draw connections between nodes
+- [x] Minimap shows overview
+
+[Full Summary](./phases/16-workflow-canvas-foundation/SUMMARY.md)
---
diff --git a/.planning/STATE.md b/.planning/STATE.md
index b4468103..0add771b 100644
--- a/.planning/STATE.md
+++ b/.planning/STATE.md
@@ -2,7 +2,7 @@
## Current Status
- **Milestone**: 3 - Visual Workflow Builder
-- **Current Phase**: 16 - Workflow Canvas Foundation
+- **Current Phase**: 17 - Resource Node Types
- **Phase Status**: Pending
- **Last Updated**: 2026-01-19
@@ -10,13 +10,22 @@
| Phase | Status | Started | Completed |
|-------|--------|---------|-----------|
-| 16 | pending | - | - |
+| 16 | completed | 2026-01-19 | 2026-01-19 |
| 17 | pending | - | - |
| 18 | pending | - | - |
| 19 | pending | - | - |
| 20 | pending | - | - |
| 21 | pending | - | - |
+## Phase 16 Summary
+Workflow Canvas Foundation completed:
+- Installed @xyflow/react (React Flow) library
+- Created WorkflowBuilder page with canvas, controls, minimap
+- Added /workflow route and sidebar navigation
+- Created BaseNode component with handles and styling
+- Added node toolbar for adding Docker/Database/Domain nodes
+- Comprehensive LESS styles for workflow UI
+
## Milestone 3 Overview
Visual Workflow Builder (v1.2)
diff --git a/.planning/phases/16-workflow-canvas-foundation/SUMMARY.md b/.planning/phases/16-workflow-canvas-foundation/SUMMARY.md
new file mode 100644
index 00000000..324d8fa2
--- /dev/null
+++ b/.planning/phases/16-workflow-canvas-foundation/SUMMARY.md
@@ -0,0 +1,114 @@
+# Phase 16: Workflow Canvas Foundation - Summary
+
+## Overview
+Established the foundation for the visual workflow builder by integrating React Flow and creating the core canvas, node, and toolbar components.
+
+## Completed: 2026-01-19
+
+## What Was Built
+
+### 1. React Flow Integration
+**Package**: `@xyflow/react`
+
+Installed the React Flow library (formerly react-flow-renderer) which provides:
+- Pan/zoom canvas functionality
+- Node rendering and dragging
+- Edge/connection drawing
+- Built-in controls and minimap
+
+### 2. WorkflowBuilder Page
+**File**: `frontend/src/pages/WorkflowBuilder.jsx`
+
+Main page component with:
+- ReactFlowProvider wrapper for context
+- Canvas with pan/zoom/scroll behavior
+- Background with dots pattern
+- Controls component (zoom in/out/fit)
+- MiniMap for canvas overview
+- Node toolbar for adding nodes
+- State management with useNodesState/useEdgesState
+
+### 3. BaseNode Component
+**File**: `frontend/src/components/workflow/BaseNode.jsx`
+
+Custom node component featuring:
+- Color-coded header by node type (docker=blue, database=yellow, domain=green)
+- Icon display using Lucide React
+- Label and status display
+- Source and target connection handles
+- Selection state styling
+
+### 4. Routing and Navigation
+**Files**: `frontend/src/App.jsx`, `frontend/src/components/Sidebar.jsx`
+
+- Added `/workflow` route
+- Added "Workflow Builder" link in sidebar under Infrastructure section
+- Custom flow/network icon (connected circles)
+
+### 5. Workflow Styles
+**File**: `frontend/src/styles/pages/_workflow.less`
+
+Comprehensive styling for:
+- Full-height page layout
+- Canvas container with dark theme
+- Node appearance (card-like with header/body)
+- Connection handles with hover effects
+- Toolbar with type-specific button colors
+- React Flow controls and minimap theming
+- Animated edge styles
+
+## Commits
+
+| Hash | Message |
+|------|---------|
+| `ac8a57f` | feat(16-1): Install React Flow library |
+| `f762040` | feat(16-1): Create WorkflowBuilder page with React Flow canvas |
+| `b74374e` | feat(16-1): Add workflow route and sidebar navigation |
+| `68169b0` | feat(16-1): Add canvas controls, background, and minimap |
+| `d75b0f7` | feat(16-1): Create BaseNode component with handles |
+| `a766976` | feat(16-1): Add workflow builder styles |
+| `ed038df` | feat(16-1): Add node toolbar for adding nodes to canvas |
+
+## Files Changed
+
+| File | Type | Lines |
+|------|------|-------|
+| `frontend/package.json` | Modified | +1 dep |
+| `frontend/src/pages/WorkflowBuilder.jsx` | New | ~140 |
+| `frontend/src/components/workflow/BaseNode.jsx` | New | ~58 |
+| `frontend/src/styles/pages/_workflow.less` | New | ~302 |
+| `frontend/src/styles/main.less` | Modified | +1 import |
+| `frontend/src/App.jsx` | Modified | +2 lines |
+| `frontend/src/components/Sidebar.jsx` | Modified | +10 lines |
+
+## Success Criteria
+
+- [x] Canvas renders with pan/zoom
+- [x] Can add placeholder nodes (via toolbar)
+- [x] Can draw connections between nodes
+- [x] Minimap shows overview
+
+## Verification
+
+- [x] `npm run build` passes without errors
+- [x] `/workflow` route accessible
+- [x] Sidebar shows "Workflow Builder" link
+- [x] Canvas renders with background grid (dots)
+- [x] Can pan and zoom the canvas
+- [x] Controls (zoom buttons) visible and working
+- [x] MiniMap shows canvas overview
+- [x] Can add placeholder nodes via toolbar
+- [x] Nodes are draggable
+- [x] Can draw connections between nodes (smoothstep animated edges)
+
+## Technical Notes
+
+- React Flow requires wrapping canvas in `ReactFlowProvider`
+- Custom nodes must be memoized and registered in `nodeTypes` prop
+- `useReactFlow` hook provides `screenToFlowPosition` for coordinate conversion
+- Node IDs must be unique strings
+- Edge default options configured for animated smoothstep style
+
+## Next Phase
+
+Phase 17 will create specific resource node types (DockerAppNode, DatabaseNode, DomainNode) with more detailed displays and a node palette.