-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_dms.bat
More file actions
47 lines (38 loc) · 1.64 KB
/
Copy pathstart_dms.bat
File metadata and controls
47 lines (38 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
@echo off
title DMS - System Launcher
echo =======================================================
echo Starting Distribution Management System (DMS)
echo =======================================================
echo.
echo Note: Ensure your local PostgreSQL Windows service is running!
echo.
echo Launching Backend API (dms-api on Port 3000)...
:: Using cmd /c instead of /k so the window terminates when the process is killed
start "DMS_BACKEND" cmd /c "title DMS_BACKEND&& color 0A && cd dms-api && npx tsc && echo Starting Server... && node dist/server.js"
echo Launching Frontend UI (dms-web via Vite)...
start "DMS_FRONTEND" cmd /c "title DMS_FRONTEND&& color 0B && cd dms-web && npm run dev"
echo.
echo Waiting for both servers to initialize and bind to ports...
timeout /t 5 /nobreak > nul
echo.
echo Opening Application in Default Browser...
start http://localhost:5173
echo.
echo =======================================================
echo All systems go! The services are running in background windows.
echo.
echo PRESS ANY KEY TO STOP SERVERS AND CLOSE TERMINALS
echo =======================================================
pause > nul
echo.
echo Shutting down frontend server...
taskkill /FI "WINDOWTITLE eq DMS_FRONTEND*" /T /F > nul 2>&1
echo Shutting down backend server...
taskkill /FI "WINDOWTITLE eq DMS_BACKEND*" /T /F > nul 2>&1
:: Absolute fallback to guarantee the ports are freed and windows close instantly
taskkill /IM node.exe /F > nul 2>&1
:: Force kill any orphaned cmd windows we launched
taskkill /FI "WINDOWTITLE eq DMS_*" /T /F > nul 2>&1
echo.
echo Servers successfully stopped and terminals closed. Goodbye!
timeout /t 2 > nul