212 lines
4.7 KiB
Markdown
212 lines
4.7 KiB
Markdown
# MYP Reservation Platform
|
|
|
|
Mercedes-Benz Werk 040 Berlin - 3D-Drucker Reservierungsplattform
|
|
|
|
## 🚀 Schnellstart
|
|
|
|
### MYP Control Center (Empfohlen)
|
|
|
|
Das zentrale Installationssystem für alle Komponenten:
|
|
|
|
```bash
|
|
# Repository klonen
|
|
git clone <repository-url>
|
|
cd Projektarbeit-MYP
|
|
|
|
# MYP Control Center starten
|
|
./myp_installer.sh
|
|
```
|
|
|
|
Das MYP Control Center bietet:
|
|
- **Schnellstart-Installationen** (Vollständig, Backend-Only, Entwicklung)
|
|
- **Produktions-Installer** (Integration der v3.2 install.sh Funktionalität)
|
|
- **Granulare Installation** (Einzelne Komponenten)
|
|
- **System & Wartung** (Tests, Status, Informationen)
|
|
|
|
### Direkter Produktions-Installer
|
|
|
|
Für schnelle Produktions-Deployments direkt im MYP Control Center → Option 4:
|
|
|
|
```bash
|
|
./myp_installer.sh
|
|
# → Wähle Option 4: Produktions-Installer
|
|
# → Backend installieren (Raspberry Pi)
|
|
# → Frontend installieren (Docker)
|
|
```
|
|
|
|
### Voraussetzungen
|
|
|
|
- **Backend (Raspberry Pi)**: Python 3.11, systemd
|
|
- **Frontend (m040tbaraspi001)**: Docker, Docker Compose
|
|
|
|
## 🌐 Zugriff
|
|
|
|
- **Frontend**: https://m040tbaraspi001.de040.corpintra.net
|
|
- **Backend API**: https://raspberrypi/api
|
|
|
|
## 🔧 Konfiguration
|
|
|
|
### Netzwerk
|
|
|
|
| Komponente | Hostname | IP | Port |
|
|
|------------|----------|----|----- |
|
|
| Frontend | m040tbaraspi001.de040.corpintra.net | 192.168.0.109 | 443 |
|
|
| Backend | raspberrypi | 192.168.0.105 | 443 |
|
|
|
|
### TLS-Zertifikate
|
|
|
|
Selbstsignierte Zertifikate werden automatisch generiert:
|
|
- Backend: `backend/app/certs/`
|
|
- Frontend: `frontend/certs/`
|
|
|
|
## 📊 Health Checks
|
|
|
|
```bash
|
|
# Backend
|
|
curl -k https://raspberrypi/api/test
|
|
|
|
# Frontend
|
|
curl -k https://m040tbaraspi001.de040.corpintra.net/health
|
|
```
|
|
|
|
## 🛠️ Entwicklung
|
|
|
|
### MYP Control Center (Entwicklungs-Setup)
|
|
```bash
|
|
./myp_installer.sh
|
|
# → Option 3: Entwicklungs-Setup
|
|
```
|
|
|
|
### Manuelle Installation
|
|
|
|
#### Backend Debug-Modus
|
|
```bash
|
|
cd backend/app
|
|
python3.11 app.py --debug
|
|
```
|
|
|
|
#### Frontend Development
|
|
```bash
|
|
cd frontend
|
|
npm run dev
|
|
```
|
|
|
|
## 📁 Projektstruktur
|
|
|
|
```
|
|
Projektarbeit-MYP/
|
|
├── myp_installer.sh # 🎯 HAUPT-INSTALLER (Control Center)
|
|
├── backend/
|
|
│ ├── app/
|
|
│ │ ├── certs/ # TLS-Zertifikate
|
|
│ │ ├── database/ # SQLite-Datenbank
|
|
│ │ ├── logs/ # Anwendungslogs
|
|
│ │ └── app.py # Hauptanwendung
|
|
│ ├── myp.service # systemd Service
|
|
│ ├── requirements.txt # Python-Abhängigkeiten
|
|
│ └── legacy_setup_raspberry_pi.sh # Legacy Skript
|
|
├── frontend/
|
|
│ ├── certs/ # TLS-Zertifikate
|
|
│ ├── docker/
|
|
│ │ ├── caddy/
|
|
│ │ │ └── Caddyfile # Reverse Proxy Konfiguration
|
|
│ │ └── legacy_deploy.sh # Legacy Skript
|
|
│ ├── src/ # Next.js Anwendung
|
|
│ └── docker-compose.yml
|
|
├── scripts/
|
|
│ └── legacy_generate_certs.sh # Legacy Skript
|
|
├── archiv/
|
|
│ └── myp_installer_legacy.sh # Archivierte Version
|
|
└── docs/ # Dokumentation
|
|
```
|
|
|
|
### Script-Status
|
|
|
|
| Skript | Status | Verwendung |
|
|
|--------|--------|------------|
|
|
| `myp_installer.sh` | ✅ **AKTIV** | Haupt-Control-Center |
|
|
| `*legacy_*.sh` | 📦 Legacy | Historische Versionen |
|
|
| `archiv/myp_installer_legacy.sh` | 📦 Archiv | Alte Version 4.0 |
|
|
|
|
## 🔒 Sicherheit
|
|
|
|
- HTTPS-only (Port 443)
|
|
- Selbstsignierte TLS-Zertifikate
|
|
- HTTP → HTTPS Redirect
|
|
- Security Headers (HSTS, CSP, etc.)
|
|
|
|
## 📝 Logs
|
|
|
|
### Backend
|
|
```bash
|
|
# systemd Journal
|
|
sudo journalctl -u myp.service -f
|
|
|
|
# Anwendungslogs
|
|
tail -f backend/app/logs/app/app.log
|
|
```
|
|
|
|
### Frontend
|
|
```bash
|
|
# Docker Logs
|
|
docker-compose logs -f
|
|
|
|
# Caddy Logs
|
|
docker-compose logs caddy
|
|
```
|
|
|
|
## 🆘 Troubleshooting
|
|
|
|
### MYP Control Center verwenden
|
|
```bash
|
|
./myp_installer.sh
|
|
# → Option 6: Systemvoraussetzungen prüfen
|
|
# → Option 7: Anwendung starten
|
|
```
|
|
|
|
### Backend startet nicht
|
|
```bash
|
|
# Service Status prüfen
|
|
sudo systemctl status myp.service
|
|
|
|
# Logs prüfen
|
|
sudo journalctl -u myp.service --no-pager
|
|
|
|
# Zertifikate prüfen
|
|
ls -la backend/app/certs/
|
|
```
|
|
|
|
### Frontend nicht erreichbar
|
|
```bash
|
|
# Container Status prüfen
|
|
docker-compose ps
|
|
|
|
# Netzwerk prüfen
|
|
docker network ls
|
|
|
|
# Zertifikate prüfen
|
|
ls -la frontend/certs/
|
|
```
|
|
|
|
### Verbindungsprobleme
|
|
```bash
|
|
# DNS auflösen
|
|
nslookup raspberrypi
|
|
nslookup m040tbaraspi001.de040.corpintra.net
|
|
|
|
# Ports prüfen
|
|
netstat -tlnp | grep :443
|
|
```
|
|
|
|
## 📋 Version
|
|
|
|
- **Version**: 3.2-final
|
|
- **Control Center**: v4.0 mit v3.2 Integration
|
|
- **Build**: Production
|
|
- **Installer**: MYP Control Center
|
|
|
|
## 👥 Support
|
|
|
|
Bei Problemen verwenden Sie das MYP Control Center oder wenden Sie sich an das IT-Team des Mercedes-Benz Werk 040 Berlin.
|
|
|