A modern, visual database schema designer with AI-powered assistance. Build and visualize your database schemas with an intuitive drag-and-drop interface.
🚀 Quick Start: See QUICKSTART.md for a 5-minute setup guide
✅ Setup Help: Use SETUP_CHECKLIST.md to verify your installation
- 🎨 Visual database schema designer
- 🤖 AI-powered chat assistant (Ctrl/Cmd + K)
- 📊 Table and relationship management
- 🔗 Automatic foreign key generation
- 💾 Local file export/import
- 🎯 SQL generation
- 📸 Schema screenshot export
- ⚡ Auto-layout and tidy-up tools
- 🌓 Dark glassmorphic UI
Before you begin, ensure you have the following installed on your computer:
- Node.js (v18 or higher recommended)
- Download from nodejs.org
- Check your version:
node --version
- npm (comes with Node.js)
- Check your version:
npm --version
- Check your version:
git clone https://github.com/Wolfram-St/db-builder-production-level.git
cd db-builder-production-levelnpm installThis will install all required dependencies including React, Vite, Tailwind CSS, and other libraries.
Create a .env file in the root directory:
# Create .env file
touch .envAdd the following environment variables to your .env file:
# Backend Configuration
PORT=3000
# PostgreSQL Database URL (Neon DB or any PostgreSQL provider)
SHADOW_DB_URL=postgresql://your-user:your-password@your-host:5432/your-database?sslmode=require
# Hugging Face Access Token for AI features
HF_ACCESS_TOKEN=your_hugging_face_tokenRequired Environment Variables:
- PORT: Port for the backend server (default: 3000)
- SHADOW_DB_URL: PostgreSQL database connection string
- HF_ACCESS_TOKEN: Hugging Face API token for AI features
- Get your token from Hugging Face Settings
npm run devThe application will start and be available at:
http://localhost:5173/
Open this URL in your web browser to access the DB Builder.
npm run devStarts the development server with hot-reload at http://localhost:5173/
npm run buildCreates an optimized production build in the dist/ folder
npm run previewPreview the production build locally before deploying
npm run lintCheck code quality and style with ESLint
- Add Tables: Click the "Add Table" button or press
T - Add Columns: Click "Add Column" within any table
- Create Relationships: Click the connection icon on a column, then click another column to create a foreign key relationship
- Use AI Assistant: Press
Ctrl+K(orCmd+Kon Mac) to open the AI chat assistant - Generate SQL: Click "Build SQL" to see the generated SQL schema
- Export: Download your schema as JSON or export as an image
Ctrl/Cmd + K- Toggle AI AssistantCtrl/Cmd + Z- UndoCtrl/Cmd + Y- RedoDelete/Backspace- Delete selected tablesEscape- Close panels/dialogsT- Add new table (when canvas is focused)
The built-in AI assistant can help you:
- Generate database schemas
- Explain table relationships
- Optimize your design
- Answer questions about SQL and database design
db-builder-production-level/
├── src/
│ ├── components/ # React components
│ │ ├── assistant/ # AI chat assistant components
│ │ ├── canvas/ # Canvas and drawing components
│ │ ├── nodes/ # Table node components
│ │ └── ui/ # Reusable UI components
│ ├── store/ # Zustand state management
│ ├── lib/ # Utilities and helpers
│ ├── hooks/ # Custom React hooks
│ └── App.tsx # Main application component
├── public/ # Static assets
├── index.html # HTML template
├── package.json # Dependencies and scripts
├── vite.config.ts # Vite configuration
└── tailwind.config.js # Tailwind CSS configuration
- React 19 - UI framework
- TypeScript - Type safety
- Vite - Build tool and dev server
- Tailwind CSS - Styling
- Zustand - State management
- Supabase - Authentication and database
- Prism.js - Syntax highlighting
- Lucide React - Icons
- React Router - Navigation
If you get an error about the port being in use, you can:
- Stop the other process using port 5173
- Or change the port in
vite.config.ts
If you see errors about Supabase configuration:
- Make sure your
.envfile exists in the root directory - Verify the environment variables are correctly set
- Restart the dev server after changing
.envfiles
If npm install fails:
- Make sure you have Node.js v18 or higher
- Try deleting
node_modulesandpackage-lock.json, then runnpm installagain - Clear npm cache:
npm cache clean --force
If you encounter TypeScript errors during build:
- Ensure all dependencies are installed
- Check that you're using a compatible Node.js version
- Try running
npm run lintto see specific errors
This project uses:
- ESLint for code quality
- TypeScript for type safety
- Conventional commits for version control
This project is private and proprietary.
For issues and questions, please open an issue on the GitHub repository.
Built with ❤️ using React, TypeScript, and Vite