feat(backend): wire exclude_recipe_ids, verify MealPlan votes schema, add image generation service

- api/meal_plans.py: /regenerate now passes exclude_recipe_ids into generate_meal_plan
- planner/generate.py: filter recipe_dicts by exclude_recipe_ids set
- image_generation.py: OpenAI gpt-image-1 client with prompt building, b64_json handling
- main.py: StaticFiles mount at /static for generated images
- admin.py: POST /api/admin/trigger-images endpoint for batch generation
- scripts/generate_images.py: CLI for batch image generation
- docker-compose.yml + nginx: volume mounts for static/images persistence
- Verify MealPlanItem.votes ↔ MealPlanVote relationship is correct; no model bug exists
This commit is contained in:
2026-05-24 19:31:26 -07:00
parent dcdb88595e
commit ae32e650ce
17 changed files with 348 additions and 3 deletions
+9
View File
@@ -19,6 +19,8 @@ services:
- SWIFTLY_API_BASE=${SWIFTLY_API_BASE:-https://prod.swiftlyapi.net}
- SWIFTLY_CATEGORIES_URL=${SWIFTLY_CATEGORIES_URL:-https://luckysupermarkets.com/categories}
- AI_IMAGE_ENABLED=${AI_IMAGE_ENABLED:-false}
- AI_IMAGE_API_KEY=${OPENAI_API_KEY:-}
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- SECRET_KEY=${SECRET_KEY}
- ADMIN_TOKEN=${ADMIN_TOKEN}
@@ -35,6 +37,8 @@ services:
interval: 30s
timeout: 10s
retries: 3
volumes:
- ./backend/static:/app/static:rw
scheduler:
build:
@@ -53,6 +57,8 @@ services:
- SWIFTLY_API_BASE=${SWIFTLY_API_BASE:-https://prod.swiftlyapi.net}
- SWIFTLY_CATEGORIES_URL=${SWIFTLY_CATEGORIES_URL:-https://luckysupermarkets.com/categories}
- AI_IMAGE_ENABLED=${AI_IMAGE_ENABLED:-false}
- AI_IMAGE_API_KEY=${OPENAI_API_KEY:-}
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- SECRET_KEY=${SECRET_KEY}
- ADMIN_TOKEN=${ADMIN_TOKEN}
@@ -64,6 +70,8 @@ services:
db:
condition: service_healthy
restart: unless-stopped
volumes:
- ./backend/static:/app/static:rw
frontend:
build:
@@ -98,6 +106,7 @@ services:
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/ssl:/etc/nginx/ssl:ro
- ./backend/static:/app/static:ro
depends_on:
- frontend
- backend