Remove static JSON files and seed step; migrate site settings to Postgres

All content (recipes + imprint/privacy settings) now lives exclusively in
Postgres. The app no longer requires a seed step on first deploy.

Changes:
- helpers.php: load_site_settings() returns defaults when site_settings
  table is empty instead of throwing DatabaseUnavailableException; removes
  legacy JSONB migration path
- data/recipes.json, data/site.json: deleted (content already in DB)
- scripts/db-seed.php: deleted (no longer needed)
- docker-compose.yml: remove RUN_DB_SEED env var and data/ volume mount
- docker/entrypoint.sh: remove RUN_DB_SEED seed block
- docs/COOLIFY.md: update deployment guide to reflect seedless workflow
- .claude/launch.json: add dev server configurations for preview tool

Fresh deploys now start with placeholder legal pages and an empty recipe
list; the admin fills in real content via /admin.php without any CLI step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-18 09:53:39 +02:00
co-authored by Claude Sonnet 4.6
parent 792cbe18c1
commit 86fbd8e4bb
20 changed files with 154 additions and 512 deletions
+7 -7
View File
@@ -30,8 +30,8 @@ Dieses Dokument enthält den aktuellen Entwicklungsstand und detaillierte Aufgab
- Mikro-Animationen & Quick-Save Funktion
- [x] **Phase 6: PostgreSQL Datenbank**
- `DATABASE_URL` in `.env`, Docker Compose für lokale Dev-DB
- `init_db()` / `save_recipes()` in `helpers.php`
- Fallback auf `data/recipes.json`
- `init_db()` / `save_recipe()` / `save_site_settings()` in `helpers.php`
- Kein JSON-Fallback; Rezepte und Site-Daten liegen in Postgres
---
@@ -82,7 +82,7 @@ Favoriten, Ernährungsziel und Newsletter ohne Cloud-Backend.
Jedes Rezept erhält präzise Makronährstoffe (Kalorien, Proteine, Kohlenhydrate, Fette), die vom Admin gepflegt und dem Nutzer edel präsentiert werden.
- [x] **Datenmodell & Admin-Panel Erweiterung**
- [x] `data/recipes.json` Struktur anpassen: Hinzufügen von `nutrition` (`calories`, `protein`, `carbs`, `fat`)
- [x] Rezeptstruktur um `nutrition` (`calories`, `protein`, `carbs`, `fat`) erweitern
- [x] `admin.php` Formular erweitern:
- [x] Eingabefeld für Kalorien (kcal)
- [x] Eingabefeld für Eiweiß / Protein (g)
@@ -101,7 +101,7 @@ Jedes Rezept erhält präzise Makronährstoffe (Kalorien, Proteine, Kohlenhydrat
Ein immersiver Kochmodus, der Anwendern Schritt-für-Schritt durch die Zubereitung führt inklusive Videoanleitungen und integrierten Timern.
- [x] **Video-Verknüpfung im Admin-Panel**
- [x] Rezeptstruktur in `data/recipes.json` erweitern, damit jeder Arbeitsschritt (`steps`) eine optionale `video_url` (externe MP4-URL) besitzen kann
- [x] Rezeptstruktur erweitern, damit jeder Arbeitsschritt (`steps`) eine optionale `video_url` (externe MP4-URL) besitzen kann
- [x] `admin.php` erweitern, um Video-URLs pro Einzelschritt einzugeben
- [x] **Fullscreen Cooking-Mode Overlay**
- [x] Trigger-Button "Kochmodus starten" (`CapitoliumRevealButton` Stil) auf `recipe.php` einbauen
@@ -134,13 +134,13 @@ Ein hochgradig interaktives, touch-freundliches Karussell direkt auf der Startse
---
### 🔥 Phase 6: PostgreSQL Datenbank
Rezepte in Postgres (JSONB), optional lokal per Docker.
Rezepte und Site-Daten in normalisierten Postgres-Tabellen, optional lokal per Docker.
- [x] **`DATABASE_URL` & Docker Compose**
- [x] `docker-compose.dev.yml` für lokale Postgres-Instanz
- [x] `init_db()` legt Tabelle `recipes` an und seedet aus `recipes.json`
- [x] `init_db()` legt Tabellen an; `scripts/db-seed.php` seedet aus `scripts/seed-data.php`
- [x] **PHP-Datenzugriff**
- [x] `load_recipes()` / `save_recipes()` mit JSON-Fallback
- [x] `load_recipes()` / `save_recipe()` ohne JSON-Fallback
- [x] `load_recipe_by_slug()` in `recipe.php`
---