From 0580d3a339f462cc91112dbd3014b65d44382264 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 28 Jan 2026 12:52:53 +0100 Subject: [PATCH] add mermaid code in setup --- docs/DIRECTUS-SETUP.md | 83 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/docs/DIRECTUS-SETUP.md b/docs/DIRECTUS-SETUP.md index b09cb9c..5bb326d 100644 --- a/docs/DIRECTUS-SETUP.md +++ b/docs/DIRECTUS-SETUP.md @@ -17,6 +17,89 @@ Komplette Anleitung zur Einrichtung von Directus als Backend für die dgray Klei --- +## Datenmodell-Übersicht + +```mermaid +erDiagram + USERS ||--o{ LISTINGS : creates + USERS ||--o{ FAVORITES : has + USERS ||--o{ CONVERSATIONS : participates + USERS ||--o{ MESSAGES : sends + USERS ||--o{ REPORTS : submits + + LISTINGS ||--o{ LISTINGS_FILES : has + LISTINGS ||--o{ FAVORITES : receives + LISTINGS ||--o{ CONVERSATIONS : has + LISTINGS }o--|| CATEGORIES : belongs_to + LISTINGS }o--o| LOCATIONS : located_at + + LISTINGS_FILES }o--|| DIRECTUS_FILES : references + + CATEGORIES ||--o{ CATEGORIES : has_children + CATEGORIES ||--o{ CATEGORIES_TRANSLATIONS : has + + CONVERSATIONS ||--o{ MESSAGES : contains + + LISTINGS { + uuid id PK + string status + string title + text description + decimal price + string currency + string condition + datetime expires_at + string monero_address + } + + CATEGORIES { + uuid id PK + string name + string slug + string icon + uuid parent FK + } + + CONVERSATIONS { + uuid id PK + uuid listing FK + uuid buyer FK + uuid seller FK + string status + } + + MESSAGES { + uuid id PK + uuid conversation FK + uuid sender FK + text content + datetime read_at + } + + FAVORITES { + uuid id PK + uuid user FK + uuid listing FK + } + + REPORTS { + uuid id PK + uuid reporter FK + uuid listing FK + string reason + string status + } + + LOCATIONS { + uuid id PK + string name + string postal_code + string country + } +``` + +--- + ## 1. Data Models (Collections) ### 1.1 listings (Anzeigen)