Commit graph

43 commits

Author SHA1 Message Date
d8f8b7e194
Modelle: Bilder per Higgsfield-KI erzeugen und uebernehmen
System > KI-Modellbilder: API-Key, Modell-Endpunkt, Prompt mit Platzhaltern,
Referenzbild und Zusatzparameter. Im Modell-Panel 'Bild erzeugen' (auch bei
vorhandenem Bild), Ergebnis anklicken = wird direkt Modellbild. Verbindungstest
um Higgsfield erweitert.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ex4YsMRQ4GF2dkGWuX6Yio
2026-10-23 16:23:12 +00:00
1892fe5942
Pakete: einzelne Pakete kopieren, auch ins selbe Modell
Neben "Von anderem Modell kopieren" (alle Pakete) lassen sich jetzt einzelne
Pakete kopieren: "Kopieren" im Paket-Panel, in der Auswahl (Nach Modell) und
in der Liste "Alle Pakete". Ein einzelnes Paket kann dabei als andere Stufe
landen (z. B. Drive als Grundlage fuer Prime im selben Modell). Gibt es die
Stufe im Ziel schon: ersetzen oder ueberspringen.

API: POST /packages/copy {items [{id, name?, sort_order?}], target_model_id,
include_upgrades, replace_existing}; copyPackages nutzt dieselbe
Kopierfunktion (copyOne).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H18w9G2ZdEdGJ3E3goxdQE
2026-10-23 16:19:46 +00:00
7cf8ef52b3
Login: Wahl zwischen App und Mail-Code, Passwort vergessen
- Mit Authenticator-App und bestaetigter E-Mail laesst sich auf der
  Code-Seite zwischen beiden umschalten (POST /auth/2fa-method).
- "Passwort vergessen" auf der Login-Seite: Link an die bestaetigte E-Mail
  (60 Min, einmalig, hoechstens einer pro Minute), Seite
  /admin/passwort-zuruecksetzen. Antwort verraet nicht, ob es das Konto gibt.
- Neue Spalten password_reset_hash/_expires_at (Auto-Migration). Build neu.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W444hnfrfEXf9f84YRuZtH
2026-10-23 00:26:22 +00:00
eb9b1f60ea
Merge branch 'besucher-statistik' in main
Admin-Seite "Besucher" (/admin/traffic) mit GA4-Trends und Live-Karte.
Build-Output neu erzeugt.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019SDNFmggXYzftrfZ6epwP5
2026-10-22 23:17:18 +00:00
2897eb4ff8
Benutzerkonten: E-Mail mit Bestaetigungslink, Login-Code per Mail
- Konten bekommen eine E-Mail-Adresse (Mein Konto und Benutzerverwaltung).
  Neue Adressen gelten erst nach Klick auf den Bestaetigungslink
  (/admin/email-bestaetigen, 48 h gueltig, Token nur als SHA-256 gespeichert).
- Login: mit Authenticator-App wie bisher TOTP; sonst bei bestaetigter
  E-Mail ein 6-stelliger Code per Mail (10 Min, 5 Versuche, neu senden
  nach 30 s). Konten ohne beides und Server ohne eingerichteten Mailversand
  melden sich weiter nur mit Passwort an.
- Versand ueber die SMTP-Einstellungen des Kontaktformulars (Mailer).
- Neue Spalten in Schema.php (Auto-Migration) und schema.sql, Export der
  Konten um email/email_verified_at ergaenzt. Build neu.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W444hnfrfEXf9f84YRuZtH
2026-10-22 22:01:46 +00:00
6bde1b0205
Besucher: eigene Live-Karte mit Seitenliste und Minutenverlauf
Die Echtzeit-Besucher stehen jetzt in einer eigenen Karte: Anzahl, Balken je
Minute der letzten 30 Minuten, Geräte und eine Liste der gerade angesehenen
Seiten (bis 10, mit Balken, ohne "| HifiPlanet"-Anhang). Die Karte holt sich
über GET /analytics/realtime jede Minute neue Werte (nur bei sichtbarem Tab).
Build neu.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TFDXmUdWg4Ai8x5ehhJvva
2026-10-22 09:57:55 +00:00
d31b72c01f
Admin: eigene Seite "Besucher" mit Trends aus Google Analytics
Neue Seite /admin/traffic (Seitenleiste unter Übersicht, Recht system.admin) mit
Zeitraum 7/28/90 Tage bzw. 12 Monate: Echtzeit-Besucher, sechs Kennzahlen mit
Vergleich zum Vorzeitraum, Verlaufsdiagramm (aktuell gegen davor), Kanäle,
Quellen, Seiten, Einstiegsseiten, eigene Events, Geräte und Orte.

API GET /analytics/traffic (batchRunReports + runRealtimeReport), Ergebnis
5 Minuten im Temp-Ordner zwischengespeichert (?refresh=1 umgeht das).
Dashboard-Widget verlinkt auf die neue Seite. Build neu.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TFDXmUdWg4Ai8x5ehhJvva
2026-10-22 09:31:25 +00:00
42586fa393
Pakete gesammelt löschen und beim Kopieren ersetzen
- Pakete > Nach Modell: "Auswählen" markiert mehrere Stufen (oder alle) und löscht sie auf einmal
- Pakete > Alle Pakete: Haken je Zeile, "Alle" bezieht sich auf das Suchergebnis
- Von anderem Modell kopieren: hat das Ziel schon Pakete, wahlweise alle ersetzen
  (Vorgabe) oder nur fehlende ergänzen
