feat: initial recipe-importer application

Python/Flask web app that scrapes Hungarian recipe sites (mindmegette.hu)
and imports them into Mealie via its REST API. Includes dark-themed web UI
with editable preview, Dockerfile, build script, and docker-compose.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-23 21:52:46 +01:00
parent 4da156ef9e
commit f600885b14
16 changed files with 1363 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
"""Configuration management — persists Mealie connection settings to a JSON file."""
import json
import os
from pathlib import Path
DATA_DIR = Path(os.environ.get("DATA_DIR", "/data"))
CONFIG_FILE = DATA_DIR / "config.json"
_DEFAULTS = {
"mealie_url": "",
"mealie_api_key": "",
}
def _ensure_dir():
DATA_DIR.mkdir(parents=True, exist_ok=True)
def load() -> dict:
"""Return the current config dict, merged with defaults."""
cfg = dict(_DEFAULTS)
if CONFIG_FILE.exists():
try:
with open(CONFIG_FILE, "r", encoding="utf-8") as f:
cfg.update(json.load(f))
except (json.JSONDecodeError, OSError):
pass
return cfg
def save(cfg: dict):
"""Atomically persist *cfg* to disk."""
_ensure_dir()
tmp = CONFIG_FILE.with_suffix(".tmp")
with open(tmp, "w", encoding="utf-8") as f:
json.dump(cfg, f, indent=2, ensure_ascii=False)
tmp.replace(CONFIG_FILE)