Skip to content

bijankhazaei/flower

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌸 Flower - Visual Flow Builder

License: MIT Python 3.11+ FastAPI Contributions Welcome

A next-generation visual flow builder designed to address Langflow's architectural limitations through modern software engineering practices. Built with FastAPI and Porto architecture for scalability, maintainability, and performance.

✨ Features

  • 🎨 Visual Flow Editor - Drag-and-drop interface for building AI workflows
  • ⚑ High Performance - Async/await throughout with parallel node execution
  • πŸ—οΈ Porto Architecture - Modular, testable, and maintainable codebase
  • πŸ”Œ Extensible Nodes - Plugin-based system for custom node types
  • πŸš€ Real-time Compilation - Visual flows compiled to executable Python code
  • πŸ“Š Execution Monitoring - Track flow runs with detailed metrics
  • πŸ”’ Type Safety - Full Pydantic validation and SQLAlchemy models
  • 🐳 Docker Ready - Complete containerized deployment

πŸš€ Quick Start

Prerequisites

  • Python 3.11+
  • Docker & Docker Compose (recommended)

Option 1: Docker (Recommended)

git clone https://github.com/yourusername/flower.git
cd flower
./run.sh

Option 2: Local Development

git clone https://github.com/yourusername/flower.git
cd flower
pip install -r requirements.txt
uvicorn main:app --reload

Access the application:

Default Login

πŸ—οΈ Architecture

Flower uses the Porto Architecture pattern for clean, scalable code organization:

app/
β”œβ”€β”€ Containers/           # Business modules
β”‚   β”œβ”€β”€ Flow/            # Flow management
β”‚   β”œβ”€β”€ Node/            # Node system
β”‚   β”œβ”€β”€ Execution/       # Flow execution
β”‚   └── User/            # Authentication
└── Ship/                # Framework layer
    β”œβ”€β”€ Engine/          # Core application
    β”œβ”€β”€ Parents/         # Base classes
    └── Middlewares/     # HTTP middlewares

πŸ“š API Documentation

Flow Compilation

# Compile visual flow to Python code
POST /api/compiler/compile
{
  "flow_definition": {
    "nodes": [...],
    "connections": [...]
  }
}

# Execute flow with inputs
POST /api/compiler/execute
{
  "flow_definition": {...},
  "inputs": {"text": "hello world"}
}

Node Management

# List available node types
GET /api/nodes/types

# Get node information
GET /api/nodes/types/TextProcessorNode

# Validate node configuration
POST /api/nodes/validate

Execution Monitoring

# Get execution details
GET /api/executions/{execution_id}

# List recent executions
GET /api/executions/

πŸ”Œ Creating Custom Nodes

from app.Containers.Node.Engine.BaseNode import BaseNode, NodeMetadata, NodePort, DataType

class MyCustomNode(BaseNode):
    @property
    def metadata(self) -> NodeMetadata:
        return NodeMetadata(
            name="My Custom Node",
            description="Does something amazing",
            category="Custom"
        )
    
    @property
    def input_ports(self) -> List[NodePort]:
        return [NodePort(name="input", data_type=DataType.TEXT)]
    
    @property
    def output_ports(self) -> List[NodePort]:
        return [NodePort(name="output", data_type=DataType.TEXT)]
    
    async def _execute_logic(self, context: ExecutionContext) -> Dict[str, Any]:
        input_text = context.inputs.get("input", "")
        # Your custom logic here
        return {"output": f"Processed: {input_text}"}

# Register the node
from app.Containers.Node.Engine.BaseNode import node_registry
node_registry.register(MyCustomNode)

πŸ§ͺ Testing

# Run all tests
pytest

# Test the flow system
python test_flow_system.py

# Test API endpoints
python test_api_endpoints.py

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Ways to Contribute

  • πŸ› Report Bugs - Found an issue? Let us know!
  • πŸ’‘ Feature Requests - Have ideas? We'd love to hear them!
  • πŸ”§ Code Contributions - Submit PRs for bug fixes or new features
  • πŸ“– Documentation - Help improve our docs
  • 🎨 Node Library - Create new node types for the community
  • πŸ§ͺ Testing - Add tests to improve coverage

Development Setup

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes following our coding standards
  4. Add tests for new functionality
  5. Ensure all tests pass: pytest
  6. Submit a pull request

Priority Areas for Contributors

  • 🎨 Visual Editor Frontend - React/Vue.js canvas editor
  • πŸ€– LLM Nodes - OpenAI, Anthropic, local LLM integrations
  • πŸ”— Connectors - Database, API, file system integrations
  • πŸ“Š Monitoring - Enhanced execution analytics
  • πŸ”’ Security - Authentication and authorization improvements

πŸ“‹ Roadmap

Phase 1: Foundation βœ…

  • Flow compiler and execution engine
  • Node system and registry
  • REST API endpoints
  • Basic node library

Phase 2: Visual Editor πŸ”„

  • Canvas-based flow editor
  • Real-time collaboration
  • Flow templates and sharing

Phase 3: Advanced Features

  • LLM integration nodes
  • Advanced monitoring and analytics
  • Plugin marketplace
  • Enterprise features

πŸ†š Why Flower?

Feature Flower Langflow
Architecture Porto (modular) Monolithic
Performance Async/parallel Synchronous
Type Safety Full Pydantic Limited
Testing Built-in framework Manual
Extensibility Plugin system Hardcoded
Code Quality Clean separation Tightly coupled

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Inspired by Langflow's vision of visual AI workflows
  • Built with modern Python ecosystem tools
  • Community-driven development approach

πŸ“ž Support


⭐ Star this repo if you find it useful!

Made with ❀️ by the Flower community

About

A modern visual flow builder built with FastAPI and Porto architecture. Scalable alternative to Langflow with async performance, type safety, and real-time collaboration features.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors