# MYP Platform - Windows Installation ## Überblick Das MYP (Multi-User-Print) System ist ein Flask-basiertes Backend für Druckerverwaltung, das vollständig auf Windows kompatibel ist. ## Systemanforderungen - Windows 10/11 - Python 3.8+ - Git (optional) - Internetverbindung für Paketinstallation ## Installation ### 1. Python-Abhängigkeiten installieren ```powershell # Im Projektverzeichnis pip install -r requirements.txt ``` ### 2. Datenbank initialisieren ```powershell python -c "from models import init_database, create_initial_admin; init_database(); create_initial_admin()" ``` ### 3. Anwendung starten ```powershell python app.py ``` ## Automatischer Start (Windows Service) ### Service-Wrapper erstellen Das System kann als Windows-Service installiert werden. ### PowerShell-Skript für automatischen Start ```powershell # start-myp.ps1 $env:FLASK_ENV = "production" $env:FLASK_APP = "app.py" python app.py ``` ## Verfügbare Endpunkte - **Frontend**: http://localhost:5000 - **API**: http://localhost:5000/api/ - **Admin**: http://localhost:5000/admin ## Standard-Login - **Benutzername**: admin@admin.de - **Passwort**: admin ## Konfiguration ### Ports anpassen In `app.py` am Ende der Datei: ```python if __name__ == "__main__": app.run(host="0.0.0.0", port=5000, debug=False) ``` ### SSL/HTTPS aktivieren ```python # SSL-Kontext für HTTPS ssl_context = ('cert.pem', 'key.pem') app.run(host="0.0.0.0", port=443, ssl_context=ssl_context) ``` ## Fehlerbehebung ### Port bereits in Verwendung ```powershell # Prozess finden und beenden netstat -ano | findstr :5000 taskkill /PID [PID] /F ``` ### Python-Module fehlen ```powershell pip install --upgrade pip pip install -r requirements.txt --force-reinstall ``` ### Datenbankfehler ```powershell # Datenbank zurücksetzen del database\myp.db python -c "from models import init_database, create_initial_admin; init_database(); create_initial_admin()" ``` ## Entwicklungsmodus ```powershell $env:FLASK_ENV = "development" $env:FLASK_DEBUG = "1" python app.py ``` ## Logs - **Anwendung**: `logs/app/` - **Authentifizierung**: `logs/auth/` - **Fehler**: `logs/errors/` - **Jobs**: `logs/jobs/` ## Windows-spezifische Features - Automatische Windows-Kompatibilitätsfixes - WMI-Integration für Systemüberwachung - Windows-Event-Log-Integration - Windows-Service-Support ## Sicherheit - CSRF-Schutz aktiviert - Rate-Limiting implementiert - Sichere Session-Verwaltung - SQL-Injection-Schutz ## Performance-Optimierung - SQLite-Optimierungen für Windows - Caching-Strategien - Asynchrone Task-Verarbeitung - Memory-Management