A web application that converts text descriptions into Mermaid diagrams using AI.
Text2Mermaid is a Vue.js application that allows users to:
- Enter a text description of a diagram
- Select an AI provider (DeepSeek, Google Gemini, or Simulation mode)
- Generate a Mermaid diagram based on the text description
- View the rendered diagram
- Multiple AI Providers: Choose between DeepSeek and Google Gemini for diagram generation
- Simulation Mode: Generate diagrams offline using predefined templates
- Real-time Rendering: Diagrams are rendered immediately after generation
- Error Handling: Clear error messages for API failures or rendering issues
- Docker
- Docker Compose
-
Clone the repository
git clone https://github.com/yourusername/text2mermaid.git cd text2mermaid -
Create an
.envfile from the examplecp .env.example .env -
Edit the
.envfile and add your Gemini API keyGEMINI_API_KEY=your_gemini_api_key_here -
Build and start the containers
docker-compose up --build -
Open your browser and navigate to
http://localhost:8080/
- Node.js (v14 or higher)
- npm or yarn
-
Clone the repository
git clone https://github.com/yourusername/text2mermaid.git cd text2mermaid -
Install dependencies for the frontend
npm install -
Install dependencies for the backend
cd backend npm install cd .. -
Set up environment variables:
- Copy
backend/.env.templatetobackend/.env - Add your DeepSeek and Gemini API keys in the
.envfile
- Copy
-
Start the backend server:
cd backend npm run dev -
In a new terminal, start the frontend:
npm run dev -
Open your browser and navigate to
http://localhost:5173/
- Select an AI provider from the dropdown menu (or use Simulation for testing)
- Enter a text description of the diagram you want to create
- Click "Generate Diagram"
- View the rendered Mermaid diagram
Example description:
create a diagram of a user using ssh keys to log into a bastion host
- If the AI providers are not responding, use the Simulation mode for testing
- Check that your API keys are correctly set in the backend
.envfile - Make sure both frontend and backend servers are running
- Frontend: Vue.js, Mermaid.js
- Backend: Node.js, Express
- API Integration: DeepSeek AI API, Google Gemini API
This project is licensed under the MIT License - see the LICENSE file for details.