erste Fassung von Client und Server rein

This commit is contained in:
mistangl
2026-04-16 13:34:05 +02:00
parent f44949f0af
commit 5b38af78f0
19 changed files with 589 additions and 0 deletions

74
bin/client.bat Normal file
View File

@@ -0,0 +1,74 @@
@echo off
REM ================================================================
REM PLANTPLAN - Client (Vite Dev-Server) verwalten
REM Verwendung: client.bat [start|stop|reload|status]
REM ================================================================
call "%~dp0setenv.bat"
if "%1"=="" goto usage
if /i "%1"=="start" goto start
if /i "%1"=="stop" goto stop
if /i "%1"=="reload" goto reload
if /i "%1"=="status" goto status
goto usage
:start
echo Starting PlantPlan Client (Vite) ...
REM Pruefen ob Client bereits laeuft
tasklist /FI "WINDOWTITLE eq PlantPlan-Client" 2>nul | find /i "cmd.exe" >nul
if not errorlevel 1 (
echo Client laeuft bereits!
goto end
)
REM Pruefen ob node_modules existiert
if not exist "%PV_CLIENT%\node_modules" (
echo FEHLER: node_modules nicht gefunden! Bitte zuerst install_npm.bat ausfuehren.
goto end
)
start "PlantPlan-Client" cmd /k "cd /d "%PV_CLIENT%" && npm run dev"
echo Client gestartet auf %PV_CLIENT_URL%
goto end
:stop
echo Stopping PlantPlan Client ...
taskkill /FI "WINDOWTITLE eq PlantPlan-Client" /T /F >nul 2>&1
if errorlevel 1 (
echo Client war nicht gestartet.
) else (
echo Client gestoppt.
)
goto end
:reload
echo Reloading PlantPlan Client ...
call :stop
timeout /t 2 /nobreak >nul
call :start
goto end
:status
tasklist /FI "WINDOWTITLE eq PlantPlan-Client" 2>nul | find /i "cmd.exe" >nul
if not errorlevel 1 (
echo Client: LAEUFT
) else (
echo Client: GESTOPPT
)
goto end
:usage
echo.
echo Verwendung: client.bat [start^|stop^|reload^|status]
echo.
echo start - Client starten (Vite Dev-Server)
echo stop - Client stoppen
echo reload - Client neu starten
echo status - Pruefen ob Client laeuft
echo.
:end

18
bin/install_npm.bat Normal file
View File

@@ -0,0 +1,18 @@
@echo off
REM ================================================================
REM PLANTPLAN - Node.js Packages fuer Client installieren
REM ================================================================
REM Fuehrt npm install im client/ Verzeichnis aus
REM ================================================================
call "%~dp0setenv.bat"
if not exist "%PV_CLIENT%\node_modules" (
echo Installiere Node.js Packages fuer Client...
cd /d "%PV_CLIENT%"
npm install
echo Erfolgreich.
) else (
echo Node.js Packages bereits installiert!
echo Zum Aktualisieren: cd client ^& npm install
)

19
bin/install_npm.sh Normal file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
# ================================================================
# PLANTPLAN - Node.js Packages fuer Client installieren
# ================================================================
# Fuehrt npm install im client/ Verzeichnis aus
# ================================================================
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/setenv.sh"
if [ ! -d "$PV_CLIENT/node_modules" ]; then
echo "Installiere Node.js Packages fuer Client..."
cd "$PV_CLIENT"
npm install
echo "Erfolgreich."
else
echo "Node.js Packages bereits installiert!"
echo "Zum Aktualisieren: cd client && npm install"
fi

74
bin/server.bat Normal file
View File

@@ -0,0 +1,74 @@
@echo off
REM ================================================================
REM PLANTPLAN - Server (FastAPI/Uvicorn) verwalten
REM Verwendung: server.bat [start|stop|reload|status]
REM ================================================================
call "%~dp0setenv.bat"
if "%1"=="" goto usage
if /i "%1"=="start" goto start
if /i "%1"=="stop" goto stop
if /i "%1"=="reload" goto reload
if /i "%1"=="status" goto status
goto usage
:start
echo Starting PlantPlan Server (uvicorn) ...
REM Pruefen ob Server bereits laeuft
tasklist /FI "WINDOWTITLE eq PlantPlan-Server" 2>nul | find /i "cmd.exe" >nul
if not errorlevel 1 (
echo Server laeuft bereits!
goto end
)
REM Pruefen ob venv existiert
if not exist "%PROJECT%\.venv\Scripts\activate.bat" (
echo FEHLER: .venv nicht gefunden! Bitte zuerst install_py.bat ausfuehren.
goto end
)
start "PlantPlan-Server" cmd /k "cd /d "%PV_SERVER%" && "%PROJECT%\.venv\Scripts\activate.bat" && uvicorn main:app --reload --host %PV_SERVER_HOST% --port %PV_SERVER_PORT%"
echo Server gestartet auf %PV_SERVER_URL%
goto end
:stop
echo Stopping PlantPlan Server ...
taskkill /FI "WINDOWTITLE eq PlantPlan-Server" /T /F >nul 2>&1
if errorlevel 1 (
echo Server war nicht gestartet.
) else (
echo Server gestoppt.
)
goto end
:reload
echo Reloading PlantPlan Server ...
call :stop
timeout /t 2 /nobreak >nul
call :start
goto end
:status
tasklist /FI "WINDOWTITLE eq PlantPlan-Server" 2>nul | find /i "cmd.exe" >nul
if not errorlevel 1 (
echo Server: LAEUFT
) else (
echo Server: GESTOPPT
)
goto end
:usage
echo.
echo Verwendung: server.bat [start^|stop^|reload^|status]
echo.
echo start - Server starten (uvicorn mit --reload)
echo stop - Server stoppen
echo reload - Server neu starten
echo status - Pruefen ob Server laeuft
echo.
:end

