Skip to content
ย 
ย 

Latest commit

ย 

History

47 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

OpenFlowKit โšก๏ธ

FlowMind Banner React TypeScript License Product Hunt

The Open-Source, White-Label Diagramming Engine.
Built for technical teams who need to bridge the gap between code and high-fidelity design. 100% Free & MIT Licensed.

OpenFlowKit is a professional-grade White-Label Solution for developers. Whether you're embedding a canvas into your SaaS or building your own diagramming tool, OpenFlowKit provides the performance of React Flow with a billionaire-tier designer aesthetic.

OpenFlowKit Canvas

๐Ÿ“‹ Table of Contents


๐ŸŒŸ Why OpenFlowKit?

  • MIT Licensed: 100% free to use, fork, and integrate into commercial products.
  • Pure White-Label: The UI dynamically absorbs YOUR brand tokens. It looks like your product, not a third-party plugin.
  • Diagram-as-Code Native: Full compatibility with Mermaid.js and the OpenFlow DSL V2.
  • High-Fidelity UX: Glassmorphism, smooth animations, and CAD-inspired aesthetics out of the box.
  • Privacy First: Local-first architecture with optional BYOK (Bring Your Own Key) for AI features.
  • AI-Powered: Generate complete diagrams from natural language using Flowpilot (Gemini integration).

๐Ÿ”ฅ Key Features

โšช White-Label Brand Engine

Don't just embed a toolโ€”embed your brand. Our engine generates harmonious palettes from a single primary color:

  • Brand Kits: Toggle between "Wireframe", "Executive", or "Dark Mode" identities.
  • Dynamic Typography: Natively supports Google Fonts integration (Inter, Roboto, Outfit, Playfair, Fira, and system fonts).
  • Design System Panel: Fine-tune glassmorphism, corner radii, border weights, node padding, and edge styles via a unified settings panel.

White-Label Brand Engine

๐Ÿค– Flowpilot โ€” AI Diagram Generation

Generate entire diagrams from a text prompt using Gemini AI (BYOK โ€” Bring Your Own API Key):

  • Natural Language โ†’ Diagram: Describe a workflow in plain English and get a complete flowchart.
  • Privacy First: Your API key stays on your device. No server-side storage.
  • OpenFlow DSL V2: AI outputs the type-safe DSL, then auto-renders it on canvas.

React Flow Canvas

๐Ÿ–Œ๏ธ Native Figma Export

Generate clean, structured SVGs that behave like native Figma layers.

  • Vector Fidelity: Perfect rounded corners and gradients.
  • Editable Text: Labels export as text blocks, not paths.
  • One-Click Copy: Paste directly into Figma with standard Cmd+V.

Figma Export

๐Ÿ›  Advanced Diagram-as-Code

First-class support for Mermaid.js and the OpenFlow DSL V2.

  • Mermaid Support: Flowcharts, State Diagrams, and Subgraphs.
  • Live Two-Way Sync: Tweak the visual graph and watch the code update in real-time.
  • Auto-Layout: Industrial-grade layout algorithms powered by ELK.js.
  • OpenFlow DSL V2: A type-safe DSL with explicit node IDs, styling attributes, groups, and edge customization.

Diagram-as-Code

โŒจ๏ธ Command Bar (Cmd+K)

A Spotlight-style command palette for power users:

  • Quick Actions: Add nodes, run auto-layout, export, toggle panels โ€” all without leaving the keyboard.
  • Fuzzy Search: Find commands, templates, and settings instantly.
  • Keyboard First: Full keyboard shortcut support (Undo, Redo, Copy, Paste, Delete, Select All, Alt+Drag to duplicate).

๐ŸŽฌ Playback & Presentation Mode

Step through diagram construction like a slideshow:

  • Build-Order Replay: Watch nodes and edges appear in the order they were created.
  • Speed Controls: Adjust playback speed or step through manually.
  • Presentation Ready: Perfect for walkthroughs, demos, and documentation.

๐Ÿ“ฆ Starter Templates

Hit the ground running with 5 production-ready templates:

  • SaaS Subscription Flow
  • E-commerce Fulfillment Pipeline
  • AI Content Moderation System
  • Smart Support Triage
  • CI/CD DevOps Pipeline

๐Ÿ“ธ Snapshots & Version History

Save named snapshots of your diagram at any point:

  • Manual Snapshots: Save and restore any version of your work.
  • Local Storage: Everything stays on your device.

๐Ÿงฎ Alignment & Distribution

Precision layout tools for polishing diagrams:

  • Align: Left, center, right, top, middle, bottom.
  • Distribute: Even horizontal or vertical spacing across selected nodes.
  • Smart Edge Routing: Automatic path optimization to avoid node overlaps.

