forked from Rushikesh5102/GovAssist
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_and_run.bat
More file actions
122 lines (110 loc) · 3.84 KB
/
Copy pathinstall_and_run.bat
File metadata and controls
122 lines (110 loc) · 3.84 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
@echo off
setlocal enabledelayedexpansion
:: This script will run with a pause at the end if it fails, to prevent "black flash"
echo ===================================================
echo GovAssist - Automated Setup ^& Run Script
echo ===================================================
echo.
echo This script will automatically install all required
echo dependencies and start the application.
echo.
echo [1/4] Checking prerequisites...
:: Check for Python
where python >nul 2>nul
if !errorlevel! neq 0 (
echo Python is missing. Attempting to install via Windows Package Manager winget...
where winget >nul 2>nul
if !errorlevel! equ 0 (
echo Installing Python 3.11...
winget install -e --id Python.Python.3.11 --accept-package-agreements --accept-source-agreements
if !errorlevel! neq 0 (
echo Failed to install Python automatically.
echo Please install it manually from: https://www.python.org/downloads/
goto :error
)
echo.
echo ===================================================
echo Python installed successfully!
echo PLEASE RESTART THIS SCRIPT to continue.
echo ===================================================
pause
exit
) else (
echo ERROR: Python is not installed and winget is not available.
echo Please install Python 3.10+ manually: https://www.python.org/downloads/
goto :error
)
)
:: Check for Node.js/npm
where npm >nul 2>nul
if !errorlevel! neq 0 (
echo Node.js is missing. Attempting to install via Windows Package Manager winget...
where winget >nul 2>nul
if !errorlevel! equ 0 (
echo Installing Node.js LTS...
winget install -e --id OpenJS.NodeJS.LTS --accept-package-agreements --accept-source-agreements
if !errorlevel! neq 0 (
echo Failed to install Node.js automatically.
echo Please install it manually from: https://nodejs.org/
goto :error
)
echo.
echo ===================================================
echo Node.js installed successfully!
echo PLEASE RESTART THIS SCRIPT to continue.
echo ===================================================
pause
exit
) else (
echo ERROR: Node.js is not installed and winget is not available.
echo Please install Node.js manually: https://nodejs.org/
goto :error
)
)
echo Prerequisites found!
echo.
echo [2/4] Installing Backend Dependencies...
cd backend
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
if !errorlevel! neq 0 (
echo ERROR: Failed to install Python dependencies.
goto :error
)
cd ..
echo Backend dependencies installed successfully!
echo.
echo [3/4] Installing Frontend Dependencies...
cd frontend
call npm install
if !errorlevel! neq 0 (
echo ERROR: Failed to install Node dependencies.
goto :error
)
cd ..
echo Frontend dependencies installed successfully!
echo.
echo [4/4] Starting GovAssist...
echo.
echo Starting Backend...
start "GovAssist Backend" cmd /k "cd backend && python -m uvicorn app.main:app --host 0.0.0.0 --port 8001 --reload"
echo Starting Frontend...
start "GovAssist Frontend" cmd /k "cd frontend && npm run dev"
echo.
echo Website will automatically open in your default browser once Vite is ready.
echo.
echo ===================================================
echo GovAssist is now running!
echo Frontend: http://localhost:5102
echo Backend: http://localhost:8001/docs
echo ===================================================
echo You can close this window. The servers are running in the new terminals.
pause
exit
:error
echo.
echo ===================================================
echo An error occurred. Please fix the issue and try again.
echo ===================================================
pause
exit /b 1