A modern, user-friendly web application that converts SQL CREATE TABLE statements into Mermaid Entity-Relationship Diagrams (ERD). Built with React, TypeScript, and Tailwind CSS.
- 🔄 Real-time conversion from SQL to Mermaid ERD syntax
- 📋 Copy-to-clipboard functionality with visual feedback
- 🎨 Clean, modern UI with responsive design
- 💡 Example usage section with sample SQL
- ⚡ Fast and efficient client-side processing
- 🎯 Support for:
- CREATE TABLE statements
- Primary keys
- Foreign key relationships
- Table fields with types
- Node.js (v14 or higher)
- npm or yarn
- Clone the repository:
git clone https://github.com/yourusername/sql-to-mermaid-erd.git
cd sql-to-mermaid-erd
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Open your browser and navigate to
http://localhost:5173
- Paste your SQL CREATE TABLE statements into the left text area
- Click the "Convert to Mermaid" button
- The Mermaid ERD syntax will appear in the right text area
- Copy the generated Mermaid code using the copy button
- Use the Mermaid code in your preferred Mermaid renderer
CREATE TABLE users (
id INT PRIMARY KEY,
name VARCHAR(255),
email VARCHAR(255)
);
CREATE TABLE posts (
id INT PRIMARY KEY,
title VARCHAR(255),
user_id INT,
FOREIGN KEY (user_id) REFERENCES users(id)
);
- React 18
- TypeScript
- Vite
- Tailwind CSS
- Lucide React (for icons)
npm run build
The built files will be in the dist
directory.
npm run lint
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Mermaid - JavaScript based diagramming and charting tool
- Tailwind CSS - A utility-first CSS framework
- Lucide - Beautiful & consistent icons