An AI-powered diagram generation tool that uses Gemini and Mermaid.js to create beautiful, accurate diagrams from natural language descriptions.
- AI-Powered Diagram Generation: Leverages Gemini AI to understand natural language descriptions and convert them into diagrams
- Multiple Diagram Types: Supports 20+ different diagram types including:
- Flowcharts
- Sequence Diagrams
- Class Diagrams
- Entity Relationship Diagrams
- State Diagrams
- Gantt Charts
- Git Graphs
- And more!
- Smart Type Detection: Automatically determines the most suitable diagram type for your description
- Validation & Error Handling: Ensures generated diagrams are syntactically correct and renders properly
- Modern UI/UX: Beautiful and responsive interface built with Next.js and Tailwind CSS
- Real-time Preview: Instant visualization of generated diagrams
- Export Options: Save diagrams in various formats
- Frontend: Next.js, React, TypeScript, Tailwind CSS
- AI Integration: Google Gemini AI
- Diagram Rendering: Mermaid.js
- Database: Prisma with PostgreSQL
- Authentication: NextAuth.js
- Styling: Radix UI, Tailwind CSS
- Development: ESLint, Prettier, TypeScript
- Node.js (v18 or higher)
- PostgreSQL
- Google Cloud API Key (for Gemini AI)
- Clone the repository:
git clone https://github.com/icantcodefyi/diagram.git
cd diagram
- Install dependencies:
bun install
- Set up environment variables:
cp .env.example .env
Edit .env
with your configuration:
- Database URL
- Google Cloud API Key
- Other necessary credentials
- Set up the database:
bun db:generate
bun db:push
- Start the development server:
bun dev
The application will be available at http://localhost:3000
- Visit the application in your browser
- Enter a natural language description of the diagram you want to create
- The AI will automatically determine the best diagram type and generate the appropriate Mermaid.js code
- Preview the diagram in real-time
- Export or share your diagram as needed
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.