Skip to content

A 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).

License

Notifications You must be signed in to change notification settings

psengrith/erd_rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Entity Relation Diagram (ERD) from Rust Struct

erd_rs

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 enhance software maintainability, and allow developers to communicate effectively with team members and other stakeholders. However, most developers prefer to express their 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 their 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() 
Loading

Contributors ✨


Sengrith

About

A 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).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages