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

148 lines
9.9 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<svg width="1200" height="950" viewBox="0 0 1200 950" xmlns="http://www.w3.org/2000/svg">
<defs>
<style>
.bg { fill: #f8fafc; }
.card { fill: #ffffff; stroke: #0f172a; stroke-width: 1.5; }
.title { font-family: 'Inter', 'Segoe UI', sans-serif; font-size: 32px; font-weight: 600; fill: #0f172a; }
.subtitle { font-family: 'Inter', 'Segoe UI', sans-serif; font-size: 16px; fill: #475569; }
.card-title { font-family: 'Inter', 'Segoe UI', sans-serif; font-size: 17px; font-weight: 600; fill: #0f172a; }
.card-body { font-family: 'Inter', 'Segoe UI', sans-serif; font-size: 13px; fill: #334155; }
.note { font-family: 'Inter', 'Segoe UI', sans-serif; font-size: 13px; fill: #475569; }
.arrow { stroke: #0f172a; stroke-width: 1.8; fill: none; }
.dashed { stroke-dasharray: 6 6; }
</style>
<marker id="arrow" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="8" markerHeight="8" orient="auto">
<path d="M 0 0 L 10 5 L 0 10 z" fill="#0f172a" />
</marker>
</defs>
<rect class="bg" x="0" y="0" width="1200" height="950" rx="32" />
<text x="600" y="45" text-anchor="middle" class="title">CRUD-модель сервера Diploma</text>
<text x="600" y="75" text-anchor="middle" class="subtitle">Ktor обрабатывает HTTP-запросы через Controllers, Services, Repositories и таблицы PostgreSQL.</text>
<!-- Client surfaces -->
<rect class="card" x="150" y="90" width="220" height="100" rx="14" />
<text x="260" y="120" text-anchor="middle" class="card-title">Публичные каналы</text>
<text x="260" y="150" text-anchor="middle" class="card-body">Маркетинговый сайт</text>
<text x="260" y="170" text-anchor="middle" class="card-body">Лендинги и формы</text>
<rect class="card" x="830" y="90" width="220" height="100" rx="14" />
<text x="940" y="120" text-anchor="middle" class="card-title">Админ-консоль</text>
<text x="940" y="150" text-anchor="middle" class="card-body">Внутренний кабинет</text>
<text x="940" y="170" text-anchor="middle" class="card-body">CMS, отчеты</text>
<!-- Ktor layer -->
<rect class="card" x="420" y="200" width="360" height="140" rx="18" />
<text x="600" y="235" text-anchor="middle" class="card-title">Ktor HTTP-слой</text>
<text x="600" y="260" text-anchor="middle" class="card-body">Routing.kt · Serialization.kt · Security.kt</text>
<text x="600" y="285" text-anchor="middle" class="card-body">Проверка JWT, JSON-парсинг,</text>
<text x="600" y="305" text-anchor="middle" class="card-body">маршрутизация по модулям</text>
<!-- Shared utilities -->
<rect class="card" x="1000" y="230" width="150" height="120" rx="14" />
<text x="1075" y="260" text-anchor="middle" class="card-title">shared/*</text>
<text x="1075" y="285" text-anchor="middle" class="card-body">Пагинация</text>
<text x="1075" y="305" text-anchor="middle" class="card-body">Ошибки и DTO</text>
<!-- Controllers row -->
<rect class="card" x="80" y="360" width="220" height="150" rx="16" />
<text x="190" y="390" text-anchor="middle" class="card-title">NewsController</text>
<text x="190" y="415" text-anchor="middle" class="card-body">GET /news и /news/{slug}</text>
<text x="190" y="435" text-anchor="middle" class="card-body">Админ: список и создание</text>
<text x="190" y="455" text-anchor="middle" class="card-body">обновление, публикация, удаление</text>
<rect class="card" x="340" y="360" width="220" height="150" rx="16" />
<text x="450" y="390" text-anchor="middle" class="card-title">ServiceController</text>
<text x="450" y="415" text-anchor="middle" class="card-body">Публичный список/просмотр</text>
<text x="450" y="435" text-anchor="middle" class="card-body">Фильтры: категория, цена</text>
<text x="450" y="455" text-anchor="middle" class="card-body">Админ: CRUD и статус</text>
<rect class="card" x="600" y="360" width="220" height="150" rx="16" />
<text x="710" y="390" text-anchor="middle" class="card-title">ServiceCategoryController</text>
<text x="710" y="415" text-anchor="middle" class="card-body">Публичный список и slug</text>
<text x="710" y="435" text-anchor="middle" class="card-body">Админ: список, создание</text>
<text x="710" y="455" text-anchor="middle" class="card-body">обновление, удаление</text>
<rect class="card" x="860" y="360" width="220" height="150" rx="16" />
<text x="970" y="390" text-anchor="middle" class="card-title">LeadController</text>
<text x="970" y="415" text-anchor="middle" class="card-body">POST /leads с сайта</text>
<text x="970" y="435" text-anchor="middle" class="card-body">Админ: список и чтение</text>
<text x="970" y="455" text-anchor="middle" class="card-body">Удаление заявок</text>
<!-- Services row -->
<rect class="card" x="80" y="530" width="220" height="120" rx="16" />
<text x="190" y="560" text-anchor="middle" class="card-title">NewsService</text>
<text x="190" y="585" text-anchor="middle" class="card-body">Правила публикации, DTO</text>
<text x="190" y="605" text-anchor="middle" class="card-body">Страницы и статусы</text>
<rect class="card" x="340" y="530" width="220" height="120" rx="16" />
<text x="450" y="560" text-anchor="middle" class="card-title">ServiceService</text>
<text x="450" y="585" text-anchor="middle" class="card-body">Фильтры по статусу/категории</text>
<text x="450" y="605" text-anchor="middle" class="card-body">Контроль цены, связи</text>
<rect class="card" x="600" y="530" width="220" height="120" rx="16" />
<text x="710" y="560" text-anchor="middle" class="card-title">ServiceCategoryService</text>
<text x="710" y="585" text-anchor="middle" class="card-body">Таксономия и slug</text>
<text x="710" y="605" text-anchor="middle" class="card-body">CRUD категорий</text>
<rect class="card" x="860" y="530" width="220" height="120" rx="16" />
<text x="970" y="560" text-anchor="middle" class="card-title">LeadService</text>
<text x="970" y="585" text-anchor="middle" class="card-body">Валидация контактов</text>
<text x="970" y="605" text-anchor="middle" class="card-body">Поиск и пагинация</text>
<!-- Repository row -->
<rect class="card" x="80" y="680" width="220" height="120" rx="16" />
<text x="190" y="710" text-anchor="middle" class="card-title">NewsRepository</text>
<text x="190" y="735" text-anchor="middle" class="card-body">SQL-запросы для news</text>
<text x="190" y="755" text-anchor="middle" class="card-body">Админ и публичные выборки</text>
<rect class="card" x="340" y="680" width="220" height="120" rx="16" />
<text x="450" y="710" text-anchor="middle" class="card-title">ServiceRepository</text>
<text x="450" y="735" text-anchor="middle" class="card-body">Джоины услуг и категорий</text>
<text x="450" y="755" text-anchor="middle" class="card-body">Фильтры по цене</text>
<rect class="card" x="600" y="680" width="220" height="120" rx="16" />
<text x="710" y="710" text-anchor="middle" class="card-title">ServiceCategoryRepository</text>
<text x="710" y="735" text-anchor="middle" class="card-body">Метаданные категорий</text>
<text x="710" y="755" text-anchor="middle" class="card-body">Хранение slug</text>
<rect class="card" x="860" y="680" width="220" height="120" rx="16" />
<text x="970" y="710" text-anchor="middle" class="card-title">LeadRepository</text>
<text x="970" y="735" text-anchor="middle" class="card-body">Прием заявок</text>
<text x="970" y="755" text-anchor="middle" class="card-body">Админские запросы</text>
<!-- Database layer -->
<rect class="card" x="100" y="830" width="1000" height="110" rx="20" />
<text x="600" y="860" text-anchor="middle" class="card-title">Схема PostgreSQL</text>
<text x="600" y="885" text-anchor="middle" class="card-body">news, services, service_categories, leads</text>
<text x="600" y="905" text-anchor="middle" class="card-body">Временные метки, статусы, связи</text>
<!-- Arrows -->
<path class="arrow" marker-end="url(#arrow)" d="M 260 190 L 600 200" />
<path class="arrow" marker-end="url(#arrow)" d="M 940 190 L 600 200" />
<path class="arrow" marker-end="url(#arrow)" d="M 600 340 L 190 360" />
<path class="arrow" marker-end="url(#arrow)" d="M 600 340 L 450 360" />
<path class="arrow" marker-end="url(#arrow)" d="M 600 340 L 710 360" />
<path class="arrow" marker-end="url(#arrow)" d="M 600 340 L 970 360" />
<!-- Vertical flows -->
<path class="arrow" marker-end="url(#arrow)" d="M 190 510 L 190 530" />
<path class="arrow" marker-end="url(#arrow)" d="M 450 510 L 450 530" />
<path class="arrow" marker-end="url(#arrow)" d="M 710 510 L 710 530" />
<path class="arrow" marker-end="url(#arrow)" d="M 970 510 L 970 530" />
<path class="arrow" marker-end="url(#arrow)" d="M 190 650 L 190 680" />
<path class="arrow" marker-end="url(#arrow)" d="M 450 650 L 450 680" />
<path class="arrow" marker-end="url(#arrow)" d="M 710 650 L 710 680" />
<path class="arrow" marker-end="url(#arrow)" d="M 970 650 L 970 680" />
<path class="arrow" marker-end="url(#arrow)" d="M 190 800 L 190 830" />
<path class="arrow" marker-end="url(#arrow)" d="M 450 800 L 450 830" />
<path class="arrow" marker-end="url(#arrow)" d="M 710 800 L 710 830" />
<path class="arrow" marker-end="url(#arrow)" d="M 970 800 L 970 830" />
<text x="600" y="925" text-anchor="middle" class="note">Каждый модуль следует паттерну Controller → Service → Repository и покрывает CRUD.</text>
</svg>