View File

@@ -20,6 +20,15 @@ set "PV_LOG=%PROJECT%\log"
set "PV_TESTS=%PROJECT%\tests"
set "PV_RESULTS=%PROJECT%\results"
set "PV_EXAMPLES=%PROJECT%\examples"
set "PV_CLIENT=%PROJECT%\client"
set "PV_SERVER=%PROJECT%\server"
REM Netzwerk-Konfiguration
set "PV_SERVER_HOST=127.0.0.1"
set "PV_SERVER_PORT=8000"
set "PV_CLIENT_PORT=5173"
set "PV_SERVER_URL=http://%PV_SERVER_HOST%:%PV_SERVER_PORT%"
set "PV_CLIENT_URL=http://localhost:%PV_CLIENT_PORT%"
REM Python-Pfad erweitern (nur wenn noch nicht vorhanden)
echo %PYTHONPATH% | find /i "%PV_LIB%" >nul
@@ -35,6 +44,8 @@ if not exist "%PV_DATA%" mkdir "%PV_DATA%"
if not exist "%PV_LOG%" mkdir "%PV_LOG%"
if not exist "%PV_RESULTS%" mkdir "%PV_RESULTS%"
if not exist "%PV_EXAMPLES%" mkdir "%PV_EXAMPLES%"
if not exist "%PV_CLIENT%" mkdir "%PV_CLIENT%"
if not exist "%PV_SERVER%" mkdir "%PV_SERVER%"
REM Umgebungsvariablen anzeigen
echo.
@@ -47,6 +58,10 @@ echo PV_DATA = %PV_DATA%
echo PV_RESULTS = %PV_RESULTS%
echo PV_LOG = %PV_LOG%
echo PV_EXAMPLES = %PV_EXAMPLES%
echo PV_CLIENT = %PV_CLIENT%
echo PV_SERVER = %PV_SERVER%
echo PV_SERVER_URL = %PV_SERVER_URL%
echo PV_CLIENT_URL = %PV_CLIENT_URL%
echo PYTHONPATH = %PYTHONPATH%
echo ================================================================
echo.

View File

@@ -19,8 +19,17 @@ export PV_CFG="$PROJECT/cfg"
export PV_LOG="$PROJECT/log"
export PV_TESTS="$PROJECT/tests"
export PV_RESULTS="$PROJECT/results"
export PV_CLIENT="$PROJECT/client"
export PV_SERVER="$PROJECT/server"
export PV_EXAMPLES="$PROJECT/examples"
# Netzwerk-Konfiguration
export PV_SERVER_HOST="127.0.0.1"
export PV_SERVER_PORT="8000"
export PV_CLIENT_PORT="5173"
export PV_SERVER_URL="http://$PV_SERVER_HOST:$PV_SERVER_PORT"
export PV_CLIENT_URL="http://localhost:$PV_CLIENT_PORT"
# Python-Pfad erweitern (nur wenn noch nicht vorhanden)
if [[ ":$PYTHONPATH:" != *":$PV_LIB:"* ]]; then
export PYTHONPATH="$PV_LIB:$PYTHONPATH"
@@ -40,7 +49,11 @@ echo "PV_LIB = $PV_LIB"
echo "PV_DATA = $PV_DATA"
echo "PV_RESULTS = $PV_RESULTS"
echo "PV_LOG = $PV_LOG"
echo "PV_CLIENT = $PV_CLIENT"
echo "PV_SERVER = $PV_SERVER"
echo "PV_EXAMPLES = $PV_EXAMPLES"
echo "PV_SERVER_URL = $PV_SERVER_URL"
echo "PV_CLIENT_URL = $PV_CLIENT_URL"
echo "PYTHONPATH = $PYTHONPATH"
echo "================================================================"
echo ""

21
bin/start.bat Normal file
View File

@@ -0,0 +1,21 @@
@echo off
REM ================================================================
REM PLANTPLAN - Server und Client gemeinsam starten
REM ================================================================
call "%~dp0setenv.bat"
echo ================================================================
echo PlantPlan - Starte Server und Client ...
echo ================================================================
echo.
call "%~dp0server.bat" start
call "%~dp0client.bat" start
echo.
echo ================================================================
echo Server: %PV_SERVER_URL%
echo Client: %PV_CLIENT_URL%
echo ================================================================

17
bin/stop.bat Normal file
View File

@@ -0,0 +1,17 @@
@echo off
REM ================================================================
REM PLANTPLAN - Server und Client gemeinsam stoppen
REM ================================================================
echo ================================================================
echo PlantPlan - Stoppe Server und Client ...
echo ================================================================
echo.
call "%~dp0server.bat" stop
call "%~dp0client.bat" stop
echo.
echo Alle Prozesse gestoppt.
echo ================================================================