FlowForge is an AI-powered, real-time collaborative whiteboard platform that transforms ideas into diagrams and diagrams into production-ready code. Built for modern teams who want to accelerate from concept to implementation.
- Text-to-Diagram: Convert natural language descriptions into complex system architectures instantly using Google's Gemini AI
- Diagram-to-Code: Generate production-ready React or Node.js boilerplate from your visual diagrams
- Contextual AI Assistant: In-canvas AI chat that understands your diagram context and assists with design decisions
- Multi-User Editing: Built on tldraw's powerful CRDT-based synchronization for seamless team collaboration
- Live Cursors: See team members' cursors and selections in real-time
- Member Management: Invite team members to boards via email with role-based access
- Infinite Canvas: Unlimited space for your ideas with smooth pan and zoom
- Rich Shape Library: Geo shapes, text boxes, arrows, sticky notes, and more
- Smart Shapes: Auto-routing connectors and alignment guides
- Export Options: Save your work and export diagrams
- OAuth Integration: Sign in with Google or GitHub
- Session Management: Secure session handling with Better Auth
- User Profiles: Personalized avatars and user information
- Node.js 20.x or higher
- pnpm 8.x or higher (recommended package manager)
- PostgreSQL database
- Google Cloud account (for OAuth and Gemini AI)
- GitHub OAuth app (optional, for GitHub sign-in)
-
Clone the repository
git clone https://github.com/0x-rekt/flowforge.git cd flowforge -
Install dependencies
pnpm install
-
Set up environment variables
Create a
.envfile in the root directory:# Database DATABASE_URL="postgresql://username:password@localhost:5432/flowforge" # Better Auth BETTER_AUTH_URL="http://localhost:3000" BETTER_AUTH_SECRET="your-super-secret-key-min-32-chars" # Google OAuth GOOGLE_CLIENT_ID="your-google-client-id" GOOGLE_CLIENT_SECRET="your-google-client-secret" # GitHub OAuth (optional) GITHUB_CLIENT_ID="your-github-client-id" GITHUB_CLIENT_SECRET="your-github-client-secret" # Google Gemini AI GEMINI_API_KEY="your-gemini-api-key"
-
Set up the database
pnpm prisma migrate dev
-
Start the development server
pnpm dev
-
Open your browser
Navigate to http://localhost:3000
- Next.js 16 - React framework with App Router
- React 19 - UI library
- TypeScript - Type safety
- Tailwind CSS - Utility-first CSS
- tldraw - Infinite canvas and drawing primitives
- Framer Motion - Animation library
- Radix UI - Accessible component primitives
- Next.js API Routes - Serverless API endpoints
- Prisma ORM - Type-safe database client
- PostgreSQL - Relational database
- Better Auth - Modern authentication solution
- Google Gemini 2.5 Flash - AI model for text-to-diagram and diagram-to-code
- @tldraw/sync - CRDT-based real-time synchronization
- Axios - HTTP client
- pnpm - Fast, disk space efficient package manager
- ESLint - Code linting
- PostCSS - CSS transformations
flowforge/
βββ app/ # Next.js App Router
β βββ (auth)/ # Authentication routes
β β βββ sign-in/ # Sign-in page
β βββ api/ # API routes
β β βββ ai/ # AI endpoints (text-to-diagram, diagram-to-code)
β β βββ auth/ # Better Auth API
β β βββ whiteboard/ # Whiteboard CRUD operations
β βββ board/[id]/ # Individual board view
β βββ dashboard/ # User dashboard
β βββ layout.tsx # Root layout
β βββ page.tsx # Landing page
βββ components/ # React components
β βββ ui/ # Reusable UI components (Radix)
β βββ AIChatPanel.tsx # AI assistant panel
β βββ BoardCanvas.tsx # Main canvas component
β βββ BoardCard.tsx # Dashboard board card
β βββ ... # Other components
βββ lib/ # Utility libraries
β βββ auth.ts # Better Auth configuration
β βββ prisma.ts # Prisma client instance
β βββ utils.ts # Utility functions
βββ prisma/ # Database schema and migrations
β βββ schema.prisma # Prisma schema
β βββ migrations/ # Database migrations
βββ utils/ # Helper utilities
β βββ prompt.ts # AI prompt builders
βββ public/ # Static assets
- Sign in with Google or GitHub
- Navigate to your dashboard
- Click "Create New Board"
- Start drawing or use AI commands
Text-to-Diagram:
- Click the AI chat icon in the canvas
- Describe your diagram (e.g., "Create a microservices architecture with API gateway, 3 services, and a database")
- Watch as AI generates the diagram
Diagram-to-Code:
- Draw or select your diagram components
- Open AI chat and request code generation
- Get production-ready React or Node.js boilerplate
- Open a whiteboard
- Click the "Add Member" button (user icon)
- Enter team member's email
- They'll receive access to the board
- User: User accounts with OAuth profiles
- Session: Active user sessions
- Account: OAuth provider accounts
- WhiteBoard: Canvas boards with JSON content
- WhiteBoardMember: Board sharing and permissions
See prisma/schema.prisma for the complete schema.
The project uses a custom Prisma client output directory:
generator client {
provider = "prisma-client"
output = "../generated/prisma"
}After schema changes, run:
pnpm prisma generate
pnpm prisma migrate dev --name your_migration_nameGoogle OAuth Setup:
- Go to Google Cloud Console
- Create a new project or select existing
- Enable Google+ API
- Create OAuth 2.0 credentials
- Add authorized redirect URI:
http://localhost:3000/api/auth/callback/google
Gemini AI Setup:
- Go to Google AI Studio
- Create an API key for Gemini
- Add to
.envasGEMINI_API_KEY
# Development
pnpm dev # Start development server
# Production
pnpm build # Build for production
pnpm start # Start production server
# Database
pnpm prisma migrate dev # Run migrations in development
pnpm prisma generate # Generate Prisma Client
pnpm prisma studio # Open Prisma Studio GUI- Push your code to GitHub
- Import project in Vercel
- Add environment variables
- Deploy
Recommended PostgreSQL hosting providers:
- Vercel Postgres - Integrated with Vercel
- Neon - Serverless Postgres
- Supabase - Open-source Firebase alternative
- Railway - Simple infrastructure
# Create a new migration
pnpm prisma migrate dev --name add_new_feature
# Reset database (β οΈ deletes all data)
pnpm prisma migrate reset
# Deploy migrations to production
pnpm prisma migrate deploy-
Prisma Studio: Visual database browser
pnpm prisma studio
-
Next.js Dev Tools: Built-in React DevTools support
The project uses ESLint for code quality:
pnpm lint # Run ESLintThe project uses Tailwind CSS v4 with custom configuration. Modify styles in:
app/globals.css- Global styles and CSS variablescomponents/ui/- Component-specific styles
Customize AI behavior by editing prompt templates in:
utils/prompt.ts- Text-to-diagram and diagram-to-code prompts
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- tldraw - For the incredible infinite canvas library
- Better Auth - For the modern authentication solution
- Vercel - For Next.js and hosting platform
- Google - For Gemini AI API
- Prisma - For the amazing ORM
Built with β€οΈ using Next.js, AI, and the power of collaboration.