erd_rs

Crates.ioerd_rs
lib.rserd_rs
version0.1.0
created_at2025-01-30 09:02:08.135522+00
updated_at2025-01-30 09:02:08.135522+00
descriptionA command line utility that take Rust code as the source of truth to produce a entity relation diagram markdown file (e.g., mermaid.js file).
homepagehttps://psr-portfolio.web.app
repositoryhttps://github.com/psengrith/erd_rs
max_upload_size
id1536199
size69,732
PROM SENGRITH (psengrith)

documentation

README

Entity Relation Diagram (ERD) from Rust Struct

erd_rs is command-line utility for creating Entity Relation (ER) Diagram (or class/struct diagram) from codes written in Rust.

Properly documenting entity (or class) is a best practice in software development process. It enchance software maintainability, and allow developers to communicate effectively with team members and other stackholders. However, most developers prefer to express thier solution and idea through codes, instead of drawing. This command line takes Rust code as the source of truth to produce a entity relation diagram markdown file. This would saving thier time and energy for more coding.

Get Started 👍

# install dependency command
cargo install cargo-expand

# display help message on how to use this command
erd_rs -h 

Example Usage:

Create mermaid markdown file (i.e., ER.mmd) from Rust source code in example-project.

erd_rs -d ./examples/example-project/

Output: See ER.mmd

Preview:

---
title: ER Diagram
---
classDiagram
 GeneModel "n..n" -- "" OrganismModel : exist_in
 class GeneModel {
  -u32 id
  +String name
  +String nucleotide_5_end
  +OrganismModel organism
 }
 GeneModel: +new(id, name, nucleotide_5_end, organism) GeneModel
 GeneModel: +set_id(id) 
 GeneModel: -summarized() String
 GeneModel: ~summarized2() String
 GeneModel: +default() GeneModel
 class OrganismModel {
  -u32 id
  +String nomenclature
 }
 OrganismModel: +default() OrganismModel
 OrganismModel: +new(id, nomenclature) OrganismModel
 OrganismModel: -log_to_console() 

Contributors ✨

This project is in great needs of contributors.


Sengrith
Commit count: 3

cargo fmt