├── app ├── favicon.ico ├── layout.tsx ├── api │ ├── models │ │ └── route.ts │ ├── plantuml │ │ ├── render │ │ │ └── route.ts │ │ └── route.ts │ ├── mermaid │ │ └── route.ts │ ├── graphviz │ │ └── route.ts │ ├── excalidraw │ │ └── route.ts │ └── kroki │ │ ├── route.ts │ │ └── render │ │ └── route.ts ├── kroki │ └── page.tsx ├── mermaid │ └── page.tsx ├── graphviz │ └── page.tsx ├── plantuml │ └── page.tsx ├── excalidraw │ └── page.tsx └── globals.css ├── public ├── example.png ├── architecture.png ├── 01669c29-60a7-4777-af14-0982d6c6daa8.png ├── 409fd263-800f-4183-8df9-71691307633c.png ├── 6dd5b5c1-1e25-4d33-a45f-d10eb0fbb804.png ├── 7736141c-e820-450d-8260-5f5b0c846388.png ├── de5e647f-a83a-4b28-bd56-b449f587e472.png └── e59f7980-ac2f-4c57-b9a7-8b7c75feed58.png ├── postcss.config.mjs ├── next.config.ts ├── docker-compose.yaml ├── components.json ├── env.example ├── .dockerignore ├── tsconfig.json ├── .gitignore ├── components ├── ui │ ├── textarea.tsx │ ├── input.tsx │ ├── scroll-area.tsx │ ├── tooltip.tsx │ ├── button.tsx │ ├── card.tsx │ ├── dialog.tsx │ └── select.tsx ├── button-with-tooltip.tsx ├── plantuml-workspace.tsx ├── reset-warning-modal.tsx ├── graphviz-workspace.tsx ├── mermaid-workspace.tsx ├── kroki-workspace.tsx ├── mode-selector.tsx ├── excalidraw-workspace.tsx ├── excalidraw-history-dialog.tsx ├── resizable-panel.tsx ├── mode-nav.tsx ├── history-dialog.tsx ├── chat-example-panel.tsx ├── collapsible-chat-panel.tsx ├── file-preview-list.tsx ├── kroki-chat-panel.tsx ├── graphviz-chat-panel.tsx ├── mermaid-chat-panel.tsx ├── plantuml-chat-panel.tsx ├── excalidraw-chat-panel.tsx ├── graphviz-definition-card.tsx ├── mermaid-definition-card.tsx ├── kroki-definition-card.tsx └── plantuml-definition-card.tsx ├── Dockerfile ├── lib ├── model-provider.ts └── ai-providers.ts ├── package.json ├── contexts ├── graphviz-context.tsx ├── plantuml-context.tsx ├── diagram-context.tsx ├── mermaid-context.tsx └── model-config-context.tsx ├── README.md └── README_en.md /app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenpeiheng/ai-smart-draw/HEAD/app/favicon.ico -------------------------------------------------------------------------------- /public/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenpeiheng/ai-smart-draw/HEAD/public/example.png -------------------------------------------------------------------------------- /public/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenpeiheng/ai-smart-draw/HEAD/public/architecture.png -------------------------------------------------------------------------------- /postcss.config.mjs: -------------------------------------------------------------------------------- 1 | const config = { 2 | plugins: ["@tailwindcss/postcss"], 3 | }; 4 | 5 | export default config; 6 | -------------------------------------------------------------------------------- /public/01669c29-60a7-4777-af14-0982d6c6daa8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenpeiheng/ai-smart-draw/HEAD/public/01669c29-60a7-4777-af14-0982d6c6daa8.png -------------------------------------------------------------------------------- /public/409fd263-800f-4183-8df9-71691307633c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenpeiheng/ai-smart-draw/HEAD/public/409fd263-800f-4183-8df9-71691307633c.png -------------------------------------------------------------------------------- /public/6dd5b5c1-1e25-4d33-a45f-d10eb0fbb804.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenpeiheng/ai-smart-draw/HEAD/public/6dd5b5c1-1e25-4d33-a45f-d10eb0fbb804.png -------------------------------------------------------------------------------- /public/7736141c-e820-450d-8260-5f5b0c846388.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenpeiheng/ai-smart-draw/HEAD/public/7736141c-e820-450d-8260-5f5b0c846388.png -------------------------------------------------------------------------------- /public/de5e647f-a83a-4b28-bd56-b449f587e472.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenpeiheng/ai-smart-draw/HEAD/public/de5e647f-a83a-4b28-bd56-b449f587e472.png -------------------------------------------------------------------------------- /public/e59f7980-ac2f-4c57-b9a7-8b7c75feed58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenpeiheng/ai-smart-draw/HEAD/public/e59f7980-ac2f-4c57-b9a7-8b7c75feed58.png -------------------------------------------------------------------------------- /next.config.ts: -------------------------------------------------------------------------------- 1 | import type { NextConfig } from "next"; 2 | 3 | const nextConfig: NextConfig = { 4 | /* config options here */ 5 | }; 6 | 7 | export default nextConfig; 8 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | 3 | services: 4 | ai-smart-draw: 5 | image: ai-smart-draw 6 | container_name: ai-smart-draw 7 | ports: 8 | - "6001:6001" 9 | env_file: 10 | - .env.local 11 | restart: unless-stopped 12 | -------------------------------------------------------------------------------- /components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "new-york", 4 | "rsc": true, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "", 8 | "css": "app/globals.css", 9 | "baseColor": "neutral", 10 | "cssVariables": true, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "components": "@/components", 15 | "utils": "@/lib/utils", 16 | "ui": "@/components/ui", 17 | "lib": "@/lib", 18 | "hooks": "@/hooks" 19 | }, 20 | "iconLibrary": "lucide" 21 | } -------------------------------------------------------------------------------- /env.example: -------------------------------------------------------------------------------- 1 | # OpenAI credentials used on the server (front-end UI can override per browser) 2 | OPENAI_API_KEY="your-openai-api-key-here" 3 | # Optional overrides: 4 | # OPENAI_MODEL="gpt-4o-mini" 5 | # OPENAI_BASE_URL="https://api.openai.com/v1" 6 | # OPENAI_MAX_OUTPUT_TOKENS="16000" # raise if your provider allows larger responses 7 | 8 | # Optional: override the PlantUML renderer used for previews 9 | # PLANTUML_RENDER_BASE="https://your-internal-host/plantuml/svg" 10 | 11 | # Optional: override the Kroki renderer used for previews (defaults to https://kroki.io) 12 | # KROKI_RENDER_BASE="https://your-internal-host-or-alternative-kroki-instance -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | # General 2 | .git 3 | .gitignore 4 | .gitattributes 5 | 6 | # Dependencies 7 | node_modules 8 | 9 | # Build artifacts 10 | .next 11 | .nuxt 12 | .cache 13 | .vscode 14 | .idea 15 | 16 | # Environment files 17 | .env 18 | .env.local 19 | .env.development 20 | .env.test 21 | .env.production 22 | 23 | # Logs 24 | npm-debug.log* 25 | yarn-debug.log* 26 | yarn-error.log* 27 | 28 | # System Files 29 | .DS_Store 30 | Thumbs.db 31 | 32 | # Test files 33 | coverage 34 | *.log 35 | 36 | # Build files 37 | Dockerfile 38 | dist 39 | build 40 | out 41 | 42 | # Documentation 43 | README.md 44 | LICENSE 45 | *.pdf 46 | 47 | # Misc 48 | *.swp 49 | *.swo 50 | *~ 51 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2017", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "noEmit": true, 9 | "esModuleInterop": true, 10 | "module": "esnext", 11 | "moduleResolution": "bundler", 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "jsx": "preserve", 15 | "incremental": true, 16 | "plugins": [ 17 | { 18 | "name": "next" 19 | } 20 | ], 21 | "paths": { 22 | "@/*": ["./*"] 23 | } 24 | }, 25 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], 26 | "exclude": ["node_modules"] 27 | } 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.* 7 | .yarn/* 8 | !.yarn/patches 9 | !.yarn/plugins 10 | !.yarn/releases 11 | !.yarn/versions 12 | 13 | # testing 14 | /coverage 15 | 16 | # next.js 17 | /.next/ 18 | /out/ 19 | 20 | # production 21 | /build 22 | 23 | # misc 24 | .DS_Store 25 | *.pem 26 | 27 | # debug 28 | npm-debug.log* 29 | yarn-debug.log* 30 | yarn-error.log* 31 | .pnpm-debug.log* 32 | 33 | # env files (can opt-in for committing if needed) 34 | .env* 35 | 36 | # vercel 37 | .vercel 38 | 39 | # typescript 40 | *.tsbuildinfo 41 | next-env.d.ts 42 | push-via-ec2.sh 43 | .claude/settings.local.json 44 | /.idea/ 45 | /.fastRequest/ 46 | -------------------------------------------------------------------------------- /components/ui/textarea.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | 3 | import { cn } from "@/lib/utils" 4 | 5 | function Textarea({ className, ...props }: React.ComponentProps<"textarea">) { 6 | return ( 7 |