-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.bat
More file actions
86 lines (77 loc) · 2.76 KB
/
Copy pathstart.bat
File metadata and controls
86 lines (77 loc) · 2.76 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
@echo off
title LapScore — Starting...
color 0A
echo.
echo ██╗ █████╗ ██████╗ ███████╗ ██████╗ ██████╗ ██████╗ ███████╗
echo ██║ ██╔══██╗██╔══██╗██╔════╝██╔════╝██╔════╝██╔══██╗██╔════╝
echo ██║ ███████║██████╔╝███████╗██║ ██║ ██████╔╝█████╗
echo ██║ ██╔══██║██╔═══╝ ╚════██║██║ ██║ ██╔══██╗██╔══╝
echo ███████╗██║ ██║██║ ███████║╚██████╗╚██████╗██║ ██║███████╗
echo ╚══════╝╚═╝ ╚═╝╚═╝ ╚══════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝
echo.
echo Your PC's health. Scored. Explained. Fixed.
echo ─────────────────────────────────────────────────
echo.
:: Check if Node.js is installed
node --version >nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] Node.js is not installed.
echo.
echo Please install Node.js first:
echo https://nodejs.org (download the LTS version)
echo.
echo After installing Node.js, double-click this
echo file again.
echo.
pause
exit /b 1
)
:: Check if setup is needed (node_modules missing)
if not exist "node_modules\" (
echo [SETUP] First run detected. Installing...
echo This takes about 2 minutes. Please wait.
echo.
call npm install
if %errorlevel% neq 0 (
echo [ERROR] npm install failed.
echo Try running as Administrator.
pause
exit /b 1
)
)
if not exist "client\node_modules\" (
echo [SETUP] Installing dashboard components...
cd client
call npm install
if %errorlevel% neq 0 (
echo [ERROR] Client install failed.
pause
exit /b 1
)
cd ..
)
:: Build React if dist folder missing or empty
if not exist "client\dist\index.html" (
echo [BUILD] Building dashboard...
cd client
call npm run build
if %errorlevel% neq 0 (
echo [ERROR] Build failed.
pause
exit /b 1
)
cd ..
)
:: All checks passed — start the server
echo [OK] Starting LapScore...
echo.
echo Dashboard will open at:
echo http://localhost:7821
echo.
echo Press Ctrl+C to stop.
echo.
:: Open browser after 2 second delay
start /b cmd /c "timeout /t 2 /nobreak >nul && start http://localhost:7821"
:: Start the server
node server/index.js
pause