How bocovo/db-schema-visualizer works
Main Components Structure
a. Extension Layer:
• Two separate VS Code extensions (DBML and Prisma)
• Shared extension infrastructure
• Webview panel implementation
b. Parser Layer:
• DBML-to-JSON Schema converter
• Prisma-to-JSON Schema converter
• Shared schema types and utilities
c. Visualization Layer:
• JSON Table Schema Visualizer
• Component rendering system
• Theme management
• Layout engine
Component Relationships
a. Input Flow:
• DBML/Prisma file → Parser Layer → JSON Table Schema
• JSON Table Schema → Visualization Layer → ERD Display
b. Extension Communication:
• VS Code Extension → Webview Bridge → Visualization Components
Specific Implementation Details
• Blue rectangles: Core packages (dbml-to-json-table-schema, prisma-to-json-table-schema)
• Green rectangles: VS Code extensions
• Purple rectangles: Visualization components
• Yellow rectangles: Shared utilities and types
Key Technical Elements
a. Extension Components:
• Extension activation handlers
• Webview panel management
• Configuration handling
b. Parser Components:
• Schema transformation pipeline
• Validation system
• Type definitions
c. Visualizer Components:
• Table rendering system
• Layout management
• Theme switching
• Auto-arrangement functionality
Integration Points
Highlight:
• VS Code Extension API integration
• Inter-package communication
• Shared type systems
• Theme system integration
Technical Stack Indicators
Technology badges for:
• TypeScript
• React
• VS Code Extension API
• Konva (for visualization)
• Lerna (for monorepo management)
• Extension logic
• Schema parsing
• Visualization rendering
• Shared utilities
Remember to emphasize the monorepo structure and how the packages interact with each other, as this is crucial for understanding the system's architecture.