- API: POST /packages/delete {ids}, copy-packages mit replace_existing
- ui: Checkbox-Baustein, Icon check

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017yqbrkqFsLrgVr6QMrvEZz
2026-10-21 06:49:22 +00:00
296c196d06
Bilder im Admin austauschbar: Link-Vorschau, Einblicke, Startseite, Hintergruende, Paketkacheln
Neue Seite Einstellungen > Bilder (Titelbild und Logos dorthin verschoben) plus
"Bild tauschen" im Live-Bearbeiten-Modus. Gespeichert als JSON in
app_settings.site_images (Auto-Migration). Startseite und SPA-Fallback laufen
ueber api/public/page.php, das og:image und Favicon serverseitig ins HTML setzt.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBCD1KUwiqh1kdMwDSwVfD
2026-10-20 16:12:15 +00:00
be14d274a3
Verbindungstest im Admin: Google, Mail, Datenbank, Update-Server und Audio4Cars per Knopfdruck pruefen
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UKLyiTjbcqPzxHApMQVFh7
2026-10-20 15:49:04 +00:00
Claude
6523206d22
Fahrzeug-Vorlage: neue Marken/Modelle bekommen die Standard-Schrift
Import uebernimmt die haeufigste Schrift-Einstellung (text_styles) der vorhandenen
Marken- und Modellnamen fuer alle Eintraege ohne eigene Einstellung. Im Vorlagen-Fenster
gleicht 'Jetzt angleichen' frueher importierte Eintraege an (POST /vehicle-catalog/align-styles).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019bUXMMTn84UnoT7ps5aXCs
2026-10-20 14:45:03 +00:00
Claude
00c67cd860
Fahrzeug-Vorlage: 64 Marken mit 1.559 Modellgenerationen aus Europa im Admin ladbar
Marken/Modelle > 'Aus Vorlage laden' zeigt den Katalog (api/data/vehicle-catalog.json)
zum Anhaken; angelegt wird nur, was noch fehlt (Abgleich ueber Slug und Name).
Slug::make wandelt jetzt Akzente um (Škoda -> skoda statt koda).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019bUXMMTn84UnoT7ps5aXCs
2026-10-20 13:54:31 +00:00
Claude
9a09e7e48f
Direktsuche nach Fahrzeug auf der Fahrzeug-Uebersicht
Suchfeld ueber den Marken-Kacheln: findet Marken und Modelle beim Tippen
(z. B. "golf 7", "vw golf", "bmw 3er"), Pfeiltasten + Enter, Link zum
Kontakt ohne Treffer. Neuer oeffentlicher Endpunkt GET /vehicle-search.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0174bfXbDqAn2M7TjkdqGCrn
2026-10-20 13:24:14 +00:00
Claude
34d78018dd
Updates automatisch installieren (im Admin pro Server einschaltbar)
Prueft den gewaehlten Branch im eingestellten Abstand und installiert neue Staende mit
demselben Ablauf inkl. Backup wie der Button. Ausgeloest nebenbei nach Seitenaufrufen
(fastcgi_finish_request), per Cronjob-URL mit Token oder per CLI-Skript.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W3jkhrvgibG4v3tQyUMGsu
2026-10-20 12:56:08 +00:00
Claude
51c5e6e1c1
Launch-Countdown: Teaser vor dem Start, im Dashboard einstellbar
Unter Einstellungen > Launch-Countdown lassen sich Startzeitpunkt (deutsche Zeit),
An/Aus und optionale Texte (DE/EN) pflegen. Solange der Countdown laeuft, sehen
Besucher nur die Teaser-Seite; eingeloggte Admins sehen die normale Seite mit
Hinweisleiste und koennen den Teaser unter /?countdown=vorschau ansehen. Bei 0
oeffnet sich die Website automatisch. Neue Spalten in app_settings werden per
Auto-Migration nachgeruestet.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KSYBhvKhm4di3v331BkNjL
2026-10-20 12:27:32 +00:00
ad3d1b081d
Live-Bearbeiten-Modus: Texte direkt auf der Website ändern
Eingeloggte Admins schalten über den Stift in der Navbar (oder "Website live
bearbeiten" im Dashboard) einen Bearbeiten-Modus ein und ändern Texte direkt
auf der Seite. Gesammelte Änderungen gehen mit "Speichern" an PUT /live-edit,
das jede Änderung gegen Feld-Whitelist und Berechtigung prüft und alles in
einer Transaktion schreibt.

- Startseite: Vorspann, Überschriften, Texte, Buttons inkl. Ziel, FAQ, Partner
- Leistungen, Paketkacheln (Name, Preistext, Stichpunkte), Marken, Modelle,
  Galerie-Marken/-Projekte, Impressum/Datenschutz/AGB
- Feste Texte (Buttons, Menü, Beschriftungen) je Seite über eine Liste,
  gespeichert in der neuen Tabelle text_overrides (Auto-Migration)
- Bearbeitet wird jeweils die gerade angezeigte Sprache
- .schema-version wird nicht mehr versioniert und vom Self-Update geschont

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Dgc8etkq7JkjyZgD2DEbv
2026-10-19 22:31:25 +00:00
d587fc177d
Merge branch 'main' into optimierungen
# Conflicts:
#	hifi/assets/AccountSettings-3Az7PIEf.js
#	hifi/assets/AccountSettings-C7P_TaTL.js
#	hifi/assets/AccountSettings-CfY49TlQ.js
#	hifi/assets/AdminUsers-C1zi3a_m.js
#	hifi/assets/Brands-V9s4vz2i.js
#	hifi/assets/ContactRequests-BcF_HxL3.js
#	hifi/assets/Dashboard-m6lX2kWI.js
#	hifi/assets/DatabaseSettings-pQejbEjR.js
#	hifi/assets/Downloads-DCZm2dP9.js
#	hifi/assets/EmailSettings-B_RqPmc9.js
#	hifi/assets/EmailSettings-DixrL0D8.js
#	hifi/assets/EmailSettings-VadOa5J3.js
#	hifi/assets/ExportImportSettings-Bkwm__tE.js
#	hifi/assets/Faqs-CDIDxeRo.js
#	hifi/assets/GalleryBrands-CeGo7QXi.js
#	hifi/assets/GalleryPhotos-NPKQDZMi.js
#	hifi/assets/GalleryProjects-CfB-fA4x.js
#	hifi/assets/HomeSections-BzNKNMho.js
#	hifi/assets/ImageUploadField-B8P2oQZ9.js
#	hifi/assets/ImageUploadField-DyLcJG5-.js
#	hifi/assets/ImageUploadField-oqjVVSSG.js
#	hifi/assets/LegalSettings-BnY85Lz7.js
#	hifi/assets/LegalSettings-CRgpL0dP.js
#	hifi/assets/LegalSettings-DGN-Kl_a.js
#	hifi/assets/Login-CFL8bhtC.js
#	hifi/assets/Login-Dc1nFqtx.js
#	hifi/assets/Login-pbnF9xt-.js
#	hifi/assets/MaintenanceSettings-CFGyPBuq.js
#	hifi/assets/MaintenanceSettings-DhcTJBUJ.js
#	hifi/assets/MaintenanceSettings-DsGBefLo.js
#	hifi/assets/Models-CyjYxQOO.js
#	hifi/assets/Packages-6JjKaOj1.js
#	hifi/assets/Partners-BRwobp6H.js
#	hifi/assets/PermissionGroups-CW64DGq9.js
#	hifi/assets/PermissionGroups-DI5xJ6TD.js
#	hifi/assets/PermissionGroups-_i9KMBTo.js
#	hifi/assets/ResetSettings-Bm64tgsK.js
#	hifi/assets/RichTextEditor-DJwdsoJ6.js
#	hifi/assets/RichTextEditor-DTscIhNf.js
#	hifi/assets/RichTextEditor-DcSNZ4jD.js
#	hifi/assets/Services-BTvu0ymy.js
#	hifi/assets/SettingsLayout-C5JQlIqD.js
#	hifi/assets/SetupWizard-BHY_FJd_.js
#	hifi/assets/SetupWizard-Cu-s4Wuc.js
#	hifi/assets/SetupWizard-DcHkEIZ7.js
#	hifi/assets/TextStyleWidget-BZdrb1Dr.js
#	hifi/assets/TextStyleWidget-CkwixV2h.js
#	hifi/assets/TextStyleWidget-Czb7ujSZ.js
#	hifi/assets/UpdateSettings-Ce5oqncR.js
#	hifi/assets/WebsiteSettings-B7CzBT2R.js
#	hifi/assets/eye-CZFeBsZS.js
#	hifi/assets/eye-YlN_9rkm.js
#	hifi/assets/eye-jJN30JHV.js
#	hifi/assets/iconRegistry-BJRytynd.js
#	hifi/assets/iconRegistry-C8CVLtUq.js
#	hifi/assets/iconRegistry-DUWamfSa.js
#	hifi/assets/index-QV-Szw5n.js
#	hifi/assets/trash-2-CQGOvKRj.js
#	hifi/assets/trash-2-CwY7wd8m.js
#	hifi/assets/trash-2-fu7u5OTF.js
#	hifi/index.html
2026-10-19 21:53:32 +00:00
de91ab0926
Self-Update: Branch im Admin auswählbar, um zwischen Branches zu wechseln
Unter Einstellungen > Updates lässt sich jetzt der Branch wählen, von dem
installiert wird (Standard main). So kann z.B. ein Test-Branch eingespielt
und danach wieder auf main zurückgewechselt werden - jeweils mit Backup.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Dgc8etkq7JkjyZgD2DEbv
2026-10-19 21:53:13 +00:00
b915972a12
Optimierungspaket: Kontaktformular, Admin-Komfort, Rechte, Übersetzungen
- Kontaktformular mit Spam-Schutz (Honeypot, Mindestzeit, Rate-Limit), klarer
  Bestätigung, Paketpreis vom Server, WhatsApp mit vorbereitetem Text
- Preis-Hinweis unter Paketpreisen, eigene 404-Seite, verständliche Fehler
- Admin: Toasts, Speicherleiste, Warnung bei ungespeicherten Änderungen,
  Re-Login bei abgelaufener Sitzung, Sortieren per Drag & Drop
- Neues Recht system.admin für DB, Mail, Google, Export/Import, Reset
- Englische Texte für Leistungen/Pakete/Upgrades (content_translations)
- Automatische Schema-Migration beim ersten Aufruf nach git pull
- Build in hifi/ neu erzeugt

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Dgc8etkq7JkjyZgD2DEbv
2026-10-19 21:39:01 +00:00
Maaxxs
4fd3c7a035 Let admins hide whole site areas (pages and home sections) from the dashboard
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 21:16:34 +02:00
Maaxxs
29f15d0133 Package editor: products, upgrades and prices for a model on one page
Tested locally on a separate branch before merging.

- Selected model (and package to open) live in the URL (?model=…&paket=…),
  so going back or reloading returns to the same vehicle.
- Packages are compact rows (price, product/upgrade count, badge,
  visibility); a click expands one package with its texts on the left and
  markup, live price calculation, products and upgrades on the right.
- Products and upgrades are edited inline and saved immediately. Several
  audio4cars links can be pasted at once, and products/upgrades are
  reordered by drag & drop (@dnd-kit). The separate product/upgrade pages
  are gone; old links redirect to the package in the editor.
- New GET /models/{id}/package-items loads all products and upgrades of a
  model in one request.
- "Pakete kopieren" can include upgrades (include_upgrades).

No database changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 23:48:57 +02:00
Maaxxs
54928d1411 Add package badges/visibility and a download area, speed up the site
Customer feedback round (4 items):

- Packages: one-click "Sichtbar/Ausgeblendet" toggle per package (saved
  immediately). Hidden packages disappear from the model page; the tier
  look of the remaining cards is ranked across all packages so it stays
  stable.
- Packages: badge per card (Empfohlen, Am beliebtesten, Tipp, Coming soon
  or custom text) plus an optional video link shown as "Zum Video". Legacy
  is_featured maps to "Empfohlen".
- New download area (/downloads + Admin -> Downloads): upload with
  progress, inline audio player, allow-listed file types, optional access
  password, new permission downloads.manage. Files live in
  api/uploads/downloads/ (gitignored, created at runtime).
- Performance:
  - SetupGate no longer refetches and remounts the whole app on every
    navigation.
  - Page loader waits only for pending API calls and above-the-fold images
    (fixes an 8 s hang on /leistungen caused by lazy images inside the
    hidden container).
  - Admin pages lazy-loaded; icon library moved out of the main bundle
    (initial JS 2.2 MB -> 0.48 MB).
  - Background video loads only near the viewport and was re-encoded to
    720p (32 MB -> 8.5 MB).
  - Visitors without a session cookie get no PHP session, so their parallel
    API requests no longer queue on the session lock.
  - index.html is served with Cache-Control: no-cache so browsers don't
    keep a stale build after deploys.
- Fonts (Barlow, Barlow Condensed, Michroma) are self-hosted instead of
  loaded from Google Fonts; the default privacy policy mentions this, lists
  all local storage uses and uses the new TDDDG name.
- A code update that adds a table no longer sends the site into the setup
  wizard while an admin exists.

Run "Datenbankstruktur aktualisieren" after deploying (new package
columns, downloads table, app_settings.downloads_password).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 23:15:48 +02:00
Maaxxs
a9ae0d310a Show whether image compression is actually active on this server
There was no way to tell whether the gd extension the compression
feature depends on was actually enabled - the button always looked the
same and silently did nothing per file if gd was missing. Adds a status
badge (Aktiv/Nicht verfügbar) next to "Bilder optimieren", backed by a
new GET /settings/compress-status endpoint, and disables the button with
an explanatory note when gd isn't available: shared hosts like All-Inkl
don't offer a way to toggle individual PHP extensions (unlike a VPS), so
the note points at hoster support / PHP version selection rather than a
nonexistent self-service toggle.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-11 11:36:35 +02:00
Maaxxs
31d8143500 Compress uploaded images automatically to speed up page loads
Photos were being served exactly as uploaded, at whatever resolution and
quality the source file had - a multi-megabyte camera/phone photo shown
in a small tile still cost the visitor its full download weight.

Uploads::compressImage() (new) downscales an image to a 1920px long edge
if it's larger, and re-encodes it (JPEG quality 82, WEBP quality 82, PNG
best compression) in place - same path, same format, just a lighter
file. UploadController::store() now runs every new upload through it
automatically, so this fixes itself going forward with no admin action
needed.

