An AI-powered database design and visualization tool built with Next.js and Tambo AI. Create, visualize, and optimize database schemas through natural language conversations.
- Natural Language Schema Design - Describe your database requirements in plain English and get a complete schema
- Interactive ERD Visualization - Visual entity relationship diagrams with drag-and-drop support using ReactFlow
- Multi-Format Code Generation - Export schemas as SQL, Prisma, or Drizzle ORM code
- Schema Sharing - Generate shareable URLs to share your database designs with others
- AI-Powered Analysis - Get optimization suggestions, validation, and migration planning
- MCP Support - Model Context Protocol integration for extended AI capabilities
- Resizable Chat Interface - Adjustable sidebar width for comfortable workflow
-
Clone this repository
-
Install dependencies:
npm install
-
Set up environment variables:
cp .env.example .env
Then add your API keys:
NEXT_PUBLIC_TAMBO_API_KEY- Get from tambo.co/dashboardGEMINI_API_KEY- Get from Google AI StudioTURSO_DATABASE_URLandTURSO_AUTH_TOKEN- Get from Turso (for schema sharing)
-
Start the development server:
npm run dev
-
Open localhost:3200 and start designing!
- Next.js 16 with App Router
- React 19 with TypeScript
- Tambo AI SDK for AI-powered interactions
- ReactFlow for interactive ERD diagrams
- Gemini AI for schema generation
- Turso (LibSQL) for schema persistence
- Tailwind CSS v4 for styling
- Framer Motion for animations
The application provides several AI-powered tools for database design:
| Tool | Description |
|---|---|
getDatabaseSchema |
Generate a complete schema from a natural language description |
analyzeSchema |
Analyze existing schemas for issues and optimization opportunities |
generateMigration |
Create migration scripts based on schema change requirements |
validateSchema |
Check schemas for consistency and referential integrity |
optimizeSchema |
Improve schemas for performance and maintainability |
Export your schema in multiple formats:
- SQL - Standard DDL statements with CREATE TABLE, constraints, and foreign keys
- Prisma - Complete Prisma schema file with models and relations
- Drizzle - TypeScript Drizzle ORM schema with proper types and references
Try these prompts to get started:
- "Create a blog database with users, posts, and comments"
- "Design an e-commerce schema with products, orders, and customers"
- "Add a ratings table that references users and products"
- "Optimize my schema for better query performance"
- "Add soft delete support to all tables"
src/
├── app/
│ ├── chat/ # Main chat interface
│ ├── schema/[code]/ # Shared schema viewer
│ └── api/ # API routes for schema generation
├── components/
│ ├── tambo/ # Chat and message components
│ ├── schema-viewer # Schema visualization and code tabs
│ └── ui/ # Reusable UI components
├── lib/
│ ├── tambo.ts # Component and tool registration
│ ├── generators/ # SQL, Prisma, Drizzle code generators
│ ├── schema-tools.ts # AI tool implementations
│ └── types.ts # TypeScript type definitions
└── services/ # Business logic services
npm run dev # Start development server on port 3200
npm run build # Build for production
npm run lint # Run ESLint
npm run lint:fix # Fix linting issuesCreated by Akinkunmi (@akinkunmi · GitHub)
MIT
For more information about Tambo AI, visit docs.tambo.co.