Baustein 1: Grundgeruest, Datenbank, Anmeldung, zwei Rollen

Legt das Fundament der Lern-Bar an:

- Next.js 15 (App Router), React 19, TypeScript, ESLint, Vitest
- SQLite ueber Drizzle hinter einer Repository-Schicht
- Eigener Migrationslauf mit Pruefsummen, beim Start angewendet
- Argon2id, serverseitige Sitzungen, HttpOnly-Cookie, SameSite=Lax
- Rollen Ausbilder und Azubi, Rechteregeln als reine Funktionen
- Verwaltung: Azubikonto und Ausbildung anlegen, Passwort, Sperren
- Gestaltung Petrol/Bernstein, helle und dunkle Darstellung
- Dockerfile, docker-compose, Lebenszeichen, update.sh mit Rueckfall
- Sicherung und Wiederherstellung als Shell-Skripte
- 29 Tests fuer Rechte, Zeitrechnung und Migrationslauf

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Florian Wilde
2026-09-10 00:52:44 +02:00
co-authored by Claude Opus 5
commit e856349cd4
51 changed files with 11883 additions and 0 deletions
+490
View File
@@ -0,0 +1,490 @@
/* ---------------------------------------------------------------------------
Lern-Bar – Gestaltung
Leitfarbe dunkles Petrol, Akzent warmes Bernstein, Karten sehr helles
Blaugrau. Nur Systemschriften, keine Zeichensätze von außen.
--------------------------------------------------------------------------- */
:root {
color-scheme: light;
--petrol: #1f4e5f;
--petrol-hell: #2c6b81;
--petrol-dunkel: #163a47;
--bernstein: #d98a2b;
--bernstein-dunkel: #a9660f;
--grund: #ffffff;
--flaeche: #edf3f5;
--flaeche-kraeftig: #dde8ec;
--rand: #c8d8de;
--rand-zart: #dde8ec;
--text: #16242a;
--text-leise: #4d646d;
--text-auf-petrol: #f2f8fa;
--gut: #1d6f4a;
--gut-flaeche: #e2f2ea;
--warnung: #8a5a00;
--warnung-flaeche: #fbf0dc;
--fehler: #9b2226;
--fehler-flaeche: #fbe9e9;
--radius: 10px;
--radius-klein: 6px;
--schatten: 0 1px 2px rgb(22 36 42 / 8%), 0 2px 8px rgb(22 36 42 / 5%);
--schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
--schrift-fest: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", monospace;
--breite: 1120px;
}
:root[data-thema="dunkel"] {
color-scheme: dark;
--petrol: #7fc0d4;
--petrol-hell: #a3d4e3;
--petrol-dunkel: #0f2a34;
--bernstein: #e5a552;
--bernstein-dunkel: #f0bd7c;
--grund: #0e1b21;
--flaeche: #16272f;
--flaeche-kraeftig: #1e343e;
--rand: #2c4652;
--rand-zart: #233b45;
--text: #e6eef1;
--text-leise: #a3b8c0;
--text-auf-petrol: #0e1b21;
--gut: #6cc79a;
--gut-flaeche: #14332a;
--warnung: #e3b264;
--warnung-flaeche: #33290f;
--fehler: #f08a8d;
--fehler-flaeche: #35191b;
--schatten: 0 1px 2px rgb(0 0 0 / 40%), 0 2px 8px rgb(0 0 0 / 30%);
}
@media (prefers-color-scheme: dark) {
:root:not([data-thema="hell"]) {
color-scheme: dark;
--petrol: #7fc0d4;
--petrol-hell: #a3d4e3;
--petrol-dunkel: #0f2a34;
--bernstein: #e5a552;
--bernstein-dunkel: #f0bd7c;
--grund: #0e1b21;
--flaeche: #16272f;
--flaeche-kraeftig: #1e343e;
--rand: #2c4652;
--rand-zart: #233b45;
--text: #e6eef1;
--text-leise: #a3b8c0;
--text-auf-petrol: #0e1b21;
--gut: #6cc79a;
--gut-flaeche: #14332a;
--warnung: #e3b264;
--warnung-flaeche: #33290f;
--fehler: #f08a8d;
--fehler-flaeche: #35191b;
--schatten: 0 1px 2px rgb(0 0 0 / 40%), 0 2px 8px rgb(0 0 0 / 30%);
}
}
*,
*::before,
*::after {
box-sizing: border-box;
}
html {
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
background: var(--grund);
color: var(--text);
font-family: var(--schrift);
font-size: 16px;
line-height: 1.6;
min-height: 100dvh;
}
h1,
h2,
h3,
h4 {
line-height: 1.25;
margin: 0 0 0.5em;
font-weight: 650;
letter-spacing: -0.01em;
}
h1 { font-size: 1.65rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
a {
color: var(--petrol);
text-underline-offset: 2px;
}
a:hover { color: var(--petrol-hell); }
:focus-visible {
outline: 3px solid var(--bernstein);
outline-offset: 2px;
border-radius: 3px;
}
hr {
border: 0;
border-top: 1px solid var(--rand-zart);
margin: 1.5rem 0;
}
code, kbd, samp, pre {
font-family: var(--schrift-fest);
font-size: 0.92em;
}
code {
background: var(--flaeche);
padding: 0.1em 0.35em;
border-radius: var(--radius-klein);
}
/* --- Grundbausteine --- */
.huelle {
max-width: var(--breite);
margin: 0 auto;
padding: 1.25rem 1rem 4rem;
}
.karte {
background: var(--flaeche);
border: 1px solid var(--rand-zart);
border-radius: var(--radius);
padding: 1rem 1.15rem;
}
.karte-grund {
background: var(--grund);
border: 1px solid var(--rand);
border-radius: var(--radius);
padding: 1rem 1.15rem;
box-shadow: var(--schatten);
}
.leise {
color: var(--text-leise);
font-size: 0.9rem;
}
.stapel > * + * { margin-top: 1rem; }
.stapel-eng > * + * { margin-top: 0.5rem; }
.reihe {
display: flex;
gap: 0.75rem;
flex-wrap: wrap;
align-items: center;
}
.raster {
display: grid;
gap: 1rem;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
/* --- Bedienelemente --- */
.knopf {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.45rem;
min-height: 44px;
padding: 0.55rem 1.1rem;
border-radius: var(--radius-klein);
border: 1px solid transparent;
background: var(--petrol);
color: var(--text-auf-petrol);
font: inherit;
font-weight: 600;
cursor: pointer;
text-decoration: none;
transition: background-color 0.12s ease;
}
.knopf:hover { background: var(--petrol-hell); color: var(--text-auf-petrol); }
.knopf:disabled { opacity: 0.55; cursor: not-allowed; }
.knopf-zweit {
background: transparent;
color: var(--petrol);
border-color: var(--rand);
}
.knopf-zweit:hover { background: var(--flaeche-kraeftig); color: var(--petrol); }
.knopf-akzent { background: var(--bernstein); color: #26170a; }
.knopf-akzent:hover { background: var(--bernstein-dunkel); color: #26170a; }
.knopf-still {
background: transparent;
color: var(--text-leise);
border-color: transparent;
padding: 0.4rem 0.6rem;
min-height: 38px;
font-weight: 500;
}
.knopf-still:hover { background: var(--flaeche); color: var(--text); }
label {
display: block;
font-weight: 600;
font-size: 0.92rem;
margin-bottom: 0.3rem;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="search"],
select,
textarea {
width: 100%;
min-height: 44px;
padding: 0.5rem 0.7rem;
border: 1px solid var(--rand);
border-radius: var(--radius-klein);
background: var(--grund);
color: var(--text);
font: inherit;
}
textarea {
min-height: 6rem;
resize: vertical;
line-height: 1.5;
}
input:disabled,
textarea:disabled,
select:disabled {
background: var(--flaeche);
color: var(--text-leise);
}
.feld + .feld { margin-top: 0.9rem; }
.hinweis {
border-radius: var(--radius-klein);
padding: 0.7rem 0.9rem;
border: 1px solid;
font-size: 0.95rem;
}
.hinweis-fehler { background: var(--fehler-flaeche); border-color: var(--fehler); color: var(--fehler); }
.hinweis-warnung { background: var(--warnung-flaeche); border-color: var(--warnung); color: var(--warnung); }
.hinweis-gut { background: var(--gut-flaeche); border-color: var(--gut); color: var(--gut); }
/* --- Kopfzeile --- */
.kopf {
background: var(--petrol-dunkel);
color: #f2f8fa;
border-bottom: 3px solid var(--bernstein);
}
:root[data-thema="dunkel"] .kopf { background: #0b2029; }
.kopf-innen {
max-width: var(--breite);
margin: 0 auto;
padding: 0.6rem 1rem;
display: flex;
align-items: center;
gap: 1rem;
flex-wrap: wrap;
}
.marke {
font-weight: 700;
font-size: 1.1rem;
color: #f2f8fa;
text-decoration: none;
letter-spacing: -0.01em;
display: inline-flex;
align-items: center;
gap: 0.5rem;
}
.marke:hover { color: #fff; }
.marke .marke-akzent { color: #e5a552; }
.hauptnavigation {
display: flex;
gap: 0.15rem;
flex-wrap: wrap;
flex: 1;
}
.hauptnavigation a {
color: #cfe2e9;
text-decoration: none;
padding: 0.45rem 0.7rem;
border-radius: var(--radius-klein);
font-size: 0.95rem;
font-weight: 500;
white-space: nowrap;
}
.hauptnavigation a:hover { background: rgb(255 255 255 / 12%); color: #fff; }
.hauptnavigation a[aria-current="page"] {
background: rgb(255 255 255 / 16%);
color: #fff;
box-shadow: inset 0 -2px 0 #d98a2b;
}
.kopf-rechts {
display: flex;
align-items: center;
gap: 0.5rem;
margin-left: auto;
}
.kopf-knopf {
background: transparent;
border: 1px solid rgb(255 255 255 / 25%);
color: #e3eef2;
border-radius: var(--radius-klein);
min-height: 38px;
padding: 0.3rem 0.65rem;
font: inherit;
font-size: 0.9rem;
cursor: pointer;
}
.kopf-knopf:hover { background: rgb(255 255 255 / 12%); }
/* --- Fortschritt --- */
.balken {
height: 10px;
background: var(--flaeche-kraeftig);
border-radius: 999px;
overflow: hidden;
border: 1px solid var(--rand-zart);
}
.balken > span {
display: block;
height: 100%;
background: var(--petrol);
border-radius: 999px;
}
/* --- Status-Marken: nie nur Farbe, immer auch ein Zeichen --- */
.marke-status {
display: inline-flex;
align-items: center;
gap: 0.35rem;
font-size: 0.82rem;
font-weight: 650;
padding: 0.15rem 0.55rem;
border-radius: 999px;
border: 1px solid var(--rand);
background: var(--grund);
color: var(--text-leise);
white-space: nowrap;
}
.marke-status[data-ton="gut"] { color: var(--gut); border-color: var(--gut); background: var(--gut-flaeche); }
.marke-status[data-ton="warnung"] { color: var(--warnung); border-color: var(--warnung); background: var(--warnung-flaeche); }
.marke-status[data-ton="fehler"] { color: var(--fehler); border-color: var(--fehler); background: var(--fehler-flaeche); }
/* --- Tabellen --- */
.tabelle-huelle { overflow-x: auto; }
table.tabelle {
border-collapse: collapse;
width: 100%;
font-size: 0.95rem;
}
table.tabelle th,
table.tabelle td {
text-align: left;
padding: 0.5rem 0.7rem;
border-bottom: 1px solid var(--rand-zart);
vertical-align: top;
}
table.tabelle th {
font-weight: 650;
background: var(--flaeche);
white-space: nowrap;
}
/* --- Anmeldung --- */
.anmeldung {
min-height: 100dvh;
display: grid;
place-items: center;
padding: 1.5rem 1rem;
background: linear-gradient(160deg, var(--flaeche) 0%, var(--grund) 60%);
}
.anmeldung-karte {
width: min(420px, 100%);
background: var(--grund);
border: 1px solid var(--rand);
border-radius: var(--radius);
padding: 1.75rem;
box-shadow: var(--schatten);
}
/* --- Sprungmarke --- */
.sprung {
position: absolute;
left: -9999px;
top: 0;
background: #d98a2b;
color: #26170a;
padding: 0.6rem 1rem;
z-index: 100;
border-radius: 0 0 var(--radius-klein) 0;
font-weight: 650;
}
.sprung:focus { left: 0; }
/* --- Druck --- */
@media print {
.kopf,
.nicht-drucken {
display: none !important;
}
body { background: #fff; color: #000; font-size: 11pt; }
.huelle { max-width: none; padding: 0; }
.karte, .karte-grund { border: 1px solid #999; box-shadow: none; background: #fff; }
a { color: #000; text-decoration: none; }
}
/* Nur für Bildschirmleser sichtbar */
.nur-lesehilfe {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}