Initial commit: LMS microservices scaffold

- Gradle multi-module: libs/{common-http,security-jwt,markdown,test-support},
  services/{identity,academic,progress,gateway}, web (Thymeleaf+htmx)
- identity-service: JWT auth (RSA), accounts, students, groups, enrollment,
  import from XLSX/CSV, credentials export, password reset
- academic-service: lab import from JSON/zip (markdown + YAML + variants),
  levels, API
- progress-service: schema for student levels and variant assignments
- gateway: Spring Cloud Gateway, JWT validation, route propagation
- web: Server-side UI with flex/footer layout, light/dark theme toggle,
  admin dashboard, groups CRUD, student portal placeholder
- docker-compose: PostgreSQL 18
- Tests: identity smoke test with Testcontainers
This commit is contained in:
2026-09-10 19:46:13 +03:00
commit 2cee104633
125 changed files with 4752 additions and 0 deletions

View File

@@ -0,0 +1,83 @@
<!DOCTYPE html>
<html lang="ru" xmlns:th="http://www.thymeleaf.org"
th:replace="~{fragments/base :: layout(~{::title}, ~{::#content})}">
<head><title th:text="${group.name} + ' — LMS'">Группа</title></head>
<body>
<div id="content">
<a th:href="@{/admin/groups}" style="font-size:0.875rem;">← Все группы</a>
<div style="margin-top:1rem;margin-bottom:1.5rem;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:1rem;">
<div>
<h1 style="margin:0;font-size:1.5rem;font-weight:600;" th:text="${group.name}">Группа</h1>
<p style="margin:0.25rem 0 0;font-size:0.875rem;color:var(--c-text-muted);">
Студентов: <span th:text="${#lists.size(group.students)}">0</span>
</p>
</div>
<div style="display:flex;gap:0.5rem;">
<a class="btn btn-secondary" th:href="@{/admin/groups/{id}/credentials(id=${group.id}, format='xlsx')}">Выгрузить XLSX</a>
<a class="btn btn-secondary" th:href="@{/admin/groups/{id}/credentials(id=${group.id}, format='csv')}">CSV</a>
</div>
</div>
<div th:if="${notice}" style="margin-bottom:1rem;padding:0.75rem 1rem;border-radius:0.5rem;font-size:0.875rem;background:#dcfce7;color:#166534;" th:text="${notice}"></div>
<div th:if="${error}" style="margin-bottom:1rem;padding:0.75rem 1rem;border-radius:0.5rem;font-size:0.875rem;background:#fef2f2;color:#991b1b;" th:text="${error}"></div>
<div th:if="${resetPassword}" style="margin-bottom:1rem;padding:0.75rem 1rem;border-radius:0.5rem;font-size:0.875rem;background:#fef3c7;color:#92400e;">
Новый пароль: <code style="padding:0.125rem 0.5rem;border-radius:0.25rem;font-family:monospace;" th:text="${resetPassword}">password</code>
</div>
<div th:if="${importResult}" class="card" style="margin-bottom:1.5rem;padding:1.5rem;">
<h2 style="margin:0 0 0.25rem;font-size:1.125rem;font-weight:500;">
Импорт: <span th:text="${importResult.groupName}">группа</span>
</h2>
<p style="margin:0;font-size:0.875rem;color:var(--c-text-muted);">
Новых студентов: <span th:text="${#lists.size(importResult.added)}">0</span>,
обновлено: <span th:text="${#lists.size(importResult.updated)}">0</span>.
</p>
<div th:if="${not #lists.isEmpty(importResult.added)}" style="margin-top:1rem;overflow-x:auto;">
<p style="margin:0 0 0.5rem;font-size:0.875rem;color:#92400e;">Сохраните пароли — они показываются для выдачи студентам.</p>
<table>
<thead>
<tr><th>ФИО</th><th>Логин</th><th>Пароль</th></tr>
</thead>
<tbody>
<tr th:each="credential : ${importResult.added}">
<td th:text="${credential.fullName}">—</td>
<td style="font-family:monospace;" th:text="${credential.studentNo}">—</td>
<td style="font-family:monospace;font-weight:600;" th:text="${credential.password}">—</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="card" style="padding:0;">
<table>
<thead>
<tr><th>№</th><th>ФИО</th><th>Логин</th><th>Основа</th><th>Пароль</th><th></th></tr>
</thead>
<tbody>
<tr th:each="student, iter : ${group.students}">
<td style="color:var(--c-text-muted);" th:text="${iter.count}">1</td>
<td th:text="${student.fullName}">—</td>
<td style="font-family:monospace;" th:text="${student.studentNo}">—</td>
<td style="color:var(--c-text-muted);" th:text="${student.basis}">—</td>
<td>
<span th:if="${student.mustChangePassword}" class="badge badge-warn">временный</span>
<span th:unless="${student.mustChangePassword}" class="badge badge-ok">изменён</span>
</td>
<td style="text-align:right;">
<form th:action="@{/admin/groups/{gid}/students/{sid}/reset-password(gid=${group.id}, sid=${student.id})}" method="post">
<button type="submit" style="font-size:0.875rem;border:none;background:none;cursor:pointer;color:var(--c-text-link);">Сбросить пароль</button>
</form>
</td>
</tr>
<tr th:if="${#lists.isEmpty(group.students)}">
<td colspan="6" style="text-align:center;color:var(--c-text-muted);padding:1.5rem;">В группе пока нет студентов.</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>