130 lines
3.0 KiB
Markdown
130 lines
3.0 KiB
Markdown
|
|
# 🎯 Finaler Status - Pfandsystem
|
||
|
|
|
||
|
|
## ✅ Was läuft:
|
||
|
|
|
||
|
|
1. **MySQL** - Port 3306 (Docker)
|
||
|
|
2. **phpMyAdmin** - http://localhost:8081 (Docker)
|
||
|
|
3. **Backend API** - http://localhost:3001 (lokal, nicht Docker)
|
||
|
|
4. **Frontend** - Intern im Docker-Netzwerk
|
||
|
|
|
||
|
|
## ⚠️ Wichtig: Traefik Reverse Proxy
|
||
|
|
|
||
|
|
Auf dem Server läuft **Traefik** auf Port 80/443.
|
||
|
|
Das Frontend muss über Traefik geroutet werden!
|
||
|
|
|
||
|
|
## 📋 Nächste Schritte:
|
||
|
|
|
||
|
|
### 1. Git Push (MANUELL)
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# Du musst das manuell machen mit deinem Passwort:
|
||
|
|
git push -u origin main
|
||
|
|
# Username: christian
|
||
|
|
# Passwort: [dein Passwort]
|
||
|
|
|
||
|
|
# Dann die anderen Branches:
|
||
|
|
git push origin development
|
||
|
|
git push origin testing
|
||
|
|
```
|
||
|
|
|
||
|
|
### 2. Frontend über Traefik routen
|
||
|
|
|
||
|
|
Da Traefik läuft, musst du eine Traefik-Konfiguration erstellen:
|
||
|
|
|
||
|
|
**Option A: Traefik Labels (empfohlen)**
|
||
|
|
```yaml
|
||
|
|
# In docker-compose.yml für frontend:
|
||
|
|
labels:
|
||
|
|
- "traefik.enable=true"
|
||
|
|
- "traefik.http.routers.pfandsystem.rule=Host(`pfandsystem.backdigital.de`)"
|
||
|
|
- "traefik.http.routers.pfandsystem.entrypoints=websecure"
|
||
|
|
- "traefik.http.routers.pfandsystem.tls=true"
|
||
|
|
- "traefik.http.routers.pfandsystem.tls.certresolver=letsencrypt"
|
||
|
|
- "traefik.http.services.pfandsystem.loadbalancer.server.port=80"
|
||
|
|
```
|
||
|
|
|
||
|
|
**Option B: Traefik Config File**
|
||
|
|
Erstelle `/etc/traefik/dynamic/pfandsystem.yml`:
|
||
|
|
```yaml
|
||
|
|
http:
|
||
|
|
routers:
|
||
|
|
pfandsystem:
|
||
|
|
rule: "Host(`pfandsystem.backdigital.de`)"
|
||
|
|
service: pfandsystem
|
||
|
|
entryPoints:
|
||
|
|
- websecure
|
||
|
|
tls:
|
||
|
|
certResolver: letsencrypt
|
||
|
|
|
||
|
|
services:
|
||
|
|
pfandsystem:
|
||
|
|
loadBalancer:
|
||
|
|
servers:
|
||
|
|
- url: "http://pfandsystem-frontend-internal:80"
|
||
|
|
```
|
||
|
|
|
||
|
|
### 3. Backend über Traefik routen (für API)
|
||
|
|
|
||
|
|
```yaml
|
||
|
|
http:
|
||
|
|
routers:
|
||
|
|
pfandsystem-api:
|
||
|
|
rule: "Host(`pfandsystem.backdigital.de`) && PathPrefix(`/api`)"
|
||
|
|
service: pfandsystem-api
|
||
|
|
entryPoints:
|
||
|
|
- websecure
|
||
|
|
tls:
|
||
|
|
certResolver: letsencrypt
|
||
|
|
|
||
|
|
services:
|
||
|
|
pfandsystem-api:
|
||
|
|
loadBalancer:
|
||
|
|
servers:
|
||
|
|
- url: "http://host.docker.internal:3001"
|
||
|
|
```
|
||
|
|
|
||
|
|
## 🔧 Aktuelle Konfiguration:
|
||
|
|
|
||
|
|
### Backend (.env)
|
||
|
|
```
|
||
|
|
DB_HOST=localhost # Wichtig! Nicht "mysql" weil Backend lokal läuft
|
||
|
|
DB_PORT=3306
|
||
|
|
DB_USER=pfandsystem
|
||
|
|
DB_PASSWORD=pfandsystem_secure_password
|
||
|
|
```
|
||
|
|
|
||
|
|
### Frontend (.env)
|
||
|
|
```
|
||
|
|
VITE_API_URL=http://localhost:3001/api # Muss auf /api zeigen wenn über Traefik
|
||
|
|
```
|
||
|
|
|
||
|
|
## 🚀 Schnellstart Backend:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# Backend starten (falls gestoppt)
|
||
|
|
cd /root/backend && nohup npm start > /tmp/backend.log 2>&1 &
|
||
|
|
|
||
|
|
# Backend-Logs sehen
|
||
|
|
tail -f /tmp/backend.log
|
||
|
|
|
||
|
|
# Backend testen
|
||
|
|
curl http://localhost:3001/health
|
||
|
|
```
|
||
|
|
|
||
|
|
## 📊 Login-Daten:
|
||
|
|
|
||
|
|
- **Email:** admin@pfandsystem.de
|
||
|
|
- **Passwort:** admin123
|
||
|
|
|
||
|
|
## 🎯 TODO:
|
||
|
|
|
||
|
|
- [ ] Git pushen (manuell mit Passwort)
|
||
|
|
- [ ] Traefik-Routing für Frontend konfigurieren
|
||
|
|
- [ ] Traefik-Routing für Backend-API konfigurieren
|
||
|
|
- [ ] Frontend-API-URL anpassen (auf /api über Traefik)
|
||
|
|
- [ ] Testen
|
||
|
|
|
||
|
|
## 💡 Hinweis:
|
||
|
|
|
||
|
|
Da Traefik läuft, ist SSL automatisch verfügbar wenn die Routing-Konfiguration stimmt!
|