Skip to content

zahidkhandev/flopods

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

34 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Flopods: AI Workflow Canvas

🌊 Flopods

The Next-Generation Multi-LLM, Node-Based Workflow Platform

License: MIT Node.js Version PRs Welcome

Features β€’ Quick Start β€’ Documentation β€’ Architecture β€’ Contributing


🎯 The Vision

Flopods empowers AI power users, developers, and researchers by providing an infinite, node-based canvas for building, managing, and executing complex AI workflows. It eliminates subscription overload, context fragmentation, and workflow inefficiencies by unifying multiple Large Language Models (LLMs) into a single, visual interface.

Why Flopods?

  • βœ… Unified Multi-LLM Interface: Connect OpenAI, Anthropic, Google Gemini, and more in one workflow
  • βœ… Visual Workflow Builder: Drag-and-drop canvas for AI workflow orchestration
  • βœ… Open Source First: Self-hostable with LocalStack for local AWS emulation
  • βœ… Production Ready: Built with enterprise-grade architecture and best practices
  • βœ… Document Intelligence: Advanced OCR, PDF parsing, and RAG (Retrieval-Augmented Generation)
  • βœ… Real-time Collaboration: WebSocket-powered live updates for teams

πŸ› οΈ Core Technologies

This project is built with a cutting-edge, production-ready stack:

Backend

  • Framework: NestJS (TypeScript) for robust, scalable APIs
  • Database: PostgreSQL with Prisma ORM + pgvector for embeddings
  • Cache & Queue: Redis (BullMQ) for background job processing
  • AWS Services: S3, DynamoDB, SES (via LocalStack for local dev)
  • Authentication: JWT + OAuth (Google, GitHub)
  • AI/ML: Google Gemini API, Tesseract.js OCR, PDF parsing

Frontend

  • Framework: React 18 + TypeScript + Vite
  • Canvas: React Flow for node-based workflow visualization
  • Styling: Tailwind CSS 4.x
  • State Management: Context API + React Query
  • Real-time: Socket.IO client

Infrastructure

  • Monorepo: Turborepo with intelligent caching and parallel execution
  • Container Runtime: Docker or Podman (configurable per OS)
  • Code Quality: ESLint, Prettier, Husky pre-commit hooks

πŸ“ Workspace Structure

flopods/
β”‚
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ backend/          # NestJS API server
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ common/   # Shared modules (AWS, Queue, Guards, Filters)
β”‚   β”‚   β”‚   β”œβ”€β”€ v1/       # API v1 (Auth, Workspaces, Documents, Flows)
β”‚   β”‚   β”‚   └── prisma/   # Prisma client
β”‚   β”‚   └── dist/         # Production build
β”‚   β”‚
β”‚   └── frontend/         # React + Vite application
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   β”œβ”€β”€ components/
β”‚       β”‚   β”œβ”€β”€ pages/
β”‚       β”‚   β”œβ”€β”€ hooks/
β”‚       β”‚   └── lib/
β”‚       └── dist/         # Production build
β”‚
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ schema/           # Prisma schema and database client
β”‚   β”œβ”€β”€ tsconfig/         # Shared TypeScript configurations
β”‚   └── eslint-config/    # Shared ESLint configurations
β”‚
β”œβ”€β”€ docker/
β”‚   β”œβ”€β”€ db-docker-compose.yaml           # PostgreSQL + pgvector
β”‚   β”œβ”€β”€ redis-docker-compose.yaml        # Redis for queues
β”‚   └── localstack-docker-compose.yaml   # Local AWS emulation
β”‚
β”œβ”€β”€ setup.sh              # Linux/macOS setup script
β”œβ”€β”€ setup.bat             # Windows setup script
β”œβ”€β”€ .env.example          # Environment template for contributors
└── turbo.json            # Turborepo configuration

πŸš€ Quick Start

Prerequisites

  • Node.js: >= 20.0.0
  • Yarn: >= 4.0.0 (automatically installed via Corepack)
  • Docker or Podman: For running PostgreSQL, Redis, and LocalStack

Option 1: Automated Setup (Recommended)

Windows

.\setup.bat                 # Uses Docker (default)
.\setup.bat podman          # Uses Podman

Linux / macOS

