-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart.bat
More file actions
91 lines (69 loc) · 2.31 KB
/
start.bat
File metadata and controls
91 lines (69 loc) · 2.31 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
@echo off
setlocal enabledelayedexpansion
:: Tea Store Demo - Windows Start Script
:: This script installs dependencies and starts both backend and frontend
echo ========================================
echo Tea Store Demo - Startup Script
echo ========================================
echo.
:: Get the directory where this script is located
set "SCRIPT_DIR=%~dp0"
:: ============================================
:: Backend Setup
:: ============================================
echo [1/4] Setting up Backend...
cd /d "%SCRIPT_DIR%backend"
:: Create virtual environment if it doesn't exist
if not exist "venv" (
echo Creating Python virtual environment...
python -m venv venv
)
:: Activate virtual environment and install dependencies
echo Installing Python dependencies...
call venv\Scripts\activate.bat
pip install -q -r requirements.txt
echo [OK] Backend dependencies installed
echo.
:: ============================================
:: Frontend Setup
:: ============================================
echo [2/4] Setting up Frontend...
cd /d "%SCRIPT_DIR%frontend"
:: Install npm dependencies
echo Installing npm dependencies...
call npm install --silent
echo [OK] Frontend dependencies installed
echo.
:: ============================================
:: Start Backend
:: ============================================
echo [3/4] Starting Backend on port 8765...
cd /d "%SCRIPT_DIR%backend"
start "Tea Store Backend" cmd /c "call venv\Scripts\activate.bat && python main.py"
:: Wait for backend to start
timeout /t 3 /nobreak >nul
echo [OK] Backend starting at http://localhost:8765
echo.
:: ============================================
:: Start Frontend
:: ============================================
echo [4/4] Starting Frontend on port 4321...
cd /d "%SCRIPT_DIR%frontend"
start "Tea Store Frontend" cmd /c "npm run dev"
:: Wait for frontend to start
timeout /t 3 /nobreak >nul
echo [OK] Frontend starting at http://localhost:4321
echo.
:: ============================================
:: Ready!
:: ============================================
echo ========================================
echo All services are running!
echo ========================================
echo.
echo Frontend: http://localhost:4321
echo Backend: http://localhost:8765
echo.
echo Close the terminal windows to stop services
echo.
pause