From fe931f5868c080ad75705e6bc20a56d54805f0aa Mon Sep 17 00:00:00 2001 From: masalovd Date: Mon, 2 Oct 2023 21:33:16 +0300 Subject: [PATCH] Add ERD --- README.md | 1 + package-lock.json | 70 ++++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + prisma/README.md | 60 +++++++++++++++++++++++++++++++++++++ prisma/schema.prisma | 6 ++++ 5 files changed, 138 insertions(+) create mode 100644 README.md create mode 100644 prisma/README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..a1218b2 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +[ERD](./prisma/README.md) diff --git a/package-lock.json b/package-lock.json index 5baf36c..15026a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,6 +28,7 @@ "nodemon": "^3.0.1", "prettier": "3.0.3", "prisma": "^5.3.1", + "prisma-markdown": "^1.0.0", "typescript": "^5.2.2" } }, @@ -299,6 +300,17 @@ } } }, + "node_modules/@prisma/debug": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.3.1.tgz", + "integrity": "sha512-eYrxqslEKf+wpMFIIHgbcNYuZBXUdiJLA85Or3TwOhgPIN1ZoXT9CwJph3ynW8H1Xg0LkdYLwVmuULCwiMoU5A==", + "dev": true, + "dependencies": { + "@types/debug": "4.1.8", + "debug": "4.3.4", + "strip-ansi": "6.0.1" + } + }, "node_modules/@prisma/engines": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.3.1.tgz", @@ -311,6 +323,42 @@ "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.3.1-2.61e140623197a131c2a6189271ffee05a7aa9a59.tgz", "integrity": "sha512-y5qbUi3ql2Xg7XraqcXEdMHh0MocBfnBzDn5GbV1xk23S3Mq8MGs+VjacTNiBh3dtEdUERCrUUG7Z3QaJ+h79w==" }, + "node_modules/@prisma/generator-helper": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@prisma/generator-helper/-/generator-helper-5.3.1.tgz", + "integrity": "sha512-zrYS0iHLgPlOJjYnd5KvVMMvSS+ktOL39EwooS5EnyvfzwfzxlKCeOUgxTfiKYs0WUWqzEvyNAYtramYgSknsQ==", + "dev": true, + "dependencies": { + "@prisma/debug": "5.3.1", + "@types/cross-spawn": "6.0.2", + "cross-spawn": "7.0.3", + "kleur": "4.1.5" + } + }, + "node_modules/@types/cross-spawn": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@types/cross-spawn/-/cross-spawn-6.0.2.tgz", + "integrity": "sha512-KuwNhp3eza+Rhu8IFI5HUXRP0LIhqH5cAjubUvGXXthh4YYBuP2ntwEX+Cz8GJoZUHlKo247wPWOfA9LYEq4cw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/debug": { + "version": "4.1.8", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.8.tgz", + "integrity": "sha512-/vPO1EPOs306Cvhwv7KfVfYvOJqA/S/AXjaHQiJboCZzcNDb+TIJFN9/2C9DZ//ijSKWioNyUxD792QmDJ+HKQ==", + "dev": true, + "dependencies": { + "@types/ms": "*" + } + }, + "node_modules/@types/ms": { + "version": "0.7.32", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.32.tgz", + "integrity": "sha512-xPSg0jm4mqgEkNhowKgZFBNtwoEwF6gJ4Dhww+GFpm3IgtNseHQZ5IqdNwnquZEoANxyDAKDRAdVo4Z72VvD/g==", + "dev": true + }, "node_modules/@types/node": { "version": "20.6.3", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.3.tgz", @@ -1818,6 +1866,15 @@ "json-buffer": "3.0.1" } }, + "node_modules/kleur": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/kuler": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", @@ -2562,6 +2619,19 @@ "node": ">=16.13" } }, + "node_modules/prisma-markdown": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prisma-markdown/-/prisma-markdown-1.0.0.tgz", + "integrity": "sha512-xqksKLUC88RXHRRUfzC7/+ZdaWMR2jIss993gwaB6cI5q//knd3rPd8x3Rbyv1Qm4GSNDBvsLtquzjv22JKHSw==", + "dev": true, + "dependencies": { + "@prisma/client": "^5.2.0", + "@prisma/generator-helper": "^5.2.0" + }, + "bin": { + "prisma-markdown": "lib/executable/markdown.js" + } + }, "node_modules/process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", diff --git a/package.json b/package.json index 556f6ac..2e7871f 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "nodemon": "^3.0.1", "prettier": "3.0.3", "prisma": "^5.3.1", + "prisma-markdown": "^1.0.0", "typescript": "^5.2.2" } } diff --git a/prisma/README.md b/prisma/README.md new file mode 100644 index 0000000..67d491a --- /dev/null +++ b/prisma/README.md @@ -0,0 +1,60 @@ +# Messenger + +> Generated by [`prisma-markdown`](https://github.com/samchon/prisma-markdown) + +- [default](#default) + +## default + +```mermaid +erDiagram +User { + Int id PK + String username UK + String email UK + String password + DateTime createdAt +} +Message { + Int id PK + String content + Int senderId FK + Int chatId FK + DateTime createdAt +} +Chat { + Int id PK + String name "nullable" + DateTime createdAt +} +Message }|--|| User : sender +Message }|--|| Chat : chat +``` + +### `User` + +**Properties** + +- `id`: +- `username`: +- `email`: +- `password`: +- `createdAt`: + +### `Message` + +**Properties** + +- `id`: +- `content`: +- `senderId`: +- `chatId`: +- `createdAt`: + +### `Chat` + +**Properties** + +- `id`: +- `name`: +- `createdAt`: diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 3260aeb..87ca13b 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -34,3 +34,9 @@ model Chat { messages Message[] createdAt DateTime @default(now()) } + +generator markdown { + provider = "prisma-markdown" + output = "./README.md" + title = "Messenger" +} \ No newline at end of file