Introducing SchemaMagic 
We’re excited to announce SchemaMagic, a new tool that transforms Entity Framework Core DbContexts into beautiful, interactive HTML schema diagrams with a single command.
Try It Now
Launch SchemaMagic Web App - No installation required!
The web application lets you analyze any GitHub repository (public or private with PAT) and generate interactive schema diagrams directly in your browser.
What is SchemaMagic?
SchemaMagic is an interactive database schema visualizer specifically designed for Entity Framework Core. It analyzes your DbContext files and generates self-contained HTML files with drag-and-drop entity relationship diagrams that help developers understand and explore database schemas.
Key Features
Fully Interactive
- Drag tables to rearrange your schema layout
- Click tables to select and highlight their relationships
- Navigate between entities by clicking foreign keys
- Zoom and pan to explore large schemas
- Your layout customizations are saved automatically
Smart Relationship Detection
- Automatically discovers foreign keys from EF migrations
- Visualizes navigation properties with proper cardinality
- Shows inheritance hierarchies
- Professional crow’s foot notation for relationships
Documentation Tooltips
- Hover over properties to see comments from [Comment] attributes
- XML documentation comments are also displayed
- Perfect for sharing domain knowledge with your team
Fast and Easy
- Parses C# code directly using Roslyn (no compilation needed)
- Works with Entity Framework Core projects of any size
- Tested with production schemas containing 100+ entities
- Generated HTML files are completely self-contained and work offline
Quick Start
Option 1: Web Application (Recommended)
Visit SchemaMagic Web to:
- Enter a GitHub repository URL
- Select a DbContext file
- Generate and download your interactive schema instantly
Option 2: Command-Line Tool
Install as a global .NET tool:
dotnet tool install -g SchemaMagic
Generate an interactive schema:
# Basic usage
schemamagic path/to/MyDbContext.cs
# Custom output location
schemamagic MyDbContext.cs --output MySchema.html
# With custom styling
schemamagic MyDbContext.cs --css-file custom-styles.css
Real-World Testing
SchemaMagic has been successfully tested with production database schemas:
Small schemas (4-10 entities): Perfect for microservices
Medium complexity (27 entities): Multi-tenant applications
Large-scale schemas (100+ entities): Enterprise applications
Complex relationships: Many-to-many, inheritance hierarchies
EF Migration integration: Accurate foreign key detection
Interactive Features
Once you open the generated HTML file:
- Drag & Drop: Reposition tables to create your ideal layout
- Click to Select: Click a table to highlight only its relationships
- Navigate: Click foreign keys or navigation properties to jump to related entities
- Pan & Zoom: Mouse wheel zoom and background dragging
- Toggle Options: Show/hide inheritance, navigation properties, and more
- Persistent State: Your layout changes are saved in browser localStorage
- Keyboard Shortcuts: Press Escape to deselect
Property Visualization
Properties are clearly marked with icons and colors:
PK: Primary Key (yellow)
FK: Foreign Key (purple)
N: Navigation Property (green)
INH: Inherited Property (blue)
- Type-specific colors for strings, numbers, dates, etc.
Use Cases
Documentation
- Include schemas in project documentation
- Help new developers understand data models
- Visualize planned schema changes
Code Reviews
- Explain database changes visually
- Review entity relationships
- Validate schema complexity
Architecture Planning
- Design new features with schema implications
- Identify refactoring opportunities
- Analyze technical debt in data models
GitHub Integration
The web application supports both public and private repositories:
- Public Repos: Just paste the GitHub URL
- Private Repos: Use a Personal Access Token with repository read permissions
- Auto-Discovery: Automatically finds all DbContext files in the repository
- Real-time Processing: Generate schemas without downloading the entire repository
Open Source
SchemaMagic is open source and available on GitHub:
github.com/panoramicdata/SchemaMagic
We welcome contributions! Whether it’s bug reports, feature requests, or pull requests, we’d love to hear from you.
Get Started Today
Try SchemaMagic now:
Web App: panoramicdata.github.io/SchemaMagic
NuGet Package: nuget.org/packages/SchemaMagic
Documentation: GitHub Repository
Have questions or feedback? Reply to this topic or open an issue on GitHub!
Built with by Panoramic Data Limited