README.md
July 21, 2025 ยท View on GitHub
Prisma Generate UML is a VSCode extension that quickly creates UML diagrams from Prisma schemas with a single click, offering easy visualization.
You can download final bundles from the Releases section.
Note
๐ง Prisma Generate UML is currently under development. Stay tuned for more updates!

๐๏ธ Architecture
graph TB
subgraph "Prisma Input"
SCHEMA["๐ schema.prisma<br/>Prisma schema file<br/>Models, Enums, Relations"]
FILE_WATCHER["๐๏ธ File Watcher<br/>Detects .prisma changes"]
end
subgraph "VSCode Environment"
EDITOR["๐ VSCode Editor<br/>Editor interface"]
CMD["โก Command Palette<br/>prisma-generate-uml.generateUML"]
ICON["๐ UML Icon<br/>Toolbar button"]
end
subgraph "Extension Core"
EXT_ENTRY["๐ extension.ts<br/>Entry point<br/>Command registration"]
PARSER["โก DMMF Parser<br/>@prisma/internals<br/>getDMMF() + getSchemaWithPath()"]
RENDER["๐จ Render Engine<br/>transformDmmfToModelsAndConnections()<br/>Generates Models, Connections, Enums"]
PANEL_MGR["๐ PrismaUMLPanel<br/>Manages WebView lifecycle<br/>postMessage() communication"]
end
subgraph "WebView Container"
WEBVIEW["๐ VSCode WebView<br/>Isolated container<br/>HTML + CSS + JS"]
CSP["๐ Content Security Policy<br/>WebView security"]
end
subgraph "React Application"
APP["โ๏ธ App.tsx<br/>Root component<br/>Global state"]
THEME["๐จ Theme Provider<br/>VSCode theme handling"]
VISUALIZER["๐ SchemaVisualizer<br/>Main container"]
FLOW_PROVIDER["๐ ReactFlowProvider<br/>@xyflow/react context"]
end
subgraph "UML Components"
FLOW["๐ ReactFlow Canvas<br/>Rendering engine<br/>Drag & Drop, Zoom, Pan"]
MODEL_NODE["๐๏ธ ModelNode<br/>Model component<br/>Fields, Types, Relations"]
ENUM_NODE["๐ EnumNode<br/>Enum component<br/>Enumerated values"]
CONNECTIONS["๐ Edges/Connections<br/>Model relationships"]
end
subgraph "Output Actions"
SCREENSHOT["๐ธ Screenshot<br/>Export PNG/SVG"]
DOWNLOAD["๐พ Download<br/>Save image"]
end
SCHEMA --> FILE_WATCHER
FILE_WATCHER --> EXT_ENTRY
EDITOR --> CMD
EDITOR --> ICON
CMD --> EXT_ENTRY
ICON --> EXT_ENTRY
EXT_ENTRY --> PARSER
PARSER --> RENDER
RENDER --> PANEL_MGR
PANEL_MGR --> WEBVIEW
WEBVIEW --> CSP
CSP --> APP
APP --> THEME
APP --> VISUALIZER
VISUALIZER --> FLOW_PROVIDER
FLOW_PROVIDER --> FLOW
FLOW --> MODEL_NODE
FLOW --> ENUM_NODE
FLOW --> CONNECTIONS
MODEL_NODE --> SCREENSHOT
ENUM_NODE --> SCREENSHOT
SCREENSHOT --> DOWNLOAD
DOWNLOAD -.-> PANEL_MGR
PANEL_MGR -.-> EXT_ENTRY
๐ฆ Project Structure
prisma-generate-uml/
โโโ packages/
โ โโโ prisma-generate-uml/ # VSCode Extension
โ โ โโโ src/
โ โ โ โโโ extension.ts # Entry point
โ โ โ โโโ panels/ # WebView management
โ โ โ โโโ core/ # Rendering logic
โ โ โโโ package.json
โ โ
โ โโโ webview-ui/ # React Frontend
โ โ โโโ src/
โ โ โ โโโ App.tsx # Main component
โ โ โ โโโ components/ # UML Components
โ โ โ โโโ lib/ # Utils and types
โ โ โโโ package.json
โ โ
โ โโโ schema.prisma # Example schema
โ
โโโ turbo.json # Turbo configuration
โโโ package.json # Root workspace
๐ Development
Prerequisites
- Node.js 18+
- npm
Installation
# Clone the repository
git clone https://github.com/AbianS/prisma-generate-uml.git
cd prisma-generate-uml
# Install dependencies
npm install
# Development
npm run dev
โจ Features
- ๐ฅ Instant UML Diagrams: Generate UML diagrams from Prisma schemas with a single click
- ๐ผ Easy Visualization: Simplify data architecture visualization in an exciting way
- ๐ Seamless Integration: Works seamlessly within VSCode, no extra configuration required
- ๐ Multi-file Prisma Schema Support: Full support for Prisma's
prismaSchemaFolderfeature - ๐ Automatic Updates: Keep your UML diagrams up-to-date with schema changes
๐โโ๏ธ Quick Usage
You must have the Prisma VSCode extension installed to use this extension.
- Open a
.prismafile in VSCode - Look for the UML icon in the editor toolbar
- Click it to generate the diagram instantly
๐ ๏ธ Technologies
- Extension: TypeScript + VSCode Extension API
- WebView: React + Vite + Tailwind CSS
- UML Rendering: React Flow + Custom Components
- Prisma Integration: @prisma/internals DMMF
- Monorepo: Turbo + npm workspaces
- Code Quality: Biome (ESLint + Prettier alternative)
๐ License
MIT License - see LICENSE for more details.