Initial commit

This commit is contained in:
Wouter Samaey 2021-06-30 09:13:28 +02:00
commit 7db2b222eb
13 changed files with 61 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
.idea/
output/
!output/.gitkeep

41
README.md Normal file
View File

@ -0,0 +1,41 @@
# DB Documentation Generator for BTCPay Server
This tool allows you to generate interactive documentation for BTCPay Server's database by using [SchemaSpy](https://github.com/schemaspy/schemaspy).
## Requirements
- A running database to analyse (settings are in `schemaspy.properties`)
- Docker
## How to generate?
1. Start a local development setup of BTCPay Server (typically `docker-compose up dev`)
2. Run the shell script `generate.sh`
3. The output will be generated in `/output`
## How to view?
- Navigate to `/output/index.html` with your browser.
## Notes
- This script generates output with SVG images. If you prefer PNG, you can change `schemaspy.properties` to do so.
- A full DB drawing is available at `/output/diagrams/summary/relationships.real.large.svg`
## Screenshots
Some screenshots of the output you'll get.
### Tables
![Tables](images/screenshot1.png)
### Columns
![Columns screenshot](images/screenshot2.png)
### Constraints
![Constraints screenshot](images/screenshot3.png)
### Relationships
![Relationships screenshot](images/screenshot4.png)
### Utility
![Utility screenshot](images/screenshot5.png)
### Anomalies
![Anomalies screenshot](images/screenshot6.png)
### Routines
![Routines screenshot](images/screenshot7.png)

Binary file not shown.

8
generate.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR"
mkdir -p output
docker run -v "$PWD/output:/output" -v "$PWD/schemaspy.properties:/schemaspy.properties" -v "$PWD/drivers:/drivers" --network="host" schemaspy/schemaspy:snapshot

BIN
images/screenshot1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

BIN
images/screenshot2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

BIN
images/screenshot3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 KiB

BIN
images/screenshot4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 KiB

BIN
images/screenshot5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

BIN
images/screenshot6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

BIN
images/screenshot7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

0
output/.gitkeep Normal file
View File

9
schemaspy.properties Normal file
View File

@ -0,0 +1,9 @@
schemaspy.t=pgsql
schemaspy.host=127.0.0.1
schemaspy.port=39372
schemaspy.db=btcpayserver
schemaspy.u=postgres
schemaspy.p=postgres
schemaspy.s=public
schemaspy.imageformat=svg
schemaspy.hq=true