Add stage 2: Vue/TypeScript PWA shell with auth-gated routing

Backend: new migration adds users.email_verified_at (null = unverified);
registration leaves it null, and the register/login/me payloads now expose
email_verified and email_verified_at.

Frontend (web/): Vite + Vue 3 + TypeScript PWA (vite-plugin-pwa). Pinia auth
store keeps the token in localStorage and validates it via GET /api/me on
load. vue-router guards redirect unauthenticated visitors to /login,
preserving the intended path; /register creates an account and signs in
immediately (with the email unverified). Placeholder home page, minimal
styling, generated icons. Dev server proxies /api to the API.

docker-compose.yml gains an optional "web" service (profile: frontend) so
`docker compose --profile frontend up -d` runs the dev server alongside the
API; `docker compose up -d` still starts the API alone.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-03 18:12:31 +01:00
co-authored by Claude Sonnet 5
parent e91fc89e23
commit 5e3b8dbd7e
35 changed files with 7454 additions and 10 deletions
+188
View File
@@ -0,0 +1,188 @@
/* Placeholder styling only — just enough to be legible. */
:root {
--bg: #f7f7f8;
--surface: #ffffff;
--border: #e2e2e5;
--text: #1c1c1f;
--muted: #6b6b73;
--accent: #4f46e5;
--accent-text: #ffffff;
--warn-bg: #fff4e5;
--warn-border: #f0c48a;
--error: #b3261e;
color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
:root {
--bg: #16161a;
--surface: #1f1f24;
--border: #33333a;
--text: #ececf1;
--muted: #9a9aa6;
--warn-bg: #2e2415;
--warn-border: #6b5220;
--error: #f2b8b5;
}
}
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
background: var(--bg);
color: var(--text);
line-height: 1.5;
}
.app__bar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
padding: 0.75rem 1.25rem;
background: var(--surface);
border-bottom: 1px solid var(--border);
}
.app__brand {
font-weight: 600;
}
.app__account {
display: flex;
align-items: center;
gap: 0.75rem;
font-size: 0.9rem;
}
.app__email {
color: var(--muted);
}
.app__main {
max-width: 32rem;
margin: 2.5rem auto;
padding: 0 1.25rem;
}
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
padding: 1.75rem;
}
h1 {
margin: 0 0 0.75rem;
font-size: 1.4rem;
}
.muted {
color: var(--muted);
font-size: 0.95rem;
}
.notice {
margin: 1rem 0;
padding: 0.75rem 1rem;
background: var(--warn-bg);
border: 1px solid var(--warn-border);
border-radius: 8px;
font-size: 0.9rem;
}
.badge {
padding: 0.1rem 0.45rem;
border-radius: 999px;
font-size: 0.75rem;
border: 1px solid var(--warn-border);
background: var(--warn-bg);
}
.facts {
margin: 1.25rem 0 0;
display: grid;
gap: 0.75rem;
}
.facts div {
display: flex;
justify-content: space-between;
gap: 1rem;
border-top: 1px solid var(--border);
padding-top: 0.6rem;
}
.facts dt {
color: var(--muted);
}
.facts dd {
margin: 0;
text-align: right;
word-break: break-all;
}
.form {
display: grid;
gap: 1rem;
margin: 1.25rem 0;
}
.form label {
display: grid;
gap: 0.3rem;
font-size: 0.9rem;
}
.form input {
padding: 0.55rem 0.7rem;
border: 1px solid var(--border);
border-radius: 8px;
background: var(--bg);
color: var(--text);
font-size: 1rem;
}
button[type="submit"] {
padding: 0.6rem 1rem;
border: none;
border-radius: 8px;
background: var(--accent);
color: var(--accent-text);
font-size: 1rem;
cursor: pointer;
}
button[type="submit"]:disabled {
opacity: 0.6;
cursor: progress;
}
.link {
border: none;
background: none;
color: var(--accent);
cursor: pointer;
font: inherit;
padding: 0;
}
a {
color: var(--accent);
}
.hint {
color: var(--muted);
}
.field-error,
.form-error {
color: var(--error);
font-size: 0.85rem;
}