NextViz is a local-first, node-based automation and UI orchestration engine designed specifically for the Next.js ecosystem. It allows developers to build complex logic, chatbots, and data pipelines visually within their own codebase—eliminating the need for external VPS hosting like n8n.
- Code-Owned: The workflows are stored as JSON files (
nextviz-flow.json) in the user's repository. If it’s in Git, it’s in NextViz. - Environment-Aware: Full editing power in
localhost; Read-Only safety in production (Vercel). - Zero-Latency: Workflows run as native Next.js Server Actions or API Routes.
- Vibe-First: Designed for "Vibe Coders" who want to drag, drop, and prompt their way to a functional backend.
-
Framework: Next.js 14+ (App Router).
-
Visual Engine:
reactflow(Handles the canvas, edge logic, and node dragging). -
Styling: Tailwind CSS +
lucide-reacticons +shadcn/ui. -
Storage:
-
Logic: Local
.jsonfiles. -
Secrets: A dedicated
.env.nextviz(auto-added to.gitignore). -
Database: Supabase (for persistent user data/logs).
-
Security: Node.js
fsmodule is strictly limited toprocess.env.NODE_ENV === 'development'.
The visual workspace. It interprets the JSON schema and renders it as a React Flow graph.
- Interaction: Dragging a node updates the local JSON via a Server Action.
- Marketplace: A sidebar of "Grayed-out" nodes that can be injected via CLI.
The "brain" that executes the workflow.
- It traverses the JSON graph.
- It identifies the Trigger (e.g., an incoming Webhook or a Button Click).
- It executes Action Nodes sequentially or in parallel based on the Logic Nodes (If/Else).
The "Delivery System."
init: Scaffolds the folders and installs dependencies.add <node>: Fetches specific component code into the user's local directory.
Important
Rule 1: The Local Bridge. All "Save" functionality must use Next.js Server Actions that interact with the local file system using fs/promises.
Rule 2: Type Strictness. Every node must have a TypeScript interface defining its Inputs and Outputs.
Rule 3: Secret Isolation. Never write secrets to the workflow.json. Always reference keys that exist in .env.nextviz.
Rule 4: Component Autonomy. Nodes are just React components. A user should be able to create a new node by simply dropping a .tsx file into app/nextviz/nodes/.
Your blank Next.js project will eventually be structured as follows:
/
├── app/
│ ├── nextviz/ <-- The Editor Route
│ │ ├── page.tsx <-- Main Canvas
│ │ ├── nodes/ <-- Folder for custom Node components (user-created)
│ │ └── layout.tsx
│ └── api/nextviz/ <-- Runtime endpoints (Triggers)
├── lib/
│ └── nextviz/ <-- Shared Framework Code (Read-only)
│ ├── engine.ts <-- The Execution Logic & Headless Orchestrator
│ ├── actions.ts <-- Server Actions (Save/Load flows)
│ ├── registry.ts <-- Node registry & Flow discovery
│ ├── services/ <-- Third-party integrations (Supabase, OpenAI, etc)
│ └── types.ts <-- Schema definitions
├── flows/ <-- 🎯 NEW: Individual Flow Storage
│ ├── default.json <-- Example: {id, name, nodes[], edges[]}
│ └── (user creates more flows here)
├── .nextviz/ <-- Optional: Flow metadata
│ └── metadata.json <-- Flow discovery & settings
├── .env.nextviz <-- Secrets (Ignored by Git)
└── next.config.mjs
Key Difference:
- Old:
nextviz-flow.jsonheld all flows in one array → merge conflicts - New:
flows/directory holds individual flow files → no conflicts, team-friendly
Goal: Build the foundational React Flow canvas and file-based persistence.
- Setup Next.js App Router with React Flow integration
- Implement
FlowRegistryfor auto-discovery of individual flow files - Create Server Actions for Save/Load operations (The "Local Bridge")
- Define TypeScript interfaces (
NextVizNode,WorkflowJSON, etc.) - Setup
.env.nextvizisolation and.gitignoreconfiguration
Goal: Enable users to manage multiple workflows and improve UX.
- Build "Add Flow" modal with name/description input
- Implement flow switching in the sidebar
- Add delete/rename/export operations for flows
- Create a "Recent Flows" history
- Implement dark mode default styling (
bg-zinc-950, semantic tokens)
Goal: Build the execution engine and foundational trigger/action nodes.
- Implement
executeFlow("flow-name", payload)direct invocation pattern - Build Kahn's algorithm topological sort with plan caching
- Create
onHTTPtrigger node (Webhook receiver) - Create
logDataaction node (Console/File logger) - Ensure engine is completely decoupled from UI (Headless design)
Goal: Implement the 9 most essential nodes that power 90% of automations.
- Schedule (Cron) — Runs flows on intervals (hourly, daily, custom cron expressions)
- UI: Time picker + Cron expression editor
- Executor: Uses Node.js
cronor node-schedule library - Output:
{ executedAt: ISO string }
- OpenAI / Anthropic — The "Brain" for natural language processing
- UI: Prompt editor + Model selector (gpt-4, gpt-3.5, claude-opus, etc.)
- Config: Temperature, max_tokens, system_role
- Output:
{ response: string, usage: { tokens_used, cost } }
- Vector Store (pgvector) — Supabase RAG integration
- UI: Query/Embed/Upsert actions selector
- Operations: Store embeddings, similarity search, retrieval augmented generation
- Output:
{ results: [], similarity_scores: [] }
- Filter / If-Else — The fork in the road
- UI: Visual condition builder (field > value, equals, contains, regex)
- Support: AND/OR logic, multiple branches
- Output: Routes to different downstream nodes based on condition
- Code (JavaScript) — The "Escaper" for custom logic
- UI: Monaco Editor with syntax highlighting
- Runtime: Sandboxed
eval()or V8 isolate - Input: Access all upstream node outputs via context
- Output: Whatever the user returns
- Supabase DB (CRUD) — The "Memory"
- UI: Table/RPC selector + Query builder
- Operations: SELECT, INSERT, UPDATE, DELETE, RPC calls
- Output:
{ data: [], rowCount: number }
- HTTP Request — The "Universal Connector"
- UI: Method selector (GET/POST/PUT/DELETE) + URL + Headers + Body
- Auth: Basic, Bearer token, API key support
- Output:
{ status: number, body: any, headers: {} }
- Discord / Slack — The "Voice"
- UI: Channel selector + Message formatter (plain text/markdown/rich embeds)
- Operations: Send to channel, thread, DM
- Output:
{ messageId: string, timestamp: number }
- Gmail / Resend — The "Letters"
- UI: Recipient + Subject + HTML body editor + attachment support
- Template: Support for variables from upstream nodes
- Output:
{ emailId: string, status: 'sent' | 'queued' }
Implementation Strategy:
- Create each node as a pair: UI component (
app/nextviz/nodes/{name}.tsx) + Executor (lib/nextviz/node-executors/{name}.ts) - All node configs are stored in the flow JSON's
node.datafield - Use
.env.nextvizfor all API keys (OpenAI, Anthropic, Discord token, etc.) - Executors follow the
NodeExecutorFnsignature:(nodeData, inputs, context) => Promise<output> - Add a Node Library sidebar showing all 9 nodes with drag-to-canvas support
Goal: Add enterprise-grade capabilities and optimization.
- Error Handling & Retries — Automatic retry logic with exponential backoff
- Flow Versioning — Store historical versions of flows in Git
- Execution Logs & Monitoring — Store execution history in Supabase
- Team Collaboration — Multi-user support with real-time updates (via Supabase Realtime)
- Node Marketplace — Community node sharing via GitHub/NPM
- Performance Monitoring — Track execution time, token usage, cost analytics
- Production Hardening — Rate limiting, security audits, API key rotation