chmod +x setup.sh
./setup.sh                  # Uses Docker (default)
./setup.sh podman           # Uses Podman

The setup script will automatically:

  1. βœ… Validate Node.js & Docker/Podman installation
  2. βœ… Install dependencies (yarn install)
  3. βœ… Create .env file from .env.example
  4. βœ… Start containerized services (PostgreSQL, Redis, LocalStack)
  5. βœ… Generate Prisma client
  6. βœ… Run database migrations
  7. βœ… Prompt to seed pricing models (optional)
  8. βœ… Start development servers

Option 2: Manual Setup

1. Clone the Repository

git clone https://github.com/yourusername/flopods.git
cd flopods

2. Install Dependencies

yarn install

3. Set Up Environment Variables

cp .env.example .env

Default configuration works out-of-the-box for local development!

4. Start Infrastructure Services

# Using Docker (default)
yarn docker:dev

# Using Podman
yarn podman:dev

This starts:

  • PostgreSQL with pgvector on port 5434
  • Redis on port 6379
  • LocalStack (AWS emulation) on port 4566

5. Run Database Migrations

yarn db:migrate:deploy

6. (Optional) Seed Pricing Models

cd packages/schema
yarn add -D tsx
cd ../..
yarn db:seed:pricing

7. Start Development Servers

yarn dev

This starts both frontend and backend concurrently:

Access the Application

Open your browser and navigate to http://localhost:5173 πŸŽ‰


πŸ“‹ Key Commands

Development

Command Description
yarn dev Start both frontend and backend in dev mode
yarn dev:backend Start backend only
yarn dev:frontend Start frontend only
yarn build Build all packages for production
yarn lint Lint all code
yarn lint:fix Fix linting issues automatically
yarn type-check Run TypeScript type checking
yarn format Format all code with Prettier
yarn test Run all tests

Database (Prisma)

Command Description
yarn db:generate Generate Prisma Client after schema changes
yarn db:migrate Create and apply database migrations
yarn db:push Push schema changes to database (dev)
yarn db:studio Open Prisma Studio (database GUI)
yarn db:seed:pricing Seed LLM pricing models (21 models)
yarn db:reset Reset database (⚠️ deletes all data)

Docker Services

Command Description
yarn docker:dev Start all services (DB, Redis, LocalStack)
yarn docker:dev:down Stop all services
yarn docker:dev:clean Stop and remove all volumes (⚠️ deletes data)
yarn docker:db:up Start PostgreSQL only
yarn docker:redis:up Start Redis only
yarn docker:localstack:up Start LocalStack only
yarn docker:localstack:logs View LocalStack logs

Podman Services

First, install podman-compose:

pip3 install podman-compose
Command Description
yarn podman:dev Start all services (DB, Redis, LocalStack)
yarn podman:dev:down Stop all services
yarn podman:dev:clean Stop and remove all volumes (⚠️ deletes data)
yarn podman:db:up Start PostgreSQL only
yarn podman:redis:up Start Redis only
yarn podman:localstack:up Start LocalStack only
yarn podman:localstack:logs View LocalStack logs

Maintenance

Command Description
yarn clean Remove build artifacts and node_modules
yarn reinstall Clean install all dependencies
yarn check Run type-check, lint, and format checks
yarn fix Auto-fix linting and formatting issues

🎨 Features

Core Features

  • βœ… Monorepo Architecture: Turborepo with intelligent caching
  • βœ… Type Safety: Full TypeScript coverage across frontend and backend
  • βœ… Visual Workflow Builder: React Flow for node-based canvas
  • βœ… Multi-LLM Support: OpenAI, Anthropic, Google Gemini integration
  • βœ… Document Intelligence: PDF parsing, OCR, RAG system with pgvector
  • βœ… Real-time Collaboration: WebSocket-powered live updates
  • βœ… Background Processing: BullMQ for document processing queues
  • βœ… Local AWS Emulation: LocalStack for S3, DynamoDB, SES
  • βœ… OAuth Integration: Google and GitHub authentication
  • βœ… Magic Link Auth: Passwordless email authentication
  • βœ… 21 LLM Models Pre-configured: OpenAI, Claude, Gemini pricing & capabilities