โš›๏ธ Built on React Flow

Leveraging the industry standard for node-based UIs, OpenFlowKit is highly performant and infinitely extensible.


๐Ÿงฉ Node Types

OpenFlowKit supports 10+ node types out of the box:

Node Type Description Shapes Available
Process Standard workflow step Rounded, Rectangle, Capsule, Circle, Ellipse, Diamond, Hexagon, Parallelogram, Cylinder
Decision Branching logic (if/else) Diamond (default), all shapes
Start Flow entry point Capsule (default), all shapes
End Flow termination Capsule (default), all shapes
Custom Freestyle node All shapes
Section / Group Container for grouping related nodes Rounded rectangle with dashed border
Annotation Sticky-note style comments Folded corner card
Text Standalone text labels No border / transparent
Image Embed images into diagrams Rounded card
Swimlane Lane-based process organization Horizontal lanes
Browser Browser mockup wireframe Chrome-style frame
Mobile Mobile device wireframe Phone-style frame

Every standard node supports:

  • 9 color themes: Slate, Blue, Emerald, Red, Amber, Violet, Pink, Yellow, Cyan
  • 120+ Lucide icons or custom icon URLs
  • Markdown labels with bold, italic, links, and inline code
  • Font customization: Family, size, weight, and style per node (or inherited from Design System)

๐Ÿ“ค Export Formats

Format Type Description
SVG File download Scalable vector graphic
PNG File download Raster image
JPG File download Compressed image
Figma Clipboard copy Editable SVG layers (paste with Cmd+V)
Mermaid Clipboard copy Mermaid.js syntax
PlantUML Clipboard copy PlantUML syntax
OpenFlow DSL Clipboard copy Type-safe DSL V2
JSON File save Full diagram state (nodes, edges, styles)

๐Ÿ—๏ธ Architecture & Project Structure

Built for performance and extensibility using the best modern web tech:

Project Map

OpenFlowKit/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ properties/         # Property panels for Nodes, Edges, Canvas
โ”‚   โ”‚   โ”œโ”€โ”€ SettingsModal/      # Brand, Privacy, Shortcuts, General settings
โ”‚   โ”‚   โ”œโ”€โ”€ custom-nodes/       # Browser, Mobile, Wireframe, Icon nodes
โ”‚   โ”‚   โ”œโ”€โ”€ command-bar/        # Cmd+K command palette
โ”‚   โ”‚   โ”œโ”€โ”€ ui/                 # Branded design system primitives
โ”‚   โ”‚   โ”œโ”€โ”€ landing/            # Landing page sections
โ”‚   โ”‚   โ”œโ”€โ”€ docs/               # Built-in documentation pages
โ”‚   โ”‚   โ”œโ”€โ”€ FlowEditor.tsx      # Main diagram orchestrator
โ”‚   โ”‚   โ”œโ”€โ”€ FlowCanvas.tsx      # React Flow canvas wrapper
โ”‚   โ”‚   โ”œโ”€โ”€ CustomNode.tsx      # Universal node renderer
โ”‚   โ”‚   โ”œโ”€โ”€ CustomEdge.tsx      # Styled edge renderer
โ”‚   โ”‚   โ”œโ”€โ”€ TopNav.tsx          # Top navigation bar
โ”‚   โ”‚   โ”œโ”€โ”€ Toolbar.tsx         # Left sidebar toolbar
โ”‚   โ”‚   โ”œโ”€โ”€ ExportMenu.tsx      # Export format picker
โ”‚   โ”‚   โ”œโ”€โ”€ CommandBar.tsx      # Spotlight-style command palette
โ”‚   โ”‚   โ”œโ”€โ”€ PlaybackControls.tsx # Presentation mode controls
โ”‚   โ”‚   โ”œโ”€โ”€ HomePage.tsx        # File management & Dashboard
โ”‚   โ”‚   โ””โ”€โ”€ WelcomeModal.tsx    # User onboarding
โ”‚   โ”œโ”€โ”€ hooks/
โ”‚   โ”‚   โ”œโ”€โ”€ useAIGeneration.ts  # Flowpilot AI integration
โ”‚   โ”‚   โ”œโ”€โ”€ useBrandTheme.ts    # Dynamic branding injection
โ”‚   โ”‚   โ”œโ”€โ”€ useDesignSystem.ts  # Design system token access
โ”‚   โ”‚   โ”œโ”€โ”€ useFlowHistory.ts   # Undo/Redo operations
โ”‚   โ”‚   โ”œโ”€โ”€ useFlowExport.ts    # SVG/PNG/JPG export
โ”‚   โ”‚   โ”œโ”€โ”€ usePlayback.ts      # Presentation mode logic
โ”‚   โ”‚   โ”œโ”€โ”€ useKeyboardShortcuts.ts # Hotkey bindings
โ”‚   โ”‚   โ”œโ”€โ”€ useAutoSave.ts      # Persistence & LocalStorage
โ”‚   โ”‚   โ”œโ”€โ”€ useSnapshots.ts     # Version history management
โ”‚   โ”‚   โ””โ”€โ”€ useClipboardOperations.ts # Copy/Paste with offset
โ”‚   โ”œโ”€โ”€ lib/                    # Parsers & Brand Logic
โ”‚   โ”‚   โ”œโ”€โ”€ mermaidParser.ts    # Mermaid.js โ†’ nodes/edges
โ”‚   โ”‚   โ”œโ”€โ”€ flowmindDSLParserV2.ts # OpenFlow DSL V2 parser
โ”‚   โ”‚   โ”œโ”€โ”€ brandService.ts     # Palette generation
โ”‚   โ”‚   โ”œโ”€โ”€ analytics.ts        # PostHog integration
โ”‚   โ”‚   โ””โ”€โ”€ types.ts            # Type definitions
โ”‚   โ”œโ”€โ”€ services/               # Core engines
โ”‚   โ”‚   โ”œโ”€โ”€ elkLayout.ts        # ELK.js auto-layout engine
โ”‚   โ”‚   โ”œโ”€โ”€ figmaExportService.ts # Vector SVG for Figma
โ”‚   โ”‚   โ”œโ”€โ”€ exportService.ts    # Image export (PNG, JPG, SVG)
โ”‚   โ”‚   โ”œโ”€โ”€ smartEdgeRouting.ts # Automatic edge path optimization
โ”‚   โ”‚   โ”œโ”€โ”€ AlignDistribute.ts  # Node alignment & spacing
โ”‚   โ”‚   โ”œโ”€โ”€ openFlowDSLExporter.ts # Nodes/edges โ†’ DSL V2
โ”‚   โ”‚   โ”œโ”€โ”€ geminiService.ts    # Gemini API client
โ”‚   โ”‚   โ””โ”€โ”€ templates.ts        # 5 starter templates
โ”‚   โ”œโ”€โ”€ store.ts                # Global Zustand state
โ”‚   โ””โ”€โ”€ theme.ts                # Color palettes & design tokens
โ”œโ”€โ”€ docs/                       # Documentation source files
โ”œโ”€โ”€ public/                     # Static assets & brand icons
โ””โ”€โ”€ index.css                   # Tailwind & custom styling

