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
@@ -4,7 +4,7 @@ This document summarizes architectural knowledge, conventions, and learnings for
## 1. Project Architecture & Stack
- **Backend:** Vanilla PHP. No heavy frameworks.
- **Database:** PostgreSQL required (`DATABASE_URL` in `.env`). Normalized tables in `scripts/schema.sql`; `load_recipes()` / `save_recipe()` and `load_site_settings()` / `save_site_settings()` in `helpers.php`. No runtime JSON files. One-time import: `php scripts/db-seed.php` from `scripts/seed-data.php`.
- **Database:** PostgreSQL required (`DATABASE_URL` in `.env`). Normalized tables in `scripts/schema.sql`; `load_recipes()` / `save_recipe()` and `load_site_settings()` / `save_site_settings()` in `helpers.php`. Recipes read at runtime only from Postgres. One-time import of sample data: `php scripts/db-seed.php` from `data/recipes.json`.
- **Site settings (legal pages):** Stored in Postgres table `site_settings`; no flat-file fallback.
- **Admin Panel (`admin.php`):** Lightweight CMS. Textareas use one line per array element (`ingredients`, `steps`, `step_videos`, `step_timers`).
- **Frontend:** Server-rendered PHP (`index.php`, `recipe.php`, …), Vanilla JS/CSS. Profile/favorites via `assets/fc-local.js`.
@@ -42,7 +42,7 @@ PHP still exposes the same nested arrays (`i18n`, `nutrition`, …) via `hydrate
1. `DATABASE_URL` required → `require_database()` or HTTP 503 (`maintenance/db-unavailable.php`).
2. `load_recipes()` → SQL → PHP arrays for templates.
3. Admin: `save_recipe()`, `delete_recipe()`, `clear_featured_recipes()`.
4. One-time import: `php scripts/db-seed.php` from `scripts/seed-data.php`.
4. One-time import: `php scripts/db-seed.php` from `data/recipes.json`.
### `config.php` functions
- `load_env()` — parses `.env`.
@@ -125,7 +125,7 @@ See `.agents/TODO.md` (e.g. PWA & offline support). README `Local Postgres (Dock
|------|---------|
| `config.php` | `.env`, Firebase config, PDO |
| `helpers.php` | `init_db`, `load_recipes`, `save_recipe`, site settings |
| `scripts/seed-data.php` | Seed arrays for recipes and site settings |
| `data/recipes.json` | Seed data for recipes (imported by `scripts/db-seed.php`) |
| `docker-compose.dev.yml` | Local Postgres |
| `scripts/db-check.php` | Connection + seed smoke test |
| `partials/head.php` | Firebase init via `get_firebase_config()` |