Skip to content

Visual database schema diagram (ERD) #146

Description

@karutoil

Summary

The Prisma schema has 45 models with complex relationships. docs/architecture.md has a text-based ERD but no visual diagram. Generate and maintain a proper visual ERD that developers and contributors can reference.

Current State

  • catalyst-backend/prisma/schema.prisma defines 45 models across auth, RBAC, infrastructure, server resources, operations, alerts, audit, plugins, and migration
  • docs/architecture.md has inline text describing the schema but no visual diagram
  • No tooling exists to auto-generate diagrams from the Prisma schema
  • Contributors need to read the full schema file to understand relationships

Requirements

  • Auto-generate ERD from prisma/schema.prisma (e.g., using prisma-erd-generator, mermaid, or dbml)
  • Include all 45 models with their key fields and relationships
  • Group models by domain (auth, RBAC, infrastructure, server operations, etc.)
  • Render as a high-resolution image embeddable in docs + a Mermaid diagram for GitHub rendering
  • Add to docs/architecture.md or a dedicated docs/schema.md
  • Add CI check or docs build step to keep the diagram in sync with schema changes

Acceptance Criteria

  • Visual ERD generated from schema.prisma covering all 45 models
  • Diagram embeddable in docs (SVG or high-res PNG)
  • Mermaid version for GitHub-native rendering
  • Models grouped by domain with clear labels
  • Referenced from docs/architecture.md and docs/README.md
  • Generation script in scripts/ or as a db:* npm script

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:backendBackend / API workdocumentationImprovements or additions to documentationenhancementNew feature or requestplannedPlanned for future implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions