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.

πŸ—„οΈ Entity Relationship Diagrams (ERD)

Generate database schemas directly from EF Core code.

🌐 Project Dependency Graphs

Visualize your solution architecture.

πŸ“ˆ Solution Metrics

Analyse solution health and architecture at a glance.

  • Solution Metrics: Project counts, type breakdown, dependency depth, and hotspot projects.

πŸš€ Quick Start

  1. Prerequisites: Ensure you have .NET 10 SDK installed.

  2. Build Tool: Build the ProjGraph CLI from the repository root:

    dotnet build src/ProjGraph.Cli/ProjGraph.Cli.csproj
    
  3. Run 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 .slnx path directly is always faster and more reliable.
  • Ambiguous Contexts: If a file contains multiple DbContext classes, use the --context flag 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 stats will report zero projects β€” ensure all .csproj files referenced by the solution exist on disk.