-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.bat
More file actions
150 lines (131 loc) · 3.74 KB
/
setup.bat
File metadata and controls
150 lines (131 loc) · 3.74 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
@echo off
REM VideoGen Messenger - Windows Setup Script
REM This script helps you set up the development environment on Windows
echo ========================================
echo VideoGen Messenger - Windows Setup
echo ========================================
echo.
REM Check if Node.js is installed
echo [1/5] Checking prerequisites...
node --version >nul 2>&1
if %errorlevel% neq 0 (
echo ERROR: Node.js is not installed!
echo Please install Node.js 18+ from: https://nodejs.org/
pause
exit /b 1
)
REM Check Node version
for /f "tokens=1" %%i in ('node --version') do set NODE_VERSION=%%i
echo - Node.js: %NODE_VERSION%
npm --version >nul 2>&1
if %errorlevel% neq 0 (
echo ERROR: npm is not installed!
pause
exit /b 1
)
for /f "tokens=1" %%i in ('npm --version') do set NPM_VERSION=%%i
echo - npm: %NPM_VERSION%
docker --version >nul 2>&1
if %errorlevel% neq 0 (
echo WARNING: Docker is not installed (optional but recommended)
echo Install from: https://www.docker.com/products/docker-desktop/
) else (
for /f "tokens=1-3" %%i in ('docker --version') do echo - %%i %%j %%k
)
git --version >nul 2>&1
if %errorlevel% neq 0 (
echo WARNING: Git is not installed
) else (
for /f "tokens=1-3" %%i in ('git --version') do echo - %%i %%j %%k
)
echo.
echo [2/5] Installing backend dependencies...
cd backend
call npm install
if %errorlevel% neq 0 (
echo ERROR: Failed to install dependencies
pause
exit /b 1
)
echo Dependencies installed successfully!
echo.
echo [3/5] Setting up environment configuration...
if not exist .env (
copy .env.example .env
echo .env file created from template
echo IMPORTANT: Edit backend\.env and add your API keys!
) else (
echo .env file already exists
)
echo.
echo [4/5] Starting infrastructure with Docker...
set /p START_DOCKER="Start Docker services? (Y/n): "
if /i "%START_DOCKER%"=="n" goto skip_docker
cd ..
docker-compose up -d
if %errorlevel% neq 0 (
echo WARNING: Failed to start Docker services
echo Make sure Docker Desktop is running
echo You can start services manually later with: docker-compose up -d
goto skip_docker
)
echo Waiting for services to initialize (15 seconds)...
timeout /t 15 /nobreak >nul
echo Checking service status...
docker-compose ps
:skip_docker
cd backend
echo.
echo [5/5] Running database migrations...
set /p RUN_MIGRATIONS="Run database migrations? (Y/n): "
if /i "%RUN_MIGRATIONS%"=="n" goto skip_migrations
call npm run migrate
if %errorlevel% neq 0 (
echo WARNING: Migrations failed
echo Make sure PostgreSQL is running
echo You can run migrations later with: npm run migrate
goto skip_migrations
)
echo Database migrations completed!
set /p SEED_DB="Seed database with sample data? (y/N): "
if /i "%SEED_DB%"=="y" (
call npm run db:seed
echo Database seeded with sample data!
)
:skip_migrations
echo.
echo ========================================
echo Setup Complete!
echo ========================================
echo.
echo Next Steps:
echo.
echo 1. Edit your .env file with API keys:
echo backend\.env
echo.
echo 2. See API_KEYS_GUIDE.md for how to get API keys
echo.
echo 3. Start the development server:
echo cd backend
echo npm run dev
echo.
echo 4. In a new terminal, start workers:
echo cd backend
echo node workers\startWorkers.js
echo.
echo 5. Test the API:
echo curl http://localhost:3000/health
echo.
echo Optional Admin UIs:
echo - Kibana: http://localhost:5601
echo - pgAdmin: http://localhost:5050
echo - Redis Commander: http://localhost:8081
echo.
echo Documentation:
echo - QUICK_START.md
echo - API_KEYS_GUIDE.md
echo - AGENT_SWARM_SUMMARY.md
echo - docs\API.md
echo.
echo ========================================
pause