๐Ÿ”Œ Extensibility & Self-Hosting

OpenFlowKit is designed as a Local-First application for maximum privacy and simplicity. However, it is architected to be easily extended with a backend.

1. Connecting a Database

The entire storage logic is isolated in src/hooks/useSnapshots.ts. To add a database (Supabase, Firebase, or your own API):

  1. Fork the repo.
  2. Modify useSnapshots.ts to replace localStorage calls with your API fetch requests.
  3. The rest of the app (UI, Canvas, State) will work automatically.

2. Adding Authentication

The UI is prepared for auth integration.

  • Header: TopNav.tsx has a dedicated slot for a "Sign In" button.
  • Dashboard: HomePage.tsx can strict-gate content based on auth state.

3. Analytics

We use PostHog for privacy-friendly analytics.

  • Safe Forking: The analytics key is loaded from .env.local (which is gitignored).
  • No Pollution: If you fork this repo, analytics will not work until you add your own VITE_POSTHOG_KEY. Your data is safe; our data is safe.

4. AI Integration

The AI generation hook (useAIGeneration.ts) and service (geminiService.ts) are isolated modules.

  • BYOK Model: Users add their own Gemini API key via the Privacy Settings panel.
  • Swap Models: Replace geminiService.ts with any LLM API (OpenAI, Anthropic, local models).

Extensibility


๐Ÿš€ Getting Started

  1. Clone the repository

     git clone https://github.com/Vrun-design/OpenFlowKit.git
     cd OpenFlowKit
  2. Install & Launch

    npm install
    npm run dev
  3. Optional: Add AI features

    # Create .env.local and add your Gemini API key
    echo "VITE_GEMINI_API_KEY=your_key_here" > .env.local

๐Ÿค Contributing

We are building the open standard for diagramming. PRs for new Mermaid features, node types, or AI optimizations are highly encouraged!

  • Found a bug? Open an issue.
  • Want a feature? Start a discussion or open a PR.
  • Love the tool? โญ Star this repo! It helps us reach more developers.

๐Ÿ“„ License

MIT ยฉ [Varun]

About

The open-source, white-label diagramming canvas. Built with React Flow + Mermaid.js.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages