-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart.bat
More file actions
95 lines (82 loc) · 2.46 KB
/
Copy pathstart.bat
File metadata and controls
95 lines (82 loc) · 2.46 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
@echo off
setlocal enabledelayedexpansion
echo ============================================
echo Ops Digital Employee - Startup Script
echo ============================================
echo.
REM --- Get project root ---
set "PROJECT_DIR=%~dp0"
set "VENV_DIR=%PROJECT_DIR%venv"
REM --- Check Python ---
python --version >nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] Python not found. Please install Python 3.10+
pause
exit /b 1
)
echo [OK] Python detected
REM --- Create/activate venv ---
if not exist "%VENV_DIR%\Scripts\python.exe" (
echo [STEP] Creating virtual environment...
python -m venv "%VENV_DIR%"
)
call "%VENV_DIR%\Scripts\activate.bat"
if %errorlevel% neq 0 (
echo [ERROR] Failed to activate venv
pause
exit /b 1
)
echo [OK] Virtual environment activated
REM --- Check Ollama ---
ollama --version >nul 2>&1
if %errorlevel% neq 0 (
echo [WARN] Ollama not found in PATH. Please make sure it is installed and running.
echo Download: https://ollama.com/download
)
echo [STEP] Checking Ollama service...
ollama list >nul 2>&1
if %errorlevel% neq 0 (
echo [STEP] Starting Ollama service...
start "Ollama" ollama serve
echo [WAIT] Waiting for Ollama to be ready...
timeout /t 5 /nobreak >nul
)
echo [OK] Ollama service running
REM --- Pull models (idempotent: skips if already downloaded) ---
echo [STEP] Pulling qwen2.5:7b (~4.5GB, first time only)...
ollama pull qwen2.5:7b
echo [STEP] Pulling nomic-embed-text (~274MB)...
ollama pull nomic-embed-text
echo [OK] Models ready
REM --- Install dependencies ---
echo [STEP] Installing Python dependencies...
cd /d "%PROJECT_DIR%backend"
pip install -r requirements.txt -q
if %errorlevel% neq 0 (
echo [ERROR] Failed to install dependencies
pause
exit /b 1
)
echo [OK] Dependencies installed
REM --- Start backend ---
echo.
echo ============================================
echo Starting backend server...
echo API docs: http://localhost:8000/docs
echo Frontend: http://localhost:8000
echo Login: admin / 123456
echo ============================================
echo.
start "Backend" cmd /c "call ""%VENV_DIR%\Scripts\activate.bat"" && python main.py"
timeout /t 3 /nobreak >nul
echo.
echo [Optional] Start frontend dev server:
echo cd frontend
echo npm install
echo npm run dev
echo http://localhost:5173
echo.
echo ============================================
echo Done! Press any key to exit...
echo ============================================
pause