This file provides guidance to Claude Code when working with the Data Model Viewer monorepo.
Data Model Viewer is a hybrid C#/.NET and Next.js application for visualizing Microsoft Dataverse metadata. The monorepo contains three main projects:
DataModelViewer/
├── Generator/ # C# .NET 8 - Extracts metadata from Dataverse
├── Website/ # Next.js 15 - Interactive web application
└── Infrastructure/ # Azure Bicep - IaC for deployment
Data Flow:
Dataverse → Generator → Website/generated/Data.ts → Website Frontend
Development Workflow:
- Generator connects to Dataverse and extracts metadata
- Generator outputs TypeScript file to
Website/generated/Data.ts - Website imports and visualizes the generated data
- Infrastructure deploys Website to Azure App Service
Cross-Project Dependencies:
- Website depends on Generator output (
generated/Data.ts) - Both projects share common type structures (entities, attributes, relationships)
- Infrastructure configurations must match Website environment requirements
- Adding support for new Dataverse metadata types
- Changing data extraction logic or queries
- Modifying TypeScript output format
- Adding new analyzers (plugins, flows, web resources)
- Building UI components or pages
- Implementing diagram features
- Adding API endpoints
- Modifying authentication or session management
- Updating styling or user interactions
- Changing Azure resources or configuration
- Updating deployment parameters
- Modifying App Service settings
- Changing managed identity permissions
- Adding new entity/attribute types (Generator DTOs + Website types)
- Changing serialization format (Generator output + Website import)
- Updating environment variables (Generator config + Infrastructure parameters)
- C# (Generator): Follow .NET conventions, use
nullablereference types - TypeScript (Website): Strict mode enabled, use type-safe patterns
- All: Descriptive variable names, avoid abbreviations unless domain-specific
Use conventional commits format:
feat(generator): add support for virtual attributes
fix(website): resolve diagram zoom reset issue
chore(infra): update bicep API version
docs: update setup instructions in README
Scope options: generator, website, infra, pipeline, root
features/description- New featuresfix/description- Bug fixespatches/description- Hot fixes for production
- Run tests in both projects before creating PR
- Ensure Generator output is up to date if metadata types changed
- Target
mainbranch (see gitStatus for current state) - Include description of changes and affected projects
- .NET 8.0 SDK
- Node.js 24 LTS
- Azure CLI (for local Generator authentication)
- Git
- Run against test Dataverse environment
- Verify generated TypeScript is valid
- Check console output for warnings
- Run
npm run lintto check for errors - Test in browser at http://localhost:3000
- Verify diagram interactions work correctly manally
- Generate data from actual environment
- Load in local Website instance
- Test end-to-end workflows (diagram creation, saving, loading)
- Generator: Create DTO in
Generator/DTO/Attributes/NewAttributeType.cs - Generator: Update mapping in
DataverseService.cs:MapAttribute() - Website: Add type to
lib/Types.tsAttributeType union - Website: Create renderer in
components/datamodelview/attributes/NewAttributeRenderer.tsx - Test: Generate data and verify display in Website
- Generator: Update
appsettings.local.jsonstructure if needed - Website: Add to
.env.localand document in Website/CLAUDE.md - Infrastructure: Add parameter to
main.bicepif required for deployment - Pipeline: Update
azure-pipelines-deploy-jobs.ymlto pass variable - Documentation: Update README.md setup instructions
- Generator:
dotnet list package --outdatedthen update.csproj - Website:
npm outdatedthen updatepackage.json - Test: Run both projects after updates to ensure compatibility
For detailed architecture, development commands, and project-specific guidance:
- Generator: See Generator/CLAUDE.md
- Website: See Website/CLAUDE.md
- Infrastructure: See Infrastructure/CLAUDE.md
- Architecture Deep Dive: See PROJECT_CONTEXT.md
# Generator (C# format check)
cd Generator && dotnet format --verify-no-changes
# Website
cd Website && npm run lint# From repository root
cd Generator
dotnet build --configuration Release
dotnet run --OutputFolder ../Website/generated
cd ../Website
npm install
npm run prepipeline # Copy stub files if needed
npm run build- Always regenerate
Website/generated/Data.tsafter Generator changes - Check that Generator has access to Dataverse (use
az loginlocally) - Never commit
.env.localorappsettings.local.jsonfiles - Website depends on generated data - Generator must run first
- Azure deployment requires Managed Identity permissions setup