UI: scaffold the web app - shell, themes, i18n, auth plumbing

React 19 + TypeScript + Vite + TanStack Query/Router in web/, built on the
dev machine and shipped as static files (SPEC section 6). Typechecks and
builds clean; the System page reads live /health through the Vite proxy,
which proves browser -> proxy -> FastAPI -> PostgreSQL end to end.

Themes: light, dark and blue (dark navy), as design tokens on data-theme.
An inline script applies the stored theme before first paint. No colour
literal lives outside tokens.css.

check-contrast.mjs asserts WCAG AA for every text/background pair in every
theme, with no dependencies. It failed on its first run and found three
--border-strong values below the 3:1 that WCAG 1.4.11 wants for interactive
boundaries; all three are fixed and 36 pairs now pass. Colour contrast is
the classic silently-regressing property, so it gets a test rather than a
promise.

i18n is hand-written and typed rather than react-i18next: en.ts defines the
key set, de.ts is typed against it, so a missing German string fails the
build instead of quietly showing English to a German user.

Authentication is built but NOT enforced, deliberately. /auth/session,
/auth/login and /auth/logout do not exist yet, so router.tsx does not wrap
routes in RequireAuth and a banner says so plainly. There is no development
bypass: a bypass that works is the kind of code that survives into
production, and an auth bypass that works is the worst possible bug.

Gallery and Devices render honest empty states rather than mock rows. Fake
data hides the layout problems real data exposes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Thomas KarnerandClaude Opus 5 committed 2026-09-21 01:17:07 +02:00
1 parent 5a098e44d8
commit 384b09371a
28 files changed
+3968 -1

No files matched your search

+74
View File
@@ -0,0 +1,74 @@
import type { Catalogue } from "./en";
/* Typed as Catalogue, so a missing or misspelled key fails `npm run build`.
* That is the whole reason this file is hand-written rather than loaded as
* JSON at runtime: a missing German string should never reach a browser. */
export const de: Catalogue = {
"app.name": "poorBird",
"app.tagline": "Gartenvogel-Kamera",
"nav.gallery": "Galerie",
"nav.devices": "Geräte",
"nav.system": "System",
"common.loading": "Wird geladen…",
"common.retry": "Erneut versuchen",
"common.error": "Etwas ist schiefgelaufen",
"common.notMeasured": "—",
"common.yes": "Ja",
"common.no": "Nein",
"theme.label": "Design",
"theme.light": "Hell",
"theme.dark": "Dunkel",
"theme.blue": "Blau",
"lang.label": "Sprache",
"lang.en": "Englisch",
"lang.de": "Deutsch",
"auth.notEnforced":
"Die Anmeldung ist noch nicht aktiv — die Auth-Endpunkte kommen in Phase 3.",
"auth.signIn": "Anmelden",
"auth.username": "Benutzername",
"auth.password": "Passwort",
"auth.totp": "Bestätigungscode",
"auth.totpHint": "Sechs Ziffern aus deiner Authenticator-App",
"auth.signingIn": "Anmeldung läuft…",
"auth.failed": "Anmeldung fehlgeschlagen. Benutzername und Passwort prüfen.",
"auth.unavailable":
"Den Anmelde-Endpunkt gibt es noch nicht. Diese Seite ist die Hülle dafür.",
"gallery.title": "Galerie",
"gallery.empty.title": "Noch keine Aufnahmen",
"gallery.empty.body":
"Die Kamera hat noch nichts hochgeladen. Der Upload kommt in Phase 2; bis dahin bleibt diese Liste leer.",
"devices.title": "Geräte",
"devices.empty.title": "Keine Geräte registriert",
"devices.empty.body":
"Eine Kamera erscheint hier, sobald sie sich registriert hat. Das kommt in Phase 2.",
"system.title": "System",
"system.status": "Status",
"system.status.ok": "In Ordnung",
"system.status.degraded": "Eingeschränkt",
"system.version": "Version",
"system.uptime": "Laufzeit",
"system.database": "Datenbank",
"system.database.ok": "Verbunden",
"system.database.down": "Nicht erreichbar",
"system.devices": "Geräte",
"system.captures": "Aufnahmen",
"system.lastBackup": "Letzte Sicherung",
"system.lastBackup.never": "Nie",
"system.disk": "Bildspeicher",
"system.disk.free": "{free} frei von {total}",
"system.disk.unavailable": "Pfad nicht verfügbar",
"system.enrollSecret": "Registrierungs-Secret",
"system.enrollSecret.set": "Konfiguriert",
"system.enrollSecret.unset": "Nicht gesetzt",
"system.unreachable.title": "Server nicht erreichbar",
"system.unreachable.body":
"Die API hat nicht geantwortet. Läuft sie auf Port 8090?",
};