For images already sitting in uploads/ from before this change,
SettingsController::compressUploads() (new endpoint, Einstellungen ->
Datenbank -> "Bilder optimieren") re-processes every existing file in
place and reports how much space was reclaimed - covers exactly the
photos causing today's slow loads.

Uses GD (near-universally available on shared hosting, unlike Imagick)
and does nothing instead of erroring if the extension or an unrecognized
file type is encountered, so an environment without GD just keeps
today's behavior rather than breaking uploads.

Verified locally (GD wasn't enabled in this XAMPP install, enabled it to
test - same php.ini already had zip enabled for the git-updater feature):
a synthetic 3000x2000 JPEG dropped from ~1.86MB to ~279KB and a test PNG's
alpha transparency survived resizing intact. Did not run the bulk
compressor against this repo's own uploads/ folder, since ~200 of those
files are git-tracked seed/demo images, not disposable local test data.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-11 03:23:31 +02:00
Maaxxs
326d124a60 Let admins upload their own custom fonts
Adds a new custom_fonts table (name, a server-generated collision-free
font_family identifier, file_path) with its own upload endpoint
(CustomFontController) separate from the generic image-only /uploads,
since it needs to accept WOFF2/WOFF/TTF/OTF instead. New management UI in
WebsiteSettings.jsx ("Eigene Schriftarten"): upload with a display name,
list with delete.

