-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.bat
More file actions
99 lines (83 loc) · 2.25 KB
/
start.bat
File metadata and controls
99 lines (83 loc) · 2.25 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
@echo off
echo 🚀 Starting SubGuard Application...
echo 📋 Checking prerequisites...
REM Check if MongoDB is running
tasklist /FI "IMAGENAME eq mongod.exe" 2>NUL | find /I /N "mongod.exe">NUL
if "%ERRORLEVEL%"=="0" (
echo ✅ MongoDB is running
) else (
echo ❌ MongoDB is not running. Please start MongoDB first.
echo On Windows: net start MongoDB
pause
exit /b 1
)
REM Check if Node.js is installed
node --version >nul 2>&1
if %errorlevel% neq 0 (
echo ❌ Node.js is not installed. Please install Node.js 16+ first.
pause
exit /b 1
)
echo ✅ Node.js is installed
REM Check if Python is installed
python --version >nul 2>&1
if %errorlevel% neq 0 (
echo ❌ Python is not installed. Please install Python 3.8+ first.
pause
exit /b 1
)
echo ✅ Python is installed
echo 📁 Creating necessary directories...
if not exist "backend\uploads" mkdir backend\uploads
if not exist "logs" mkdir logs
echo 📦 Installing backend dependencies...
cd backend
if not exist "node_modules" (
npm install
)
cd ..
echo 📦 Installing frontend dependencies...
cd Hacktproject
if not exist "node_modules" (
npm install
)
cd ..
echo 📦 Installing NLP service dependencies...
cd nlp_service
if not exist "venv" (
python -m venv venv
)
call venv\Scripts\activate.bat
pip install -r requirements.txt
cd ..
echo 🔧 Checking environment configuration...
if not exist "backend\.env" (
echo ⚠️ backend\.env not found. Creating from template...
copy "backend\.env.example" "backend\.env"
echo 📝 Please edit backend\.env with your configuration
)
echo 🎯 Starting services...
echo 🤖 Starting NLP service...
cd nlp_service
start "NLP Service" cmd /k "venv\Scripts\activate.bat && python app.py"
cd ..
timeout /t 3 /nobreak >nul
echo 🔧 Starting backend API...
cd backend
start "Backend API" cmd /k "npm run dev"
cd ..
timeout /t 5 /nobreak >nul
echo 🎨 Starting frontend...
cd Hacktproject
start "Frontend" cmd /k "npm start"
cd ..
echo.
echo 🎉 SubGuard Application Started Successfully!
echo.
echo 📱 Frontend: http://localhost:3000
echo 🔧 Backend API: http://localhost:5000
echo 🤖 NLP Service: http://localhost:5001
echo.
echo 🛑 To stop all services, close the command windows or run stop.bat
echo.
pause