86 lines
2.0 KiB
Markdown
86 lines
2.0 KiB
Markdown
# Schmankerl Brotzeitportal
|
|
|
|
Modernes Bestell- und Verwaltungssystem f?r Brotzeiten und Speisen (FastAPI & MariaDB).
|
|
|
|
## Systemanforderungen
|
|
- Debian 12 / 13 (oder kompatibles Linux)
|
|
- Python 3.13+ mit `python3-venv`
|
|
- Nginx (Reverse Proxy mit SSL)
|
|
- MariaDB / MySQL Server (z. B. auf \`db.waiswuaschd.de:3306\`)
|
|
|
|
## 1. Installation
|
|
```bash
|
|
# Repository klonen
|
|
cd /home/maxi/Projekt
|
|
git clone https://gitea.sp13l.de/kobold-ai/schmankerl.git
|
|
cd schmankerl
|
|
|
|
# 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_USER=v2_usr_wops
|
|
DB_PASS=DeinSicheresPasswort
|
|
DB_HOST=db.waiswuaschd.de
|
|
DB_PORT=3306
|
|
DB_NAME=v2_db_wops
|
|
```
|
|
|
|
## 3. Systemd Service (/etc/systemd/system/schmankerl.service)
|
|
```ini
|
|
[Unit]
|
|
Description=Schmankerl Brotzeitportal (FastAPI)
|
|
After=network.target
|
|
|
|
[Service]
|
|
User=maxi
|
|
Group=maxi
|
|
WorkingDirectory=/home/maxi/Projekt/schmankerl
|
|
ExecStart=/home/maxi/Projekt/schmankerl/venv/bin/uvicorn app.main:app --host 127.0.0.1 --port 8000 --workers 1
|
|
Restart=always
|
|
RestartSec=5
|
|
Environment=PYTHONUNBUFFERED=1
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
```
|
|
Aktivieren und starten:
|
|
```bash
|
|
sudo systemctl daemon-reload
|
|
sudo systemctl enable --now schmankerl
|
|
```
|
|
|
|
## 4. Nginx Reverse Proxy
|
|
```nginx
|
|
server {
|
|
listen 80;
|
|
server_name demo.dev.waiswuaschd.de;
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
server_name demo.dev.waiswuaschd.de;
|
|
|
|
# SSL Zertifikate hier konfigurieren (z. B. via certbot)
|
|
|
|
location /static/ {
|
|
alias /home/maxi/Projekt/schmankerl/app/static/;
|
|
expires 7d;
|
|
}
|
|
|
|
location / {
|
|
proxy_pass http://127.0.0.1:8000;
|
|
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;
|
|
}
|
|
}
|
|
```
|