Skip to content

Commit

Permalink
Merge pull request #98 from bancorprotocol/issue-90-db-docs
Browse files Browse the repository at this point in the history
added erd generation
  • Loading branch information
yarivbancor authored Nov 20, 2024
2 parents 20c2a9c + 50b5045 commit 0898ee9
Show file tree
Hide file tree
Showing 5 changed files with 2,401 additions and 77 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,8 @@ dist
src/.DS_Store

# typechain
/src/abis/types
/src/abis/types

# ERD
erd.mmd
erd.svg
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,31 @@ To switch Carbon Backend's network for different deployments, follow these steps
}
```

## Entity Relationship Diagram (ERD)

Carbon Backend provides a command to automatically generate an Entity Relationship Diagram (ERD) from your TypeORM entities. This helps visualize the database structure and relationships between entities.

To generate the ERD:

```bash
npm run generate-erd
```

This command:

1. Scans all TypeORM entity files
2. Generates a Mermaid diagram definition
3. Creates two files:
- `erd.mmd`: The Mermaid diagram definition file
- `erd.svg`: The rendered diagram in SVG format

The diagram includes:

- All entities with their properties
- Property types
- Primary key indicators
- Relationships between entities (one-to-one, one-to-many, many-to-many)

## License

Carbon Backend is licensed under the [MIT License](LICENSE).
Loading

0 comments on commit 0898ee9

Please sign in to comment.