🔧 Aktualisierung der README.md zur Verbesserung der Backend- und Frontend-Installationsanweisungen. Einführung eines konsolidierten Setup-Skripts für die automatische Installation und Optimierung der Kiosk-Modus-Anweisungen. Hinzufügen eines neuen Dokuments für Verbindungstests zwischen Frontend und Backend. Verbesserte Farbpalette und CSS-Styles für Kiosk-Modus in tailwind.config.js und input.css. 📈

This commit is contained in:
2025-06-01 23:53:00 +02:00
parent 6e09b86e88
commit de9cbe3740
27 changed files with 2339 additions and 3390 deletions

104
README.md
View File

@@ -73,51 +73,58 @@ Dieses Repository enthält **zwei sich ergänzende Projektarbeiten** für die IH
### Backend-System (Hardware & APIs)
```bash
# Backend-Server starten (Till Tomczaks System)
# Backend-Server automatisch installieren (Till Tomczaks System)
cd backend
sudo ./setup.sh # Automatische Installation
python app.py # Oder für Development
sudo ./setup.sh # Konsolidiertes Setup-Skript
# Kiosk-Modus auf Raspberry Pi
sudo systemctl start myp-https.service
# Oder manuell für Development
python app.py
```
### Frontend-System (Web-Interface)
### Frontend-System (Web-Interface) - NEU: Automatische Installation
```bash
# Frontend-Server starten (Torben Haacks System)
# Frontend-Server automatisch installieren (Torben Haacks System)
cd frontend
sudo ./setup.sh # Konsolidiertes Setup-Skript mit Mercedes SSL
# Oder manuell für Development
pnpm install
pnpm db # Datenbank einrichten
pnpm dev # Development-Server
# Produktions-Deployment
pnpm build && pnpm start
```
### Vollständiges System
```bash
# Backend (API-Server)
cd backend && python app.py --host 0.0.0.0 --port 5000 &
cd backend && sudo ./setup.sh
# Frontend (Web-Interface)
cd frontend && pnpm build && pnpm start &
# Frontend (Web-Interface mit HTTPS)
cd frontend && sudo ./setup.sh
```
## 🌐 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)
### Produktions-URLs (Nach Setup-Skript Installation)
- **Frontend (HTTPS)**: `https://m040tbaraspi001.de040.corpintra.net` (Torben Haacks Frontend)
- **Frontend (Lokal)**: `https://localhost` (Fallback-Zugang)
- **API-Backend**: `https://192.168.0.105:443/api` (Till Tomczaks APIs)
- **Kiosk-Modus**: `https://192.168.0.105:443` (Lokales Touch-Interface)
### Development-URLs
- **Frontend (Dev)**: `http://localhost:3000` (Development-Server)
- **Backend (Dev)**: `http://localhost:5000` (Development-API)
### 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)
### SSL-Zertifikate (Mercedes)
Nach der automatischen Installation sind selbstsignierte Mercedes-Zertifikate verfügbar:
- **Domain**: `m040tbaraspi001.de040.corpintra.net`
- **Organisation**: Mercedes-Benz AG
- **Abteilung**: IT-Abteilung
- **Standort**: Stuttgart, Baden-Württemberg
- **Gültigkeit**: 365 Tage
## 📁 Projektstruktur & Integration
@@ -222,7 +229,18 @@ export const API_BASE_URL = {
## 🖥️ Deployment-Szenarien
### Szenario 1: Separate Server (Empfohlen)
### Szenario 1: Automatische Produktions-Installation (Neu - Empfohlen)
```bash
# Backend-Server (Raspberry Pi oder Linux-Server)
cd backend
sudo ./setup.sh # Automatische Installation mit Kiosk-Modus
# Frontend-Server (separater Server oder gleicher Server)
cd frontend
sudo ./setup.sh # Automatische Installation mit HTTPS auf Port 443
```
### Szenario 2: Separate Server (Manuell)
```bash
# Backend-Server (z.B. Raspberry Pi oder Linux-Server)
cd backend
@@ -233,7 +251,7 @@ cd frontend
npm run build && npm start
```
### Szenario 2: Docker-Deployment
### Szenario 3: Docker-Deployment
```yaml
# docker-compose.yml
services:
@@ -243,16 +261,16 @@ services:
frontend:
build: ./frontend
ports: ["3000:3000"]
ports: ["80:80", "443:443"]
environment:
- NEXT_PUBLIC_API_URL=http://backend:5000/api
```
### Szenario 3: Raspberry Pi Kiosk (Lokal)
### Szenario 4: Raspberry Pi Kiosk (Lokal)
```bash
# Vollständige Kiosk-Installation
cd backend && sudo ./setup.sh
# Automatischer Start: Touch-Interface + Smart-Plug-Steuerung
# Vollständige Kiosk-Installation (Backend + Frontend)
cd backend && sudo ./setup.sh # Backend mit Kiosk-Interface
cd frontend && sudo ./setup.sh # Frontend mit HTTPS-Server
```
## 🔧 Konfiguration & Environment
@@ -276,7 +294,7 @@ OFFLINE_MODE=true
### Frontend-Konfiguration (.env.local)
```env
# Frontend-Server Einstellungen - Separater Backend-Server
# Frontend-Server Einstellungen - HTTPS mit Mercedes SSL
NEXT_PUBLIC_API_URL=https://192.168.0.105:443
DATABASE_URL=file:./db/frontend.db
@@ -286,6 +304,11 @@ NODE_TLS_REJECT_UNAUTHORIZED=0
# Analytics-Features
ENABLE_ADVANCED_ANALYTICS=true
CHART_REFRESH_INTERVAL=30000
# Production HTTPS (Nach Setup-Skript)
HTTPS_ENABLED=true
SSL_CERT_PATH=/etc/ssl/certs/myp/frontend.crt
SSL_KEY_PATH=/etc/ssl/certs/myp/frontend.key
```
## 📊 Features im Überblick
@@ -321,6 +344,14 @@ python app.py --debug
```
### Frontend-Entwicklung (Torben Haack)
#### Automatische Installation (Empfohlen)
```bash
cd frontend
sudo ./setup.sh # Interaktives Setup-Menü
```
#### Manuelle Entwicklung
```bash
cd frontend
pnpm install
@@ -328,13 +359,26 @@ pnpm db:migrate
pnpm dev
```
#### Frontend-Setup-Skript Features
Das neue `frontend/setup.sh` bietet:
- **Vollständige Installation**: Docker, SSL-Zertifikate, Caddy Reverse Proxy
- **Mercedes SSL-Zertifikate**: Selbstsignierte Zertifikate für `m040tbaraspi001.de040.corpintra.net`
- **Automatischer HTTPS-Server**: Verfügbar auf Port 443 (nicht 3000)
- **Systemd-Integration**: Automatischer Start beim Boot
- **Interaktives Menü**:
1. Vollständige Frontend-Installation
2. SSL-Zertifikate neu generieren
3. Service-Status prüfen
4. Beenden
### Integration testen
```bash
# Backend-APIs testen
curl http://localhost:5000/api/printers
# Frontend mit Backend-Integration
# Frontend auf :3000 konsumiert Backend-APIs von :5000
# Frontend mit HTTPS (nach Setup-Skript)
curl -k https://m040tbaraspi001.de040.corpintra.net/health
curl -k https://localhost/health
```
## 📚 Dokumentation