-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.bat
More file actions
147 lines (133 loc) · 4.6 KB
/
Copy pathsetup.bat
File metadata and controls
147 lines (133 loc) · 4.6 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
@echo off
REM ============================================================================
REM ANALISI TRACKER - SETUP SCRIPT
REM ============================================================================
REM One-time setup for Windows systems
REM ============================================================================
setlocal enabledelayedexpansion
echo ==========================================================================
echo Analisi Tracker - Setup
echo ==========================================================================
echo.
REM 1. Check Node.js installation
echo [1/8] Checking Node.js installation...
where node >nul 2>nul
if %errorlevel% neq 0 (
echo [ERROR] Node.js is not installed!
echo.
echo Please install Node.js from: https://nodejs.org/
echo Recommended version: 18.x or higher
pause
exit /b 1
)
for /f "tokens=*" %%i in ('node -v') do set NODE_VERSION=%%i
echo [OK] Node.js found: %NODE_VERSION%
REM Check if version is 18 or higher
for /f "tokens=1 delims=v." %%a in ("%NODE_VERSION%") do set NODE_MAJOR=%%a
if %NODE_MAJOR% lss 18 (
echo [WARN] Node.js 18+ recommended (you have %NODE_VERSION%)
echo The app may still work, but consider upgrading for best compatibility.
)
echo.
REM 2. Check npm installation
echo [2/8] Checking npm installation...
where npm >nul 2>nul
if %errorlevel% neq 0 (
echo [ERROR] npm is not installed!
echo npm should be installed with Node.js. Please reinstall Node.js.
pause
exit /b 1
)
for /f "tokens=*" %%i in ('npm -v') do set NPM_VERSION=%%i
echo [OK] npm found: %NPM_VERSION%
echo.
REM 3. Create .env file if it doesn't exist
echo [3/8] Setting up environment configuration...
if not exist .env (
if exist .env.local (
echo Creating .env from .env.local...
copy .env.local .env >nul
echo [OK] Created .env file
) else if exist .env.example (
echo Creating .env from .env.example...
copy .env.example .env >nul
echo [OK] Created .env file
) else (
echo Creating minimal .env file...
echo PORT=3000 > .env
echo NODE_ENV=development >> .env
echo [OK] Created .env file
)
) else (
echo [INFO] .env file already exists (skipping)
)
echo.
REM 4. Create necessary directories
echo [4/8] Creating necessary directories...
if not exist "data\processed" mkdir "data\processed"
if not exist "logs" mkdir "logs"
if not exist "exports" mkdir "exports"
echo [OK] Created directories
echo.
REM 5. Install root dependencies
echo [5/8] Installing root dependencies...
if not exist "node_modules" (
call npm install
echo [OK] Root dependencies installed
) else (
echo [INFO] Root node_modules exists (skipping npm install)
)
echo.
REM 6. Install client dependencies
echo [6/8] Installing client dependencies...
if not exist "client\node_modules" (
cd client
call npm install
cd ..
echo [OK] Client dependencies installed
) else (
echo [INFO] Client node_modules exists (skipping npm install)
)
echo.
REM 7. Initialize lab data
echo [7/8] Initializing lab data...
if not exist "data\lab-data.json" (
if exist "data\lab-data-initial.json" (
echo Creating lab-data.json with Chiara and Causio sample data...
copy data\lab-data-initial.json data\lab-data.json >nul
echo [OK] Created lab-data.json with sample patients
) else if exist "data\sample-data.json" (
echo Creating lab-data.json from sample data...
copy data\sample-data.json data\lab-data.json >nul
echo [OK] Created lab-data.json
) else (
echo Creating minimal lab-data.json...
echo { > data\lab-data.json
echo "labTests": {}, >> data\lab-data.json
echo "context": { >> data\lab-data.json
echo "medications": [], >> data\lab-data.json
echo "events": [] >> data\lab-data.json
echo } >> data\lab-data.json
echo } >> data\lab-data.json
echo [OK] Created minimal lab-data.json
)
) else (
echo [INFO] lab-data.json already exists (skipping)
)
echo.
REM 8. Setup complete
echo ==========================================================================
echo [SUCCESS] Setup Complete!
echo ==========================================================================
echo.
echo Next steps:
echo 1. Review .env file (optional - all features work with defaults)
echo 2. Add API keys to .env if you want AI features (optional)
echo 3. Run: start.bat
echo.
echo Your app will be available at: http://localhost:3000
echo.
echo For more information, see QUICKSTART.md
echo ==========================================================================
echo.
pause