A modern, interactive web application for creating beautiful diagrams using Mermaid syntax with AI-powered assistance. Built with React, TypeScript, and Tailwind CSS.
- Live Mermaid Editor: Write Mermaid syntax and see your diagrams render in real-time
- AI-Powered Diagram Generation: Describe your diagram in natural language and let AI generate the Mermaid code for you
- Dark/Light Theme Support: Toggle between themes for comfortable viewing
- Export Functionality: Save your diagrams as SVG files
- Responsive Design: Works seamlessly on desktop and mobile devices
- Split-Pane Interface: Edit code on one side, preview on the other
- Frontend Framework: React 18 with TypeScript
- Build Tool: Vite
- UI Components: shadcn/ui with Radix UI primitives
- Styling: Tailwind CSS with custom glass-morphism effects
- Diagram Rendering: Mermaid.js
- AI Integration: Google Gemini API for diagram generation
- State Management: React hooks with TanStack Query
- Routing: React Router DOM
- Form Handling: React Hook Form with Zod validation
- Icons: Lucide React
- File Export: File-saver.js
- Node.js (v18 or higher)
- npm, yarn, or bun
-
Clone the repository
git clone https://github.com/Adams-404/Sketch-Flow-AI.git cd Sketch-Flow-AI -
Install dependencies
npm install # or yarn install # or bun install
-
Set up environment variables
cp .env.example .env # Edit .env and add your Gemini API key -
Start the development server
npm run dev # or yarn dev # or bun dev
-
Open your browser Navigate to
http://localhost:5173(or the port shown in your terminal)
npm run dev- Start development server with hot reloadnpm run build- Build for productionnpm run build:dev- Build for development modenpm run preview- Preview production build locallynpm run lint- Run ESLint
- Manual Editing: Write Mermaid syntax directly in the editor
- AI Generation: Use the AI prompt to describe your diagram in natural language
- Export: Save your diagrams as SVG files using the export button
- Flowcharts
- Sequence diagrams
- Class diagrams
- State diagrams
- Entity Relationship diagrams
- User journey diagrams
- Gantt charts
- Pie charts
- And more!
graph TD
A[Start] --> B{Decision}
B -->|Yes| C[Action]
B -->|No| D[Alternative Action]
C --> E[Result]
D --> E
- Syntax highlighting for Mermaid code
- Auto-save functionality
- Real-time validation
- Customizable font size
- Natural language to Mermaid conversion
- Context-aware suggestions
- Multiple diagram type support
- Live rendering of Mermaid diagrams
- Theme-aware display
- Zoom and pan capabilities
- High-quality SVG export
Create a .env file in the root of your project with the following:
# Google Gemini API Key
# Get your API key from: https://makersuite.google.com/app/apikey
VITE_GEMINI_API_KEY=your_gemini_api_key_here- Visit Google AI Studio
- Create a new API key
- Add the API key to your
.envfile as shown above - Restart your development server for the changes to take effect
- Themes: Modify
tailwind.config.tsto customize colors and themes - Components: All UI components are located in
src/components/ - Pages: Main application pages are in
src/pages/
- Connect your repository to Vercel
- Vercel will automatically detect the framework and build settings
- Deploy with one click
- Build the project:
npm run build - Upload the
distfolder to Netlify - Configure build settings if needed
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
EXPOSE 5173
CMD ["npm", "run", "preview"]- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Mermaid.js for powerful diagram generation
- shadcn/ui for beautiful UI components
- Tailwind CSS for utility-first styling
- Vite for fast development experience
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Join our community discussions