Infrastructure

  • βœ… Production-Ready: ESLint, Prettier, Husky configured
  • βœ… Database Migrations: Prisma for schema management
  • βœ… Hot Reload: Fast development with Vite and NestJS watch mode
  • βœ… One-Command Setup: Automated setup script for all OS
  • βœ… Environment Management: Secure .env configuration with proxy support

πŸ—οΈ Architecture

Backend Architecture

apps/backend/src/
β”œβ”€β”€ common/                    # Shared modules
β”‚   β”œβ”€β”€ aws/                   # AWS services (S3, DynamoDB, SES)
β”‚   β”œβ”€β”€ decorators/            # Custom decorators (auth, pagination)
β”‚   β”œβ”€β”€ filters/               # Exception filters
β”‚   β”œβ”€β”€ guards/                # Auth guards (JWT, OAuth)
β”‚   β”œβ”€β”€ interceptors/          # Response transformation
β”‚   β”œβ”€β”€ queue/                 # Queue abstraction (Redis/SQS)
β”‚   └── websocket/             # WebSocket gateway
β”‚
β”œβ”€β”€ v1/                        # API Version 1
β”‚   β”œβ”€β”€ auth/                  # Authentication (JWT, OAuth, Magic Link)
β”‚   β”œβ”€β”€ workspaces/            # Workspace management
β”‚   β”œβ”€β”€ flows/                 # Workflow canvas
β”‚   β”œβ”€β”€ documents/             # Document processing & RAG
β”‚   β”œβ”€β”€ pods/                  # Workflow nodes
β”‚   └── users/                 # User management
β”‚
└── prisma/                    # Database client

Database Schema

Core Entities:
- Users β†’ Workspaces (1:N with roles)
- Workspaces β†’ Flows (1:N)
- Flows β†’ Pods (1:N, canvas nodes)
- Workspaces β†’ Documents (1:N with RAG)
- Documents β†’ DocumentChunks (1:N with embeddings)
- Documents β†’ DocumentCosts (1:N for billing)
- ModelPricingTier (21 LLM models with real October 2025 pricing)

Technology Stack

Data Persistence

  • PostgreSQL: Primary database with pgvector extension
  • DynamoDB: Pod state, execution history, context chains
  • S3: File storage (documents, images, exports)
  • Redis: Queue management, caching

Processing Pipeline

Upload β†’ Validate β†’ Queue (BullMQ) β†’ Process (OCR/PDF) β†’ Chunk β†’ Embed (Gemini) β†’ Store (pgvector) β†’ Search

πŸ§ͺ Testing

# Run all tests
yarn test

# Run tests in watch mode
yarn test:watch

# Generate coverage report
yarn test:cov

# E2E tests (backend only)
yarn test:e2e

🚒 Deployment

Build for Production

yarn build

Output locations:

  • Backend: apps/backend/dist/
  • Frontend: apps/frontend/dist/

Frontend Deployment

Deploy apps/frontend/dist/ to static hosting:

  • Vercel: vercel deploy
  • Netlify: Drag & drop dist/ folder
  • AWS S3 + CloudFront: aws s3 sync dist/ s3://your-bucket

Backend Deployment

Deploy apps/backend/dist/ to Node.js runtime:

  • AWS EC2: Copy dist/ and run node main.js
  • Docker: Build container with NestJS runtime
  • Render/Railway: Connect GitHub repository

Environment Variables: Configure DATABASE_URL, JWT_*, and real AWS credentials in your hosting dashboard.

Database Migrations (Production)

yarn db:migrate:deploy

πŸ“š Documentation


🀝 Contributing

We welcome contributions from the community! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes and commit: git commit -m 'Add amazing feature'
  4. Push to your fork: git push origin feature/amazing-feature
  5. Open a Pull Request

Development Guidelines

  • Follow existing code style (ESLint + Prettier)
  • Write tests for new features
  • Update documentation as needed
  • Keep commits atomic and descriptive

Code Quality Checks

Before submitting a PR, run:

yarn check  # Type-check + lint + format

πŸ“„ License

MIT License - see LICENSE file for details


Author

Zahid Khan (@zahidkhandev)


Acknowledgments


Built with ❀️ using Turborepo, NestJS, React, and Prisma

⭐ Star this repo if you find it useful!