# What To Cook (WTC) - Kochbuch & Wochenplaner Digitales Kochbuch, Wochenmen?planer & Buchdruck-Engine (FastAPI & MariaDB). ## Systemanforderungen - Debian 12 / 13 (oder kompatibles Linux) - Python 3.13+ mit `python3-venv` - Nginx (Reverse Proxy mit SSL) - MariaDB Server auf \`db.waiswuaschd.de:3306\` (Datenbank: \`v2_db_wtc_cookbook\`) ## 1. Installation ```bash # Repository klonen cd /home/maxi/Projekt git clone https://gitea.sp13l.de/kobold-ai/wtc.waiswuaschd.de.git wtc.waiswuaschd.de cd wtc.waiswuaschd.de # Python Virtualenv erstellen und Abh?ngigkeiten installieren python3 -m venv venv ./venv/bin/pip install --upgrade pip ./venv/bin/pip install -r requirements.txt ``` ## 2. Umgebungsvariablen (.env) Erstelle im Projektverzeichnis eine `.env` Datei: ```ini DB_ENGINE=mariadb MARIADB_HOST=db.waiswuaschd.de MARIADB_PORT=3306 MARIADB_USER=v2_usr_wtc_cookbook MARIADB_PASS=XKikHf&j6Wj!rs5%A8#ZzyvE#*A1hT MARIADB_NAME=v2_db_wtc_cookbook APP_USERNAME=admin APP_PASSWORD=wtc2026! SECRET_KEY=wtc_secure_hmac_secret_key_2026_kochbuch_session ``` ## 3. Systemd Service (/etc/systemd/system/wtc.service) ```ini [Unit] Description=What To Cook (WTC) Zufallsgenerator f?r Essen (FastAPI) After=network.target [Service] Type=simple User=maxi Group=maxi WorkingDirectory=/home/maxi/Projekt/wtc.waiswuaschd.de Environment="PATH=/home/maxi/Projekt/wtc.waiswuaschd.de/venv/bin:/usr/local/bin:/usr/bin:/bin" ExecStart=/home/maxi/Projekt/wtc.waiswuaschd.de/venv/bin/uvicorn app.main:app --host 127.0.0.1 --port 8003 --workers 1 Restart=always RestartSec=3 [Install] WantedBy=multi-user.target ``` Aktivieren und starten: ```bash sudo systemctl daemon-reload sudo systemctl enable --now wtc ``` ## 4. Nginx Reverse Proxy ```nginx server { listen 80; server_name wtc.dev.waiswuaschd.de; return 301 https://$host$request_uri; } server { listen 443 ssl http2; server_name wtc.dev.waiswuaschd.de; client_max_body_size 50M; # SSL Zertifikate hier konfigurieren (z. B. via certbot) location /static/ { alias /home/maxi/Projekt/wtc.waiswuaschd.de/app/static/; } location / { proxy_pass http://127.0.0.1:8003; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } } ```