-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.bat
More file actions
128 lines (108 loc) · 2.62 KB
/
setup.bat
File metadata and controls
128 lines (108 loc) · 2.62 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
@echo off
setlocal enabledelayedexpansion
REM CSEMInsight Cross-Platform Setup Script (Windows)
echo 🌊 Setting up CSEMInsight - Marine CSEM Data Visualization Toolkit
echo ==================================================================
REM Check if Node.js is installed
node --version >nul 2>&1
if errorlevel 1 (
echo ❌ Node.js is not installed. Please install Node.js (v22+) first.
echo Download from: https://nodejs.org/
pause
exit /b 1
)
REM Check if Python is installed
python --version >nul 2>&1
if errorlevel 1 (
echo ❌ Python is not installed. Please install Python (3.12+) first.
echo Download from: https://python.org/
echo Make sure to check "Add Python to PATH" during installation.
pause
exit /b 1
)
echo ✅ Node.js version:
node --version
echo ✅ Python version:
python --version
REM Detect package manager
set PACKAGE_MANAGER=
bun --version >nul 2>&1
if not errorlevel 1 (
set PACKAGE_MANAGER=bun
echo ✅ Using Bun package manager
goto :package_manager_found
)
yarn --version >nul 2>&1
if not errorlevel 1 (
set PACKAGE_MANAGER=yarn
echo ✅ Using Yarn package manager
goto :package_manager_found
)
npm --version >nul 2>&1
if not errorlevel 1 (
set PACKAGE_MANAGER=npm
echo ✅ Using npm package manager
goto :package_manager_found
)
echo ❌ No package manager found. Please install npm, yarn, or bun.
pause
exit /b 1
:package_manager_found
echo.
echo 🔧 Setting up Frontend...
cd frontend
if "%PACKAGE_MANAGER%"=="bun" (
bun install
) else if "%PACKAGE_MANAGER%"=="yarn" (
yarn install
) else (
npm install
)
if errorlevel 1 (
echo ❌ Frontend setup failed
pause
exit /b 1
)
echo ✅ Frontend dependencies installed
echo.
echo 🐍 Setting up Backend...
cd ..\backend
REM Create virtual environment
python -m venv env
if errorlevel 1 (
echo ❌ Failed to create virtual environment
pause
exit /b 1
)
REM Activate virtual environment
call env\Scripts\activate.bat
REM Install dependencies
pip install -r requirements.txt
if errorlevel 1 (
echo ❌ Backend setup failed
pause
exit /b 1
)
echo ✅ Backend dependencies installed
echo.
echo 🎉 Setup Complete!
echo.
echo To start the application:
echo 1. Start the backend server:
echo cd backend
echo env\Scripts\activate
echo python main.py
echo.
echo 2. In a new terminal, start the frontend:
echo cd frontend
if "%PACKAGE_MANAGER%"=="bun" (
echo bun run dev:bun
) else (
echo %PACKAGE_MANAGER% run dev
)
echo.
echo 3. Open http://localhost:5173 in your browser
echo.
echo 📖 For more information, see README.md
echo.
pause