Add ER diagram and test protocol

This commit is contained in:
2026-08-09 02:18:23 +02:00
parent 0945d1d2ba
commit a055eb2b0a
2 changed files with 116 additions and 0 deletions
+89
View File
@@ -0,0 +1,89 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="1000" viewBox="0 0 1600 1000" role="img" aria-labelledby="title desc">
<title id="title">ER-Diagramm des Habit Trackers</title>
<desc id="desc">Datenmodell mit den Tabellen users, categories, habits, habit_logs und reminders.</desc>
<style>
.canvas { fill: #f6f7f9; }
.heading { font: 700 38px Arial, Helvetica, sans-serif; fill: #172033; }
.subheading { font: 400 19px Arial, Helvetica, sans-serif; fill: #657086; }
.relation { stroke: #8290a4; stroke-width: 3; fill: none; marker-end: url(#arrow); }
.relation-label { font: 700 18px Arial, Helvetica, sans-serif; fill: #657086; }
.table { fill: #ffffff; stroke: #cfd7e3; stroke-width: 2; }
.table-head { fill: #176b5b; }
.table-title { font: 700 24px Arial, Helvetica, sans-serif; fill: #ffffff; }
.field { font: 18px "Courier New", monospace; fill: #172033; }
.key { font-weight: 700; fill: #0f4c40; }
.note { font: 16px Arial, Helvetica, sans-serif; fill: #657086; }
</style>
<defs>
<marker id="arrow" markerWidth="10" markerHeight="10" refX="8" refY="3" orient="auto" markerUnits="strokeWidth">
<path d="M0,0 L0,6 L9,3 z" fill="#8290a4" />
</marker>
</defs>
<rect class="canvas" width="1600" height="1000" rx="24" />
<text class="heading" x="80" y="78">Habit Tracker — ER-Diagramm</text>
<text class="subheading" x="80" y="112">Fünf Tabellen mit klaren Fremdschlüssel-Beziehungen</text>
<path class="relation" d="M430 350 C505 350, 500 385, 575 385" />
<text class="relation-label" x="468" y="331">1 : n</text>
<path class="relation" d="M1160 350 C1085 350, 1095 425, 1020 425" />
<text class="relation-label" x="1064" y="330">1 : n</text>
<path class="relation" d="M800 585 C800 645, 430 635, 430 705" />
<text class="relation-label" x="588" y="647">1 : n</text>
<path class="relation" d="M800 585 C800 645, 1170 635, 1170 705" />
<text class="relation-label" x="988" y="647">1 : n</text>
<g transform="translate(100,190)">
<rect class="table" width="330" height="320" rx="10" />
<rect class="table-head" width="330" height="58" rx="10" />
<text class="table-title" x="24" y="38">users</text>
<text class="field key" x="24" y="96">PK id</text>
<text class="field" x="24" y="132">name</text>
<text class="field" x="24" y="168">email UNIQUE</text>
<text class="field" x="24" y="204">password_hash</text>
<text class="field" x="24" y="240">created_at</text>
<text class="note" x="24" y="288">Ein Konto besitzt mehrere Habits.</text>
</g>
<g transform="translate(1160,190)">
<rect class="table" width="330" height="270" rx="10" />
<rect class="table-head" width="330" height="58" rx="10" />
<text class="table-title" x="24" y="38">categories</text>
<text class="field key" x="24" y="96">PK id</text>
<text class="field" x="24" y="132">name</text>
<text class="field" x="24" y="168">color</text>
<text class="note" x="24" y="226">Kategorie eines Habits ist optional.</text>
</g>
<g transform="translate(575,260)">
<rect class="table" width="450" height="350" rx="10" />
<rect class="table-head" width="450" height="58" rx="10" />
<text class="table-title" x="24" y="38">habits</text>
<text class="field key" x="24" y="96">PK id</text>
<text class="field key" x="24" y="132">FK user_id → users.id</text>
<text class="field key" x="24" y="168">FK category_id → categories.id</text>
<text class="field" x="24" y="204">title · description</text>
<text class="field" x="24" y="240">target_per_week</text>
<text class="field" x="24" y="276">created_at</text>
<text class="note" x="24" y="322">Zentrale Tabelle der Anwendung.</text>
</g>
<g transform="translate(100,705)">
<rect class="table" width="430" height="230" rx="10" />
<rect class="table-head" width="430" height="58" rx="10" />
<text class="table-title" x="24" y="38">habit_logs</text>
<text class="field key" x="24" y="96">PK id</text>
<text class="field key" x="24" y="132">FK habit_id → habits.id</text>
<text class="field" x="24" y="168">completed_on · created_at</text>
<text class="note" x="24" y="210">UNIQUE: habit_id + completed_on</text>
</g>
<g transform="translate(950,705)">
<rect class="table" width="430" height="230" rx="10" />
<rect class="table-head" width="430" height="58" rx="10" />
<text class="table-title" x="24" y="38">reminders</text>
<text class="field key" x="24" y="96">PK id</text>
<text class="field key" x="24" y="132">FK habit_id → habits.id</text>
<text class="field" x="24" y="168">reminder_time · weekday · is_active</text>
<text class="note" x="24" y="210">Erinnerung gehört zu genau einem Habit.</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.7 KiB