CustomFontsContext.jsx fetches the list once per layout (PublicLayout.jsx
for visitors, AdminLayout.jsx for the dashboard) and exposes it two ways:
useFontOptionsWithCustom() appends the uploaded fonts to the existing
static FONT_OPTIONS list for every font picker (RichTextEditor,
TextStyleWidget, the per-section and global site-font dropdowns), and a
new CustomFontFaces.jsx component renders the @font-face rules that
actually make an uploaded font usable - without it, picking a custom font
would just reference a name the browser has no file for. refresh() lets
WebsiteSettings.jsx update every picker immediately after an
upload/delete, not just on next page load.

Fonts::isValid() replaces the three places that validated a font_family
value against the fixed Fonts::VALUES list (site-wide default, per-section
override, per-field text style) - it now also accepts any uploaded
font's generated identifier, so those endpoints don't reject a custom
font as an unknown value.

Verified locally end-to-end: migration creates the table, a simulated
upload's font_family passes validation while a nonexistent one doesn't,
index() returns the expected shape, and destroy() removes both the row
and the file from uploads/.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-10 03:28:57 +02:00
Maaxxs
260cd0700e Add generic per-field text styling (font/size/color), starting with home sections
Adds a new text_styles table keyed by field_key ("{table}.{slugOrId}.{column}")
so any individual text field anywhere in the dashboard can get its own
font-family/font-size/color override, without a dedicated column per field.
App\Support\TextStyleFields is a server-side registry of which table/column/
permission combinations are valid, so TextStyleController::update() can't be
used to write styling for a field outside the caller's own permission domain,
and typos can't create permanently orphaned rows. Resetting all three values
deletes the row entirely rather than leaving it null, so the table only ever
holds fields an admin actually customized.

