VsCode extension to generate UML diagram from prisma schema
https://github.com/AbianS/prisma-generate-uml.git
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!
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
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
# 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
prismaSchemaFolder featureYou must have the Prisma VSCode extension installed to use this extension.
.prisma file in VSCodeMIT License - see LICENSE for more details.