An AI-powered diagram creation platform. Describe your diagram in natural language, and AI generates it for you.
Built on Cloudflare Pages with React frontend and Pages Functions backend.
Three distinctive drawing engines to meet different needs:
- Mermaid - Flowcharts, sequence diagrams, class diagrams - code-driven, precise control
- Excalidraw - Hand-drawn style diagrams, clean and beautiful, great for brainstorming
- Draw.io - Professional diagram editor, feature-rich, ideal for complex diagrams
- Easily manage all your diagram projects
- Complete version history, restore to any previous version
- All data stored locally - no privacy concerns
- Instant Response - Almost all diagrams render in seconds, no more waiting
- Beautiful Styling - Specially optimized Mermaid rendering for significantly improved aesthetics
- Smart Editing - Continue editing based on existing diagrams, AI understands context
- Spatial Awareness - Better layout capabilities, fewer arrows crossing through elements
Beyond text descriptions, also supports:
- Document Visualization - Upload documents to auto-generate visual diagrams
- Image Recreation - Upload images, AI recognizes and recreates diagrams
- Link Parsing - Enter URLs to auto-parse content and generate diagrams
- Open the homepage
- Select a drawing engine (Mermaid / Excalidraw / Draw.io)
- Enter your diagram description, e.g., "Draw a user login flowchart"
- Click Generate - AI creates the project and diagram automatically
- Go to the Projects page
- Click "New Project"
- Choose an engine and name your project
- Use the chat panel in the editor to describe your needs
In the chat panel on the right side of the editor, you can:
- Describe new diagrams: "Draw an e-commerce checkout flow"
- Modify existing diagrams: "Change the payment node to red"
- Add elements: "Add an inventory check step"
- Excalidraw - Drag and draw directly on the canvas
- Draw.io - Use professional diagram editing tools
- Mermaid - Edit the code directly
- Click the "History" button in the toolbar
- View all historical versions
- Click any version to preview
- Click "Restore" to revert to that version
git clone https://github.com/liujuntao123/smart-ai-draw
cd smart-ai-draw
pnpm installCreate a .dev.vars file in the root directory:
AI_API_KEY=your-api-key
AI_BASE_URL=https://api.openai.com/v1
AI_PROVIDER=openai
AI_MODEL_ID=gpt-4o-miniSupports OpenAI, Anthropic, and other OpenAI-compatible services
# Start frontend + backend together
pnpm run dev
# Visit http://localhost:8787
# Or run separately:
pnpm run dev:frontend # Vite only (http://localhost:5173)
pnpm run dev:backend # Wrangler Pages only (http://localhost:8787)Note: Access http://localhost:8787 during development (wrangler proxies vite).
pnpm run build # TypeScript check + Vite buildwrangler pages secret put AI_API_KEY
wrangler pages secret put AI_BASE_URL
wrangler pages secret put AI_PROVIDER
wrangler pages secret put AI_MODEL_IDOr configure environment variables in Cloudflare Pages dashboard.
pnpm run pages:deploy| Provider | AI_PROVIDER | AI_BASE_URL | Recommended Models |
|---|---|---|---|
| OpenAI | openai | https://api.openai.com/v1 | gpt-5 |
| Anthropic | anthropic | https://api.anthropic.com/v1 | claude-sonnet-4-5 |
| Other compatible | openai | Custom URL | - |
- Frontend: React 19 + Vite + TypeScript + Tailwind CSS
- State: Zustand
- Storage: Dexie.js (IndexedDB)
- Backend: Cloudflare Pages Functions
MIT