Font-size reuses the same "curated list, mirrored PHP+JS constant" approach
already used for font-family (App\Support\Fonts / fontOptions.js) - a free px
input on dozens of independently-edited fields with no design review step is
the most likely way to end up with an accidentally 4px or 400px heading.

New reusable pieces: TextStyleWidget.jsx (a self-contained font/size/color
toolbar with a live preview, used next to any field by passing its
field_key) and TextStylesContext.jsx + useTextStyle() hook (bulk-fetches all
styles once per page load in PublicLayout.jsx, same pattern as
SiteSettingsContext). This first phase wires both into the home-section
eyebrow/title/button-label fields (the ones from the screenshot that started
this) as a proven pilot; the registry is designed so extending it to the
remaining ~15 admin pages is just adding entries and wiring the widget/hook,
no new architecture.

Verified locally via direct PHP invocation: migration creates the table,
registry validation accepts only known table/slug-or-id/column
combinations and rejects the rest, upsert/reset round-trips correctly, and
a second migration run doesn't re-touch anything.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-10 02:59:06 +02:00
Maaxxs
040a00a0d7 Add Partner management to replace the hardcoded homepage brand strip
The "Partner" logo row on the homepage was a hard-coded array of ten audio
brand names in Home.jsx, not editable through the dashboard. Adds a
partners table (name, optional logo, sort order), a PartnerController
CRUD under the existing content.manage permission (same one already used
for FAQ-style homepage content), and an admin page modeled on Brands.jsx.
Home.jsx now fetches /partners and shows each entry's logo if set, falling
back to the name as text otherwise.

Schema migration now supports one-time seed data (Schema::SEED_DATA,
applied by SchemaController::runMigration() only at the moment a table is
first created, never again afterwards) so that clicking "Datenbankstruktur
aktualisieren" on an existing site populates the new partners table with
the previous ten names instead of leaving the homepage strip empty.
Verified locally: first migration run creates + seeds the table, a second
run neither re-seeds nor errors.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-10 00:05:44 +02:00
Maaxxs
ba4fa986d3 Make the homepage's main marketing text blocks editable
Extends the CMS work (Phase 5) to the content the user pointed out was
still missing, using the YouTube section as the concrete example: text,
alignment, and the button link weren't editable anywhere. Rather than
patch that one section, this builds the reusable pattern the user asked
for and applies it to every comparable text block on the homepage:
hero (text only, its two nav buttons stay fixed), the YouTube section,
the craft and consultation blocks, the gallery intro, and the "more
than car-hifi" block.

New home_sections table (bilingual DE/EN, like faqs, since the site has
a language switcher) + HomeSectionController, following the same
DB-row-with-built-in-defaults pattern as legal_pages: a section not yet
customized returns the exact text that used to be hard-coded in the
i18n dictionary, so nothing on a live site goes blank. New "Startseite"
admin page (content.manage, alongside FAQ) with per-section DE/EN tabs,
reusing the Phase 4 RichTextEditor for the body text and a plain
alignment dropdown. Wired into export/import (Settings -> Export &
Import) alongside the other content sections.

Alignment is applied via fixed left/center/right class lookup tables in
Home.jsx rather than a template-string class name, since Tailwind's
build-time scanner needs literal class names present in the source to
avoid purging them from the production CSS.

Known trade-off: two sections (hero, "more than car-hifi") previously
had hand-tuned responsive alignment that differed by breakpoint
(e.g. centered on mobile, left-aligned on desktop for "more"). Making
alignment a single admin-editable value necessarily replaces that with
one fixed choice at every breakpoint - simpler to reason about and
control, at the cost of that responsive nuance.

