🌟 🎉 Major Update:

This commit is contained in:
2025-06-01 23:41:02 +02:00
parent 62efe03887
commit 4042f07c00
228 changed files with 8598 additions and 1893 deletions

657
README.md
View File

@ -1,376 +1,395 @@
# MYP Reservation Platform
# MYP Druckerverwaltungssystem
Mercedes-Benz Werk 040 Berlin - 3D-Drucker Reservierungsplattform
**Manage Your Printer** - Mercedes-Benz Werk 040 Berlin
Vollständige 3D-Drucker Verwaltungsplattform mit Smart-Plug-Technologie
## 🎯 System-Übersicht
**MYP (Manage Your Printer)** ist ein System zur **zentralen Verwaltung und Steuerung von 3D-Druckern mittels Smart-Plug-Technologie**. Es digitalisiert den Reservierungsprozess für mehrere 3D-Drucker und ermögligt eine **automatisierte Schaltung der Drucker über WLAN-Steckdosen (TP-Link Tapo P110)**.
### 🔑 Kernfunktionen
#### **Benutzer- und Rechteverwaltung**
- **Registrierung, Login und Rollenkonzept** (Admin/Benutzer)
- **Administrierende** können Drucker und Nutzer verwalten
- **Standard-Benutzer** können Reservierungen anlegen und Druckjobs verwalten
#### **Drucker- und Auftragsmanagement**
- **Zentrales Reservierungssystem** für Zeitfenster-Buchungen
- **Automatische Drucker-Schaltung**: Einschalten zum Reservierungsstart, Ausschalten nach Ende
- **Herstellerunabhängig**: Keine direkte Kommunikation mit 3D-Druckern - ausschließlich Stromsteuerung über Smart-Plug-Steckdosen
- **Einfache Integration**: Keine Eingriffe in die Druckerhardware erforderlich
#### **Statistikerfassung**
- **Protokollierung** von Nutzungszeiten und abgeschlossenen Druckaufträgen
- **Auswertungen** (z.B. Gesamtdruckzeit pro Zeitraum)
- **Analytics-Dashboard** für Effizienzanalysen
#### **Offline-Fähigkeit & Kiosk-Modus**
- **Autonomer Betrieb** ohne Internetzugang nach Installation
- **Raspberry Pi Kiosk-Modus**: Vollbild-Dashboard vor Ort
- **Touch-Interface** für aktuelle Druckerbelegungen und Systemstatus
## 📋 Projektarchitektur
Dieses Repository enthält **zwei sich ergänzende Projektarbeiten** für die IHK-Abschlussprüfung:
### 🏗️ **Backend-System** (Till Tomczak) - **KERN-INFRASTRUKTUR**
- **Entwickler**: Till Tomczak
- **Fachrichtung**: Fachinformatiker für digitale Vernetzung
- **Technologie**: **Flask-basiertes Backend in Python** mit **SQLite-Datenbank**
- **Verantwortung**: Hardware-Integration, REST-APIs und cyber-physische Vernetzung
### 📊 **Frontend-System** (Torben Haack) - **BENUTZEROBERFLÄCHE & ANALYTICS**
- **Entwickler**: Torben Haack
- **Fachrichtung**: Fachinformatiker für Daten- und Prozessanalyse
- **Technologie**: **Next.js-basierte Webanwendung** mit erweiterten Analytics
- **Verantwortung**: Moderne Web-UI, Datenvisualisierung und Benutzerfreundlichkeit
## 🏗️ Technische Architektur
### Cyber-Physische Lösung
```
┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐
│ Frontend-Server │◄──►│ Backend-Server │◄──►│ Raspberry Pi │
│ (Port 3000) │ │ (Port 443/5000) │ │ (Smart-Plugs) │
│ Torben Haack │ │ Till Tomczak │ │ Till Tomczak │
│ │ │ │ │ │
│ • Next.js App │ │ • Flask REST-API │ │ • TP-Link Tapo P110 │
│ • Analytics UI │ │ • SQLite Database │ │ • Hardware Control │
│ • PWA-Features │ │ • Smart-Plug API │ │ • Kiosk Interface │
│ • HTTPS Client │ │ • HTTPS Server │ │ • Offline Operation │
│ • Export Functions │ │ • Session Management│ │ • Touch Interface │
└─────────────────────┘ └─────────────────────┘ └─────────────────────┘
```
### Kommunikations-Architektur
- **RESTful API**: Backend kommuniziert mit Frontend und externen Diensten
- **HTTPS-Verschlüsselung**: Selbstsignierte Zertifikate für sichere Übertragung
- **Progressive Web App (PWA)**: Offline-Funktionalität im Browser
- **Smart-Plug-Integration**: Lokale WLAN-Steuerung ohne Cloud-Abhängigkeit
## 🚀 Schnellstart
### MYP Control Center (Empfohlen)
Das zentrale Installationssystem für alle Komponenten:
### Backend-System (Hardware & APIs)
```bash
# Repository klonen
git clone <repository-url>
cd Projektarbeit-MYP
# Backend-Server starten (Till Tomczaks System)
cd backend
sudo ./setup.sh # Automatische Installation
python app.py # Oder für Development
# MYP Control Center starten
./myp_installer.sh
# Kiosk-Modus auf Raspberry Pi
sudo systemctl start myp-https.service
```
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
```
### MYP Kiosk-Modus (Produktions-bereit)
Das Backend bietet parallel zur API auch ein **vollständiges Web-Interface** für Kiosk-Betrieb:
```bash
./myp_installer.sh
# → Option 2: Backend-Only Installation (mit Kiosk Web Interface)
# oder
# → Option 5: Granulare Installation → Kiosk-Modus installieren
```
**Kiosk-Features:**
-**Web-Interface parallel zur API** - Kein separates Frontend nötig
-**Touch-optimierte Bedienung** - Ideal für Raspberry Pi Touchscreens
-**Automatischer Browser-Start** - Vollbild-Modus beim Boot
-**systemd Integration** - Service-basierte Kiosk-Verwaltung
-**Produktions-bereit** - SSL, Logging, Monitoring
**Kiosk URLs:**
- Hauptinterface: `https://raspberrypi/`
- Dashboard: `https://raspberrypi/dashboard`
- Drucker-Verwaltung: `https://raspberrypi/printers`
- Job-Verwaltung: `https://raspberrypi/jobs`
- Admin-Panel: `https://raspberrypi/admin`
### Manuelle Installation
#### Backend Debug-Modus
```bash
cd backend/app
python3.11 app.py --debug
```
#### Frontend Development
### Frontend-System (Web-Interface)
```bash
# Frontend-Server starten (Torben Haacks System)
cd frontend
npm run dev
pnpm install
pnpm db # Datenbank einrichten
pnpm dev # Development-Server
# Produktions-Deployment
pnpm build && pnpm start
```
#### Kiosk-Modus manuell starten
### Vollständiges System
```bash
# Backend starten
cd backend/app && python app.py
# Backend (API-Server)
cd backend && python app.py --host 0.0.0.0 --port 5000 &
# Kiosk-Browser starten (separates Terminal)
./backend/app/start_kiosk.sh
# Frontend (Web-Interface)
cd frontend && pnpm build && pnpm start &
```
## 📁 Projektstruktur
## 🌐 Systemzugriff
### Produktions-URLs
- **Web-Interface**: `http://localhost:3000` (Torben Haacks Frontend)
- **API-Backend**: `https://192.168.0.105:443/api` (Till Tomczaks APIs auf separatem Server)
- **Kiosk-Modus**: `https://192.168.0.105:443` (Lokales Touch-Interface)
### Standard-Anmeldedaten
- **Benutzername**: `admin`
- **Passwort**: `admin123`
### Netzwerk-Konfiguration
- **Backend-Server**: `192.168.0.105:443` (HTTPS)
- **Frontend-Server**: `localhost:3000` (HTTP Development)
- **SSL-Zertifikate**: Selbstsigniert (automatisch akzeptiert)
## 📁 Projektstruktur & Integration
```
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
├── backend/ # 🏗️ KERN-INFRASTRUKTUR (Till Tomczak)
│ ├── app.py # Flask REST-API Server
│ ├── models.py # SQLite-Datenbank & Business Logic
│ ├── utils/ # Smart-Plug Integration (TP-Link Tapo P110)
│ ├── templates/ # Kiosk-Mode Web-Interface
│ ├── static/ # PWA-Assets für Offline-Betrieb
│ └── systemd/ # Raspberry Pi Service-Integration
├──
├── frontend/ # 📊 WEB-INTERFACE (Torben Haack)
── src/app/ # Next.js Haupt-Anwendung
│ ├── src/components/ # React UI-Komponenten
│ ├── src/lib/api/ # Backend-REST-API-Integration
── src/lib/analytics/ # Statistik-Algorithmen
├──
├── docs/ # 📚 Gemeinsame Dokumentation
└── README.md # Diese Datei
```
### Script-Status
## 🎯 Funktions-Aufgabenteilung
| 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 |
### Backend-Verantwortlichkeiten (Till Tomczak)
-**Smart-Plug-Steuerung**: TP-Link Tapo P110 WLAN-Steckdosen
-**Automatische Drucker-Schaltung**: Zeitgesteuerte Ein-/Ausschaltung
-**REST-API-Bereitstellung**: Vollständige API für alle Drucker-Operationen
-**Cyber-physische Vernetzung**: IT-System ↔ Hardware-Integration
-**SQLite-Datenbank**: Benutzer, Drucker, Jobs, Statistiken
-**HTTPS-Server**: Selbstsignierte Zertifikate und Session-Management
-**Raspberry Pi Integration**: Systemd-Services und Kiosk-Modus
-**Offline-Fähigkeit**: Autonomer Betrieb ohne Internet
## 🔒 Sicherheit
### Frontend-Verantwortlichkeiten (Torben Haack)
-**Moderne Web-UI**: React-basierte Benutzeroberfläche
-**Progressive Web App**: Offline-Funktionalität im Browser
-**Advanced Analytics**: Interaktive Charts und Datenvisualisierung
-**Reporting-System**: PDF/Excel-Export und automatisierte Berichte
-**Responsive Design**: Optimiert für Desktop, Tablet und Mobile
-**Backend-API-Integration**: Nahtlose REST-API-Anbindung
-**Statistik-Auswertungen**: Nutzungsanalysen und Trend-Analysen
-**Benutzerfreundlichkeit**: Intuitive Workflows für alle Stakeholder
- HTTPS-only (Port 443)
- Selbstsignierte TLS-Zertifikate
- HTTP → HTTPS Redirect
- Security Headers (HSTS, CSP, etc.)
## 🔗 API-Integration & Kommunikation
## 📝 Logs
### Backend-REST-Endpunkte (Till Tomczak)
```typescript
// Drucker-Management
GET /api/printers // Alle Drucker abrufen
POST /api/printers // Neuen Drucker hinzufügen
PUT /api/printers/{id} // Drucker aktualisieren
DELETE /api/printers/{id} // Drucker löschen
### Backend
// Reservierungs-Management
GET /api/jobs // Alle Reservierungen abrufen
POST /api/jobs // Neue Reservierung erstellen
PUT /api/jobs/{id}/finish // Reservierung beenden
DELETE /api/jobs/{id} // Reservierung abbrechen
// Smart-Plug-Steuerung (TP-Link Tapo P110)
POST /api/plugs/{id}/on // Drucker einschalten
POST /api/plugs/{id}/off // Drucker ausschalten
GET /api/plugs/{id}/status // Plug-Status abfragen
// Statistiken & Analytics
GET /api/stats // Nutzungsstatistiken
GET /api/reports // Report-Daten für Analytics
```
### Frontend-Integration (Torben Haack)
```typescript
// Backend-API Client - Konfiguriert für separaten Server
export class MYPApiClient {
constructor(baseURL: string = 'https://192.168.0.105:443/api') {
this.baseURL = baseURL;
}
async getPrinters() {
return fetch(`${this.baseURL}/printers`).then(r => r.json());
}
async getJobs() {
return fetch(`${this.baseURL}/jobs`).then(r => r.json());
}
async getStats() {
return fetch(`${this.baseURL}/stats`).then(r => r.json());
}
}
// API-Konfiguration mit Fallback-URLs
export const API_BASE_URL = {
primary: 'https://192.168.0.105:443',
fallbacks: [
'https://192.168.0.105',
'https://raspberrypi'
]
};
```
## 🖥️ Deployment-Szenarien
### Szenario 1: Separate Server (Empfohlen)
```bash
# systemd Journal
sudo journalctl -u myp.service -f
# Backend-Server (z.B. Raspberry Pi oder Linux-Server)
cd backend
sudo systemctl start myp-https.service
# Anwendungslogs
tail -f backend/app/logs/app/app.log
# Frontend-Server (z.B. Node.js-Server oder Cloud-Deployment)
cd frontend
npm run build && npm start
```
### Frontend
### Szenario 2: Docker-Deployment
```yaml
# docker-compose.yml
services:
backend:
build: ./backend
ports: ["5000:5000", "443:443"]
frontend:
build: ./frontend
ports: ["3000:3000"]
environment:
- NEXT_PUBLIC_API_URL=http://backend:5000/api
```
### Szenario 3: Raspberry Pi Kiosk (Lokal)
```bash
# Docker Logs
docker-compose logs -f
# Caddy Logs
docker-compose logs caddy
# Vollständige Kiosk-Installation
cd backend && sudo ./setup.sh
# Automatischer Start: Touch-Interface + Smart-Plug-Steuerung
```
### Kiosk-Modus
## 🔧 Konfiguration & Environment
### Backend-Konfiguration (.env)
```env
# Flask-Server Einstellungen
FLASK_HOST=0.0.0.0
FLASK_PORT=5000
SSL_ENABLED=true
DATABASE_URL=sqlite:///myp.db
# Smart-Plug Konfiguration (TP-Link Tapo P110)
TAPO_USERNAME=your-tapo-email
TAPO_PASSWORD=your-tapo-password
# Kiosk-Modus
KIOSK_MODE=true
OFFLINE_MODE=true
```
### Frontend-Konfiguration (.env.local)
```env
# Frontend-Server Einstellungen - Separater Backend-Server
NEXT_PUBLIC_API_URL=https://192.168.0.105:443
DATABASE_URL=file:./db/frontend.db
# SSL-Zertifikat Handling für selbstsignierte Zertifikate
NODE_TLS_REJECT_UNAUTHORIZED=0
# Analytics-Features
ENABLE_ADVANCED_ANALYTICS=true
CHART_REFRESH_INTERVAL=30000
```
## 📊 Features im Überblick
### Backend-Features (Till Tomczak) - Cyber-Physische Integration
- **TP-Link Tapo P110 Integration**: Lokale WLAN-Steckdosen-Steuerung
- **Automatische Zeitsteuerung**: Drucker Ein-/Ausschaltung nach Reservierung
- **Herstellerunabhängigkeit**: Keine direkten Drucker-Eingriffe erforderlich
- **Flask REST-APIs**: Vollständige CRUD-Operationen
- **SQLite-Datenbank**: Lokale Datenpersistenz ohne externe Abhängigkeiten
- **HTTPS-Verschlüsselung**: Selbstsignierte Zertifikate
- **Offline-Betrieb**: Vollständig autonomer Betrieb ohne Internet
- **Raspberry Pi Kiosk**: Touch-optimiertes Dashboard vor Ort
### Frontend-Features (Torben Haack) - Moderne Web-Oberfläche
- **Progressive Web App**: Offline-Funktionalität im Browser
- **React 18 + Next.js 14**: Moderne, performante Web-Technologien
- **Analytics-Dashboard**: Recharts-Visualisierungen für Nutzungsstatistiken
- **Responsive Design**: Optimiert für alle Endgeräte (Desktop/Tablet/Mobile)
- **Real-time Updates**: Live-Synchronisation mit Backend-APIs
- **Export-Funktionen**: PDF/Excel-Reports für Management-Analysen
- **Benutzerfreundlich**: Intuitive Workflows für alle Stakeholder
## 🛠️ Entwicklung
### Backend-Entwicklung (Till Tomczak)
```bash
# Backend Service
sudo systemctl status myp.service
# Kiosk-Browser Service
sudo systemctl status myp-kiosk-browser.service
# Kiosk-Browser Logs
sudo journalctl -u myp-kiosk-browser.service -f
cd backend
python -m venv venv
source venv/bin/activate # Linux/Mac
pip install -r requirements.txt
python app.py --debug
```
## 🔧 Services
### Backend Services
### Frontend-Entwicklung (Torben Haack)
```bash
# Backend starten/stoppen
sudo systemctl start myp.service
sudo systemctl stop myp.service
sudo systemctl restart myp.service
# Kiosk-Browser starten/stoppen (falls installiert)
sudo systemctl start myp-kiosk-browser.service
sudo systemctl stop myp-kiosk-browser.service
# Automatischen Start aktivieren/deaktivieren
sudo systemctl enable myp.service
sudo systemctl enable myp-kiosk-browser.service
cd frontend
pnpm install
pnpm db:migrate
pnpm dev
```
## 🆘 Troubleshooting
### MYP Control Center verwenden
### Integration testen
```bash
./myp_installer.sh
# → Option 6: Systemvoraussetzungen prüfen
# → Option 7: Anwendung starten
# Backend-APIs testen
curl http://localhost:5000/api/printers
# Frontend mit Backend-Integration
# Frontend auf :3000 konsumiert Backend-APIs von :5000
```
### Backend startet nicht
```bash
# Service Status prüfen
sudo systemctl status myp.service
## 📚 Dokumentation
# Logs prüfen
sudo journalctl -u myp.service --no-pager
### Backend-Dokumentation (Till Tomczak)
- [`backend/README.md`](backend/README.md) - Hardware-Setup & API-Dokumentation
- [`backend/docs/`](backend/docs/) - Raspberry Pi Konfiguration & Smart-Plug-Integration
# Zertifikate prüfen
ls -la backend/app/certs/
```
### Frontend-Dokumentation (Torben Haack)
- [`frontend/README.md`](frontend/README.md) - UI-Entwicklung & Analytics
- [`frontend/docs/`](frontend/docs/) - Component-Library & PWA-Features
### Frontend nicht erreichbar
```bash
# Container Status prüfen
docker-compose ps
### Gemeinsame Dokumentation
- [`docs/myp_documentation.md`](docs/myp_documentation.md) - Vollständige Projektdokumentation
- [`docs/DEPLOYMENT.md`](docs/DEPLOYMENT.md) - Production-Deployment-Guide
# Netzwerk prüfen
docker network ls
## 🤝 Projektphilosophie
# Zertifikate prüfen
ls -la frontend/certs/
```
### Cyber-Physische Vernetzung
MYP stellt eine **cyber-physische Lösung** dar, die **IT-System (Reservierungsplattform) und Hardware (Smart-Plugs und Drucker) eng vernetzt**. Das System überbrückt die digitale und physische Welt durch intelligente Automatisierung.
### Verbindungsprobleme
```bash
# DNS auflösen
nslookup raspberrypi
nslookup m040tbaraspi001.de040.corpintra.net
### Komplementäre Expertisen
- **Till Tomczak**: Spezialist für Hardware-Integration und cyber-physische Vernetzung
- **Torben Haack**: Spezialist für Frontend-Entwicklung und Datenanalyse
# Ports prüfen
netstat -tlnp | grep :443
```
### Gemeinsame Ziele
- **Digitalisierung**: Modernisierung des Reservierungsprozesses
- **Automatisierung**: Zeitgesteuerte Hardware-Steuerung ohne manuelle Eingriffe
- **Benutzerfreundlichkeit**: Intuitive Bedienung für alle Stakeholder
- **Effizienz**: Optimierte Ressourcennutzung und Energieeinsparung
## 📋 Version
## 👥 Entwicklerteam
- **Version**: 3.2-final
- **Control Center**: v4.0 mit v3.2 Integration
- **Build**: Production
- **Installer**: MYP Control Center
### Till Tomczak - **Backend-Infrastruktur & Hardware-Integration**
- **Cyber-Physische Systeme**: Smart-Plug-Integration und Hardware-Steuerung
- **System-Architektur**: Flask-APIs und SQLite-Datenbank-Design
- **DevOps**: Raspberry Pi Services und Produktions-Deployment
- **Offline-Systeme**: Autonomer Betrieb ohne Internet-Abhängigkeiten
## 👥 Support
### Torben Haack - **Frontend-Entwicklung & Analytics**
- **Progressive Web Apps**: Moderne Browser-Technologien und Offline-Features
- **User Interface**: React-Komponenten und responsive Design
- **Datenvisualisierung**: Charts, Dashboards und Analytics
- **API-Integration**: Nahtlose Backend-Anbindung und Real-time Updates
Bei Problemen verwenden Sie das MYP Control Center oder wenden Sie sich an das IT-Team des Mercedes-Benz Werk 040 Berlin.
## 📄 Lizenz
## 🖥️ Zwei-Server-Setup (Produktions-Architektur)
Dieses Projekt wurde für den internen Gebrauch bei Mercedes-Benz entwickelt.
Das MYP-System ist für eine **Zwei-Server-Architektur** optimiert:
---
### Server-Architektur
| Server | Hostname | Komponenten | URL |
|--------|----------|-------------|-----|
| **Frontend-Server** | `m040tbaraspi001.de040.corpintra.net` | Next.js + Docker + Caddy | `https://m040tbaraspi001.de040.corpintra.net` |
| **Backend-Server** | `raspberrypi` | Flask API + Web Interface + Kiosk | `https://raspberrypi` |
### 🚀 Server-spezifische Installation (Empfohlen)
Der `myp_installer.sh` erkennt automatisch den Server-Typ und bietet passende Installationsoptionen:
```bash
./myp_installer.sh
# Wählen Sie: "1. Server-spezifische Installation (Empfohlen)"
```
#### Frontend-Server (m040tbaraspi001)
```bash
# Automatische Erkennung: m040tbaraspi001.de040.corpintra.net
# Verfügbare Optionen:
# 1. Frontend installieren (Next.js + Docker)
# 2. Frontend Produktions-Deployment (Port 443 mit SSL)
# 3. Nur Docker & Dependencies installieren
```
#### Backend-Server (Raspberry Pi)
```bash
# Automatische Erkennung: raspberrypi
# Verfügbare Optionen:
# 1. Backend installieren (Flask API + Web Interface)
# 2. Kiosk-Modus installieren (Touch-Interface)
# 3. Produktions-Setup (Backend + Kiosk + Services)
# 4. Nur Python & Dependencies installieren
```
### 🔧 Manuelle Installation
#### Frontend-Server Setup
```bash
# Auf m040tbaraspi001.de040.corpintra.net
cd frontend/
npm install
docker-compose up -d
```
#### Backend-Server Setup
```bash
# Auf raspberrypi
cd backend/app/
python3.11 -m pip install -r requirements.txt
sudo systemctl start myp.service
sudo systemctl start myp-kiosk-browser.service # Optional: Kiosk-Modus
```
### 🌐 URLs & Zugriff
#### Frontend (m040tbaraspi001)
- **Haupt-URL**: `https://m040tbaraspi001.de040.corpintra.net`
- **Entwicklung**: `http://localhost:3000` (npm run dev)
- **Produktion**: `https://localhost:443` (Docker)
#### Backend (Raspberry Pi)
- **API**: `https://raspberrypi/api`
- **Web Interface**: `https://raspberrypi`
- **Kiosk-Modus**: `https://raspberrypi` (Vollbild-Touch-Interface)
### 🔗 Server-Kommunikation
Die Server kommunizieren über HTTPS:
- **Frontend → Backend**: `https://raspberrypi/api`
- **OAuth Callbacks**: `https://m040tbaraspi001.de040.corpintra.net/auth/login/callback`
- **Cross-Origin**: Automatisch konfiguriert für beide Domains
### 🛠️ Konfiguration
#### Frontend (.env.local)
```bash
# Backend-Verbindung
NEXT_PUBLIC_API_URL=https://raspberrypi
NEXT_PUBLIC_BACKEND_HOST=raspberrypi
# Frontend-URLs
NEXT_PUBLIC_FRONTEND_URL=https://m040tbaraspi001.de040.corpintra.net
NEXTAUTH_URL=https://m040tbaraspi001.de040.corpintra.net
```
#### Backend (config/settings.py)
```python
# Frontend-Verbindung
FRONTEND_URL = "https://m040tbaraspi001.de040.corpintra.net"
CORS_ORIGINS = ["https://m040tbaraspi001.de040.corpintra.net"]
# Kiosk-Konfiguration
KIOSK_MODE = True
KIOSK_AUTO_LOGIN = True
```
**Backend-System**: Till Tomczak (Cyber-Physische Vernetzung & Hardware-Integration)
**Frontend-System**: Torben Haack (Progressive Web App & Analytics)
**Architektur**: Microservices mit REST-API-Integration
**Technologie**: Flask + SQLite (Backend) + Next.js + React (Frontend)
**Hardware**: Raspberry Pi + TP-Link Tapo P110 Smart-Plugs
**Entwickelt für**: Mercedes-Benz Werk 040 Berlin MYP