feat: Implement user authentication and database migration system

- Refactored AuthService to use UserRepository for user authentication.
- Added .env file for environment configuration.
- Created migration system with Migrator and ConnectionFactory classes.
- Added database migration files for creating users table.
- Implemented settings controller for managing database migrations.
- Developed user repository for user data handling.
- Created users controller for user management interface.
- Added frontend standards and migration documentation.
- Introduced reusable UI components and jQuery alerts module.
This commit is contained in:
2026-02-21 17:51:34 +01:00
parent 92bbe82614
commit b67542d159
35 changed files with 2733 additions and 213 deletions

View File

@@ -1,16 +1,4 @@
:root {
--c-primary: #6690f4;
--c-primary-dark: #3164db;
--c-bg: #f4f6f9;
--c-surface: #ffffff;
--c-text: #4e5e6a;
--c-text-strong: #2d3748;
--c-muted: #718096;
--c-border: #e2e8f0;
--c-danger: #cc0000;
--shadow-card: 0 1px 4px rgba(0, 0, 0, 0.06);
--focus-ring: 0 0 0 3px rgba(102, 144, 244, 0.15);
}
@use "shared/ui-components";
* {
box-sizing: border-box;
@@ -33,6 +21,58 @@ a {
color: var(--c-primary);
}
.app-shell {
min-height: 100vh;
display: grid;
grid-template-columns: 260px 1fr;
}
.sidebar {
border-right: 1px solid var(--c-border);
border-right-color: #243041;
background: #111a28;
padding: 18px 14px;
}
.sidebar__brand {
margin: 4px 10px 16px;
color: #e9f0ff;
font-size: 24px;
font-weight: 300;
letter-spacing: -0.02em;
}
.sidebar__brand strong {
font-weight: 700;
}
.sidebar__nav {
display: grid;
gap: 6px;
}
.sidebar__link {
border-radius: 8px;
padding: 10px 12px;
text-decoration: none;
color: #cbd5e1;
font-weight: 600;
}
.sidebar__link:hover {
color: #f8fafc;
background: #1b2a3f;
}
.sidebar__link.is-active {
color: #ffffff;
background: #2e4f93;
}
.app-main {
min-width: 0;
}
.topbar {
height: 56px;
border-bottom: 1px solid var(--c-border);
@@ -57,30 +97,6 @@ a {
font-weight: 700;
}
.logout-btn {
min-height: 38px;
border: 1px solid var(--c-border);
border-radius: 8px;
padding: 0 14px;
font: inherit;
font-weight: 600;
color: var(--c-text-strong);
background: var(--c-surface);
cursor: pointer;
transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.logout-btn:hover {
border-color: #cbd5e0;
background: #f8fafc;
}
.logout-btn:focus-visible {
outline: none;
box-shadow: var(--focus-ring);
border-color: var(--c-primary);
}
.container {
max-width: 1120px;
margin: 24px auto;
@@ -110,54 +126,117 @@ a {
font-weight: 600;
}
.btn {
min-height: 38px;
padding: 8px 16px;
border: 0;
border-radius: 8px;
color: #ffffff;
background: var(--c-primary);
font: inherit;
font-weight: 600;
.users-form {
display: grid;
gap: 14px;
max-width: 460px;
}
.section-title {
margin: 0;
color: var(--c-text-strong);
font-size: 20px;
font-weight: 700;
}
.mt-12 {
margin-top: 12px;
}
.mt-16 {
margin-top: 16px;
}
.settings-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 12px;
}
.settings-nav {
display: flex;
gap: 8px;
flex-wrap: wrap;
}
.settings-nav__link {
text-decoration: none;
cursor: pointer;
transition: background-color 0.2s ease;
}
.btn:hover {
background: var(--c-primary-dark);
}
.btn:focus-visible {
outline: none;
box-shadow: var(--focus-ring);
}
.form-control {
width: 100%;
min-height: 38px;
border: 1px solid var(--c-border);
border-radius: 8px;
padding: 7px 12px;
font: inherit;
padding: 8px 12px;
color: var(--c-text-strong);
background: #ffffff;
transition: border-color 0.2s ease, box-shadow 0.2s ease;
font-weight: 600;
}
.form-control:focus {
outline: none;
.settings-nav__link:hover {
background: #f8fafc;
}
.settings-nav__link.is-active {
border-color: var(--c-primary);
box-shadow: var(--focus-ring);
color: var(--c-primary);
background: #edf2ff;
}
.settings-stat {
border: 1px solid var(--c-border);
border-radius: 8px;
padding: 12px;
background: #f8fafc;
}
.settings-stat__label {
display: block;
color: var(--c-muted);
font-size: 12px;
margin-bottom: 4px;
}
.settings-stat__value {
color: var(--c-text-strong);
font-size: 20px;
}
.settings-logs {
margin: 0;
padding: 12px;
border-radius: 8px;
border: 1px solid var(--c-border);
background: #0b1220;
color: #d1d5db;
font-size: 12px;
line-height: 1.5;
overflow: auto;
}
@media (max-width: 768px) {
.topbar {
padding: 0 14px;
.app-shell {
grid-template-columns: 1fr;
}
.brand {
font-size: 20px;
.sidebar {
border-right: 0;
border-bottom: 1px solid #243041;
padding: 14px;
}
.sidebar__brand {
margin: 0 0 10px;
font-size: 22px;
}
.sidebar__nav {
display: flex;
gap: 8px;
overflow-x: auto;
}
.sidebar__link {
white-space: nowrap;
}
.topbar {
padding: 0 14px;
}
.container {
@@ -165,6 +244,10 @@ a {
padding: 0 14px 18px;
}
.settings-grid {
grid-template-columns: 1fr;
}
.card {
padding: 18px;
}