diff --git a/.agents/TODO.md b/.agents/TODO.md index 6e3173c..a06a4f0 100644 --- a/.agents/TODO.md +++ b/.agents/TODO.md @@ -138,7 +138,7 @@ Rezepte und Site-Daten in normalisierten Postgres-Tabellen, optional lokal per D - [x] **`DATABASE_URL` & Docker Compose** - [x] `docker-compose.dev.yml` für lokale Postgres-Instanz - - [x] `init_db()` legt Tabellen an; `scripts/db-seed.php` seedet aus `scripts/seed-data.php` + - [x] `init_db()` legt Tabellen an; `scripts/db-seed.php` seedet aus `data/recipes.json` - [x] **PHP-Datenzugriff** - [x] `load_recipes()` / `save_recipe()` ohne JSON-Fallback - [x] `load_recipe_by_slug()` in `recipe.php` diff --git a/.agents/brain.md b/.agents/brain.md index e362d29..cfe2e06 100644 --- a/.agents/brain.md +++ b/.agents/brain.md @@ -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()` | diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..778d7ba --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,97 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project overview + +FlixCooks is a premium recipe/food-blog website built as **vanilla server-rendered PHP** — no framework, no build step, no JS bundler, no Composer dependencies. PHP renders HTML directly with heavy inline `