ProjGraph Showcase Samples
This directory contains a collection of sample projects designed to demonstrate the full capabilities of ProjGraph. These samples serve as both high-performance benchmarks for the tool and a documentation reference for users.
πΊοΈ Map of Capabilities
π’ Class Diagrams
Visualize complex C# hierarchies, design patterns, and entity relationships.
- Simple Hierarchy: A clean, entry-level demonstration of inheritance.
- Design Patterns: Advanced usage of Creational, Structural, and Behavioral patterns.
- Complex Hierarchy: Deeply nested types and multi-level generic constraints.
ποΈ Entity Relationship Diagrams (ERD)
Generate database schemas directly from EF Core code.
- Simple Context: Basic DbContext mapping.
- Complex E-commerce: Large-scale model with 12+ entities, TPH, and recursive FKs.
π Project Dependency Graphs
Visualize your solution architecture.
- Simple Dependencies: Basic cross-project references.
- Modular Architecture: Modern workspace using
.slnxand multi-layered projects.
π Solution Metrics
Analyse solution health and architecture at a glance.
- Solution Metrics: Project counts, type breakdown, dependency depth, and hotspot projects.
π Quick Start
Prerequisites: Ensure you have .NET 10 SDK installed.
Build Tool: Build the ProjGraph CLI from the repository root:
dotnet build src/ProjGraph.Cli/ProjGraph.Cli.csprojRun a Sample: Follow the instructions in any sample subdirectory's
README.md.
βοΈ Build and Maintenance
To ensure all samples remain buildable and their snapshots up-to-date, use the following tools:
Consolidated Build
Validate the integrity of all samples at once:
dotnet build ./samples/Samples.slnx
Automatic Snapshot Regeneration
Regenerate all snapshots/*.mmd files from the latest source code to ensure documentation stays in sync:
Windows (PowerShell):
./samples/regenerate-samples.ps1
Linux / macOS (Bash):
chmod +x ./samples/regenerate-samples.sh
./samples/regenerate-samples.sh
π‘ Edge Cases & Troubleshooting
- Missing Solution Files: ProjGraph CLI automatically discovers project roots, but providing the
.slnxpath directly is always faster and more reliable. - Ambiguous Contexts: If a file contains multiple
DbContextclasses, use the--contextflag to specify which one to render. - Deep Hierarchies: For multi-level inheritance, use
--depth(e.g.,--depth 5) to capture the full branch. - Output Redirection: The CLI tool outputs text to
stdout. Use shell redirection (>) to save diagrams to files. - Stats on an empty solution:
projgraph statswill report zero projects β ensure all.csprojfiles referenced by the solution exist on disk.