Files
diploma-server/docs/interaction-diagram.svg
Evgenii Saenko ea390b1533 Add docker
2025-12-17 11:52:18 +03:00

70 lines
3.7 KiB
XML

<svg width="1200" height="800" viewBox="0 0 1200 800" xmlns="http://www.w3.org/2000/svg">
<defs>
<style>
.bg { fill: #ffffff; }
.title { font-family: 'Inter', 'Segoe UI', sans-serif; font-size: 26px; font-weight: 600; fill: #1f2937; }
.node { fill: #f8fafc; stroke: #1f2937; stroke-width: 2; rx: 16; }
.node-title { font-family: 'Inter', 'Segoe UI', sans-serif; font-size: 20px; font-weight: 600; fill: #111827; }
.node-body { font-family: 'Inter', 'Segoe UI', sans-serif; font-size: 15px; fill: #374151; }
.arrow { stroke: #1f2937; stroke-width: 2; fill: none; marker-end: url(#arrowhead); }
.arrow-label { font-family: 'Inter', 'Segoe UI', sans-serif; font-size: 15px; fill: #1f2937; }
.db { fill: #f8fafc; stroke: #1f2937; stroke-width: 2; }
</style>
<marker id="arrowhead" markerWidth="10" markerHeight="10" refX="9" refY="5" orient="auto">
<path d="M 0 0 L 10 5 L 0 10 z" fill="#1f2937" />
</marker>
</defs>
<rect class="bg" x="0" y="0" width="1200" height="800" />
<text x="600" y="60" text-anchor="middle" class="title">Общая схема взаимодействия: Клиент → Ktor Server → PostgreSQL</text>
<!-- Client node -->
<rect class="node" x="20" y="180" width="300" height="420" />
<text x="180" y="220" text-anchor="middle" class="node-title">Клиент (React SPA)</text>
<text x="60" y="270" class="node-body">• UI Components</text>
<text x="60" y="305" class="node-body">• MobX Stores</text>
<text x="60" y="340" class="node-body">• fetch API</text>
<text x="60" y="375" class="node-body">• Браузерное приложение</text>
<!-- Server node -->
<rect class="node" x="460" y="140" width="320" height="500" />
<text x="620" y="180" text-anchor="middle" class="node-title">Ktor Server (Kotlin)</text>
<text x="490" y="230" class="node-body">• Routing</text>
<text x="490" y="265" class="node-body">• Controllers</text>
<text x="490" y="300" class="node-body">• Services</text>
<text x="490" y="335" class="node-body">• Repositories</text>
<text x="490" y="370" class="node-body">• Ktorm ORM</text>
<text x="490" y="405" class="node-body">• JWT Authentication</text>
<text x="490" y="440" class="node-body">• Запуск на Netty runtime</text>
<!-- Database cylinder -->
<g transform="translate(900,200)">
<ellipse class="db" cx="155" cy="0" rx="140" ry="25" />
<rect class="db" x="15" y="0" width="280" height="360" ry="0" />
<ellipse class="db" cx="155" cy="360" rx="140" ry="25" />
<text x="155" y="40" text-anchor="middle" class="node-title">База данных PostgreSQL</text>
<text x="50" y="90" class="node-body">• t_admins</text>
<text x="50" y="125" class="node-body">• t_news</text>
<text x="50" y="160" class="node-body">• t_services</text>
<text x="50" y="195" class="node-body">• t_service_categories</text>
<text x="50" y="230" class="node-body">• t_users (leads)</text>
<text x="50" y="265" class="node-body">• Транзакционность (ACID)</text>
</g>
<!-- Arrows -->
<path class="arrow" d="M 320 320 L 460 320" />
<text x="390" y="300" text-anchor="middle" class="arrow-label">REST API /api/v1/*</text>
<path class="arrow" d="M 780 320 L 915 320" />
<text x="850" y="290" text-anchor="middle" class="arrow-label">
<tspan>SQL-запросы</tspan>
<tspan x="845" dy="1.2em">через Ktorm</tspan>
</text>
<path class="arrow" d="M 915 400 L 780 400" />
<text x="850" y="385" text-anchor="middle" class="arrow-label">JSON-ответы</text>
<path class="arrow" d="M 460 400 L 320 400" />
<text x="395" y="385" text-anchor="middle" class="arrow-label">JSON-ответы</text>
</svg>