Verified end-to-end against the local database directly via PHP CLI
(bypassing a local Apache path-routing quirk unrelated to this change):
confirmed defaults come back correctly before any row exists, and that
saving and reading back a row round-trips correctly - then removed the
test row before finishing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-09 02:51:00 +02:00
Maaxxs
3ea5bd4201 Add one-click git-based auto-update (manual trigger only)
Phase 6 of the dashboard roadmap - the largest and riskiest item, since
it overwrites live production code. Pulls the current main branch from
the public Gitea repo over plain HTTPS (archive zip download + REST API
for commit info) and applies it to the live hifi/ tree - no SSH,
git binary, exec(), or shell_exec() anywhere, so it works on plain
shared PHP hosting with no CI/deploy pipeline (exactly the hosting this
site actually runs on, per DEPLOY.md's manual-FTP fallback).

Six independent endpoints (status/check/download/extract/backup/apply)
instead of one big request, mirroring the existing multi-step
SetupController pattern - this app has no job-queue infrastructure, and
a single ~127MB download+extract+backup+copy is the most likely way to
hit an unknown host's max_execution_time or reverse-proxy timeout.
GitUpdateService.php does the actual work; UpdateController.php is a
thin adapter that marks each step in-progress/failed in a new gitignored
update-state.php (same convention as db.php) so a crashed step shows as
failed rather than stuck, and a retry starts clean.

Security-critical bits:
- The backup zip necessarily contains db.php (must be fully restorable),
  so it lives under hifi/_update/ behind a "Require all denied" .htaccess
  written the instant the directory is created, and hifi/_update/ was
  added to .gitignore in this same commit, before any code that could
  write into it - both needed since a physically-existing file bypasses
  this app's SPA-fallback/API rewrite rules entirely.
- Only hifi/'s own subtree is extracted from the archive (hifi-src/ and
  everything else ignored) via a wrapper-folder-prefix detected at
  runtime, not hardcoded.
- Copy-then-prune (not copy-only) across the whole hifi/ tree, since
  Vite renames JS/CSS chunks on every build and a copy-only updater
  would let stale chunks accumulate forever - guarded by a denylist
  (db.php, setup.php, ga-service-account.json, update-state.php,
  api/uploads/, plus local Claude-tooling dirs) that must never be
  touched in either direction.
- index.html is swapped in last via copy+rename (near-atomic), after
  the new hashed assets it references are already fully in place.
- Reuses SchemaController's existing migration logic as the last apply
  step (extracted into a new runMigration() so it's callable without
  Http::send()/exit ending the response early) and app_settings'
  existing maintenance-mode column to show visitors a maintenance page
  during the brief apply window, restoring whatever maintenance state
  existed before the update ran (not just forcing it off).

Gated behind a new, narrower system.update permission (not the broader
settings.manage), with its own settings tab hidden from anyone lacking
it - unlike this app's usual "everyone with settings.manage sees every
tab" pattern, since this one can overwrite the whole site.

Verified in isolation (synthetic zip + fixture directories in a scratch
folder, not the real hifi/ tree): wrapper-folder detection and
selective hifi/-subtree extraction, and copy+prune with denylist
enforcement. Not yet verified: behavior on an actual shared-hosting
target (max_execution_time, ZipArchive availability, outbound HTTPS
egress, disk quota vs disk_free_space()) - per the plan, validate
against the Plesk test server from DEPLOY.md before ever running this
against a real client site. Also enabled the php_zip extension in the
local XAMPP php.ini, since it was disabled and this feature needs it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-09 02:16:41 +02:00
Maaxxs
5f1d4e1092 Add CMS v1: editable business identity and legal pages
Phase 5 of the dashboard roadmap. Business-facing data that was
previously hard-coded (and, for address/hours, duplicated three
independent ways across Footer.jsx, ContactPage.jsx, and the i18n
strings) is now stored in app_settings and editable under Website
settings: logo (light/dark variants, falling back to the bundled
defaults until set), street/zip/city, and a day-by-day business_hours
editor. Footer.jsx and ContactPage.jsx now share one open/closed and
hours-formatting implementation (new utils/businessHours.js) instead
of three separate hard-coded representations of the same thing.

New legal_pages table (impressum/datenschutz/agb) + PageContentController
replaces the three fully hard-coded React pages with fetched, admin-
editable HTML - built-in defaults matching the original page content
kick in until an admin saves anything, so a fresh install isn't blank.
Reuses the Phase 4 RichTextEditor (extended with a heading toggle and
inline-code toggle, since the legal text needs both) via a new
"Rechtstexte" tab in Settings. Legal content lives only in DB and is
authored exclusively by logged-in admins, so dangerouslySetInnerHTML
here doesn't take untrusted input.

IMAGE_COLUMNS in SettingsController (export/import) is now table =>
array of columns instead of table => one column, since app_settings
has three image columns (hero/logo/logo_dark) - this also retroactively
fixes hero_image_path never having been wired into export/import at
all. app_settings and legal_pages both got TABLE_COLUMNS/IMPORT_SECTIONS
entries so they round-trip through a hoster-migration export like
everything else.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-09 02:03:59 +02:00
Maaxxs
bbaf018a0e Add live Google Reviews, refreshed daily instead of hand-typed testimonials
The homepage's "reviews" section was never real - a fixed array of 10
hand-written quotes in the translation files plus a manually-typed
"5,0 von 181 Kunden bewertet" string, none of it sourced from Google.

Wires it to the real thing via the Places API (New), cached in the
database and refreshed on a schedule rather than fetched live per
visitor - the public /google-reviews endpoint only ever reads the last
successfully cached result, so page traffic never touches Google's API
or its quota. Mirrors the existing audio4cars price-refresh cron exactly
(same bootstrap-config-fetch-store shape): refresh_google_reviews.php
reads the Place ID + API key from app_settings, calls
GooglePlacesReviewsFetcher, and replaces the google_reviews table
wholesale on success; refresh_google_reviews.bat is the Task Scheduler
entrypoint. A failed refresh leaves the previous good data in place and
only records the error message, so a bad night never blanks the section.

Admin config lives in a new "Google-Rezensionen" block on the Website
settings page (Place ID + API key, matching the existing GA
service-account field's "leave blank to keep" behavior for the key) plus
a "Jetzt aktualisieren" button to test immediately rather than wait for
the nightly job - both hit the same GoogleReviewsController the cron
script's service class does.

Home.jsx now fetches /google-reviews and swaps in the live rating and
quotes only once at least one fetched review has actual text (Google
sometimes returns star-only reviews with no comment, which StarRating's
quote cards can't render) - until then, or if nothing is configured yet,
it falls back to exactly the previous hardcoded testimonials, so the
section never looks broken mid-rollout. TestimonialSlider/StarRating now
take a per-review rating instead of always drawing 5 stars.

Verified end-to-end except the live Google call itself, which needs a
real API key: schema migration, settings save/load (including the
key's "blank = unchanged" behavior), the CLI script's two failure paths
(unconfigured, and a real Google 400 for an invalid key - confirming the
Places API (New) request shape is correct), and the full display path by
seeding fake "successful" rows directly - homepage correctly switched to
the live rating/quotes and back to the fallback after clearing them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 01:40:08 +02:00
Maaxxs
a9aea99028 Fix data export/import: PHP's default upload limits rejected real exports
Root cause: the export embeds the whole gallery as base64 directly in the
JSON (that's how it stays a single self-contained file), which pushes a
realistic export well past 40MB. PHP's post_max_size/upload_max_filesize
default to values well under that on most hosting, so the browser's
upload got silently discarded before the app ever saw it - PHP clears
$_FILES and $_POST once post_max_size is exceeded, and the leftover raw
body in php://input is unparsed multipart data, not JSON, so it fell
into a generic "invalid file" 422 with no indication of what actually
went wrong. Reproduced locally with a real ~43MB export against the
previous 40M limit.

Raises the limits to 200M via two paths, since we don't know which PHP
SAPI the various hosting targets (All-Inkl, the Plesk test server) use:
hifi/.htaccess sets php_value overrides for classic Apache module PHP,
guarded by <IfModule> checks for several common module names so hosts
running PHP-FPM/CGI (which ignore php_value and would otherwise choke on
an unrecognized directive) skip the block instead of 500ing the entire
site; hifi/api/public/.user.ini covers exactly that FPM/CGI case, which
mod_php hosts in turn simply don't read.

Also makes SettingsController::importData() detect an oversized upload
by comparing Content-Length against the configured post_max_size, and
report the actual limit instead of the generic corrupt-file message -
so if some host's real limit is still too low, the admin sees why
instead of a dead end.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 00:54:34 +02:00
Maaxxs
34efe79658 Rebuild the admin package editor as a per-model batch workflow
Client feedback: creating ~30 models x 8 packages through the old
one-at-a-time form (free-text name, rows={3} description box) was
unworkable. Package names are always the same eight tiers, so the form
asked for information that was never variable.

The page is now a batch editor: pick brand + model, get the eight
standard tiers (Base, Clear, Drive, Prime, Elite R, Apex, The Statement,
Limitless - new shared constant in constants/packageTiers.js) as
checkbox rows. Checking a row opens a large auto-growing description
textarea and the markup fields; icon/tagline/price-text/featured/sort
live in a collapsed details block. One "Alle speichern" button creates
and updates everything in one pass, with per-row error reporting and
failed rows keeping their input. Existing packages load pre-filled;
packages with non-standard names appear in a read-only-named legacy
section, still editable and deletable. Deleting stays behind an explicit
button - unchecking never deletes. The old all-packages table remains
below as a collapsible overview, and its Bearbeiten action now jumps
into the batch editor.

New endpoint POST /models/{id}/copy-packages copies every package of a
source model - including linked package_products rows with their cached
scrape data, so no re-scraping - onto the target, skipping tiers whose
slug already exists there (backed by uniq_model_slug), all in one
transaction. The editor exposes it as "Pakete von anderem Modell
kopieren" with a copied/skipped result line: set up one model, replicate
to the other 29, adjust.

The public tier theming is intentionally untouched: ModelPage keeps
assigning card themes by price rank, so legacy package names continue to
render correctly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 17:02:54 +02:00
Maaxxs
6a127b70ce Populate the gallery with the full photo collection from the old hifi-planet.de site
Scraped all 13 brand categories, 29 vehicle projects, and 207 installation
photos from the legacy WordPress gallery, resized/compressed them, and added
them as seed images alongside a one-off "Galerie auf Standard zurücksetzen"
action (mirrors the existing services/FAQ reset buttons) that recreates the
full gallery structure with proper brand/project cover images.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-07 19:50:49 +02:00
Maaxxs
438131fad0 Move FAQ management into the admin panel and cover it plus the gallery in export/import
FAQ entries were previously hardcoded in the i18n dictionaries; they now live
in a new bilingual `faqs` table with full CRUD in the admin panel, a
reset-to-defaults action seeded with the current 6 questions, and the
homepage (incl. FAQPage JSON-LD) fetches them live per language. Export/
import was also extended to include FAQs and the full image gallery
(brands, projects, photos), which had been missing from that mechanism.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-07 19:25:06 +02:00
Maaxxs
24df7a602c Add Google Analytics dashboard widget (GA4 Data API integration)
New Dashboard section shows users/sessions/pageviews for the last 7
days plus top pages, fetched server-side via the GA4 Data API using a
Google service account (JWT-bearer flow, no OAuth consent screen
needed) - the same approach WordPress plugins like MonsterInsights use
to surface GA stats inline instead of linking out to analytics.google.com.

Backend: GoogleAnalyticsReporting support class (signs its own JWT with
openssl, exchanges it for an access token, calls runReport - no need
for the full Google API PHP client library for one endpoint) and
AnalyticsController (settings show/update, report fetch). The service
account JSON key is written to a gitignored config file, mirroring the
existing db.php/setup.php pattern for environment-specific secrets.

Admin: new "Dashboard-Anbindung" section in Website Settings (Property
ID + service account JSON paste, independent save action). Dashboard
gracefully shows a setup hint when not yet configured instead of an
error.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-07 01:57:32 +02:00
Maaxxs
0de35ef692 Add configurable SMTP email settings and contact-form email notifications
New admin panel "E-Mail" tab (Einstellungen -> E-Mail) lets the shop
owner configure their SMTP server, test the connection with a real
test email, set which address receives new-inquiry notifications, and
edit both the customer confirmation email and the shop notification
email as templates with {{placeholder}} variables.

Previously SMTP config only lived in a non-DB config.php file (with a
blank host, so mail sending was effectively off) and there was no
customer confirmation email at all - only a hardcoded owner
notification. ContactController now sends both emails using the
DB-configured (or config.php-fallback) settings; mail sending stays
best-effort so a contact form submission never fails because of it.

Backend: new Mailer support class (config resolution, PHPMailer setup,
placeholder rendering) and MailSettingsController (show/update/test),
following the existing WebsiteSettings/DatabaseSettings conventions
(password never returned in plaintext, empty password on save keeps
the existing one). New app_settings columns wired into Schema.php so
the "Datenbankstruktur aktualisieren" admin button picks them up on
existing installs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-07 00:54:17 +02:00
Maaxxs
e234a2435d Add photo gallery feature (brand -> project -> photos drill-down)
Mirrors the old site's Bildergalerie structure: a brand tile grid at
/galerie, project tiles within a brand, and a photo grid with a
lightbox for each project. Backed by new gallery_brands/gallery_projects/
gallery_photos tables and admin CRUD pages, gated by a new gallery.manage
permission.

Also fixes a real bug found while testing photo uploads: Apache's
mod_dir was redirecting POST /api/uploads to /api/uploads/ (a trailing
slash) because api/uploads/ exists as a real directory, silently
dropping the multipart body on every image upload across the whole
app. Fixed via DirectorySlash Off in .htaccess.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-06 17:04:46 +02:00
Maaxxs
95764039c7 Add admin-configurable website settings and VIN field to contact form
Adds a Website settings tab (hero image, phone, WhatsApp, email) that
feeds the navbar, footer and contact page via a new SiteSettingsContext,
redesigns the navbar with a bigger centered logo plus phone/WhatsApp/shop
links, and adds a VIN/chassis-number field to the contact form, admin
inbox and notification email.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-06 15:28:11 +02:00
Maaxxs
72a7cb928e Fix API responses silently becoming null on the live server
Symptom: Admin-Login zeigte "Cannot read properties of null (reading
'requires_2fa')". Ursache: falls vor den header()-Aufrufen in index.php
irgendeine Ausgabe passiert (z.B. eine PHP-Notice - passiert offenbar auf
PHP 8.4 anders als lokal auf 8.2), geht der Content-Type-Header verloren,
und der Client hat JSON-Antworten dann still als null behandelt statt
sie zu parsen. Backend puffert Ausgaben jetzt und verwirft ungewollten
Output vor den Headern; Client versucht JSON-Parsing jetzt unabhaengig
vom Content-Type-Header und wirft einen klaren Fehler statt still null
zurueckzugeben.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-05 16:16:11 +02:00
Maaxxs
75684df837 Simplify to always run at domain root instead of dual /hifi vs / support
Statt Env-Var-gesteuertem Dualbetrieb (lokal /hifi, live /) läuft jetzt
alles einheitlich unter der Domain-Wurzel - auch lokal (siehe neuer
VirtualHost auf Port 8080 in der Apache-Konfiguration, unabhängig von
Port 80 mit /hifi). Dabei einen Doppel-Slash-Bug in der Routenberechnung
gefunden und behoben (base_path '/' + '/api' ergab faelschlich '//api').

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-05 15:04:39 +02:00
Maaxxs
fe6b463135 Add first-time setup wizard (/setup)
Passwortgeschuetzter Assistent fuer die Ersteinrichtung auf einem neuen
Server: Datenbank-Zugangsdaten testen & speichern, Datenbankstruktur
anlegen, ersten Admin-Account erstellen. Sperrt sich danach dauerhaft
selbst, sobald ein Admin-Account existiert.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-05 14:06:12 +02:00
Maaxxs
f3ab7d0816 Initial commit: HifiPlanet Car-Hifi Shop (Frontend + Backend)
React/Vite Frontend (hifi-src) + PHP/MariaDB Backend (hifi/api) fuer
den Car-Hifi Umbau-Shop HifiPlanet in Amorbach, inkl. Admin-Panel,
2FA, Wartungsmodus, Cookie-Consent und rechtlichen Pflichtseiten.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-05 13:37:06 +02:00