-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_all.bat
More file actions
133 lines (111 loc) · 3.42 KB
/
start_all.bat
File metadata and controls
133 lines (111 loc) · 3.42 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
129
130
131
132
133
@echo off
REM Email Client CLI - Complete System Startup Script for Windows
REM This script starts all components: main processor, admin backend, and admin frontend
setlocal enabledelayedexpansion
REM Get script directory
set SCRIPT_DIR=%~dp0
cd /d "%SCRIPT_DIR%"
REM Colors (Windows 10+ only)
echo.
echo =====================================
echo Email Client CLI - Starting All Services
echo =====================================
echo.
REM Check prerequisites
echo Checking prerequisites...
where python >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
echo ERROR: Python is not installed or not in PATH
pause
exit /b 1
)
where node >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
echo ERROR: Node.js is not installed or not in PATH
pause
exit /b 1
)
where npm >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
echo ERROR: npm is not installed or not in PATH
pause
exit /b 1
)
REM Check if .env file exists
if not exist ".env" (
echo ERROR: .env file not found. Please copy .env.example and configure it.
pause
exit /b 1
)
echo All prerequisites met!
echo.
REM Create log directory
if not exist "logs" mkdir "logs"
REM Start main email processor
echo Starting email processor...
REM Check if virtual environment exists
if not exist "venv" (
echo Creating virtual environment for main app...
python -m venv venv
call venv\Scripts\activate.bat
pip install -r requirements.txt
) else (
call venv\Scripts\activate.bat
)
REM Start main.py in new window
start "Email Processor" /min cmd /c "python main.py > logs\email_processor.log 2>&1"
echo Email processor started
REM Start admin panel backend
echo Starting admin panel backend...
cd "%SCRIPT_DIR%\admin_panel\backend"
REM Check if virtual environment exists
if not exist "venv" (
echo Creating virtual environment for backend...
python -m venv venv
call venv\Scripts\activate.bat
pip install -r requirements.txt
) else (
call venv\Scripts\activate.bat
)
REM Start FastAPI backend in new window
start "Admin Backend" /min cmd /c "uvicorn main:app --host 0.0.0.0 --port 8000 --reload > ..\..\logs\admin_backend.log 2>&1"
echo Admin backend started
REM Wait a moment for backend to start
timeout /t 5 /nobreak >nul
REM Start admin panel frontend
echo Starting admin panel frontend...
cd "%SCRIPT_DIR%\admin_panel\frontend"
REM Check if node_modules exists
if not exist "node_modules" (
echo Installing frontend dependencies...
call npm install
)
REM Start Vite dev server in new window
start "Admin Frontend" /min cmd /c "npm run dev -- --host 0.0.0.0 > ..\..\logs\admin_frontend.log 2>&1"
echo Admin frontend started
REM Wait for services to fully start
timeout /t 5 /nobreak >nul
REM Print success message
cls
echo.
echo ============================================================
echo Email Client CLI System is running!
echo ============================================================
echo.
echo Services:
echo Email Processor: Running (checking every 5 minutes)
echo Admin Backend: http://localhost:8000 (API docs: http://localhost:8000/docs)
echo Admin Frontend: http://localhost:5173
echo.
echo Default Login:
echo Email: admin@example.com
echo Password: changeme
echo.
echo Logs:
echo Email Processor: %SCRIPT_DIR%logs\email_processor.log
echo Admin Backend: %SCRIPT_DIR%logs\admin_backend.log
echo Admin Frontend: %SCRIPT_DIR%logs\admin_frontend.log
echo.
echo To stop all services, close this window and all service windows
echo.
pause