Claude Init und Readme Update

Migration auf Docker Umgebung
This commit is contained in:
2026-07-26 09:56:58 +02:00
parent 4fe45e4e53
commit d53fd8742d
6 changed files with 411 additions and 7 deletions
+3 -3
View File
@@ -19,7 +19,7 @@ The project is architected to remain extremely lightweight and fast, intentional
- `helpers.php`: Core PHP utilities and the PostgreSQL data access layer for recipes and site settings.
- `config.php`: Environment-independent configuration loader which reads runtime secrets from `.env`.
- `assets/fc-local.js`: Browser-side storage for favorites and dietary goals.
- `scripts/seed-data.php`: One-time seed data for recipes, imprint, and privacy settings.
- `scripts/db-seed.php`: One-time import of `data/recipes.json` into Postgres.
- `scripts/schema.sql`: Relational table definitions for recipes and site settings.
---
@@ -154,11 +154,11 @@ Schema: `scripts/schema.sql`. PHP baut daraus dieselben Arrays wie früher (`i18
1. `DATABASE_URL` in `.env` → Verbindung über `config.php`.
2. Beim ersten Request: Tabellen anlegen (`ensure_recipe_schema()`).
3. `php scripts/db-seed.php` einmalig ausführen → Rezepte und Site-Daten werden in Postgres geschrieben.
3. `php scripts/db-seed.php` einmalig ausführen → Rezepte aus `data/recipes.json` werden in Postgres geschrieben.
4. `load_recipes()` und `load_site_settings()` lesen per SQL; ohne DB → HTTP 503 (`maintenance/db-unavailable.php`).
5. Admin: `save_recipe()`, `delete_recipe()` und `save_site_settings()` schreiben direkt in die Tabellen.
**Einmalig Daten laden:** `php scripts/db-seed.php` (aus `scripts/seed-data.php`, ohne JSON-Dateien).
**Einmalig Daten laden:** `php scripts/db-seed.php` (importiert `data/recipes.json`).
Für **Staging/Production** muss eine externe Postgres-Datenbank vorhanden sein. Setze nur `DATABASE_URL` in der Hosting-Umgebung und mische nie Production-Daten in die lokale Dev-DB.