-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.bat
More file actions
62 lines (53 loc) · 2.42 KB
/
start.bat
File metadata and controls
62 lines (53 loc) · 2.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
@echo off
REM Scanstream - Unified Start Script for Windows
REM This script starts all services for local development
echo.
echo ╔════════════════════════════════════════════════════════╗
echo ║ 🚀 Starting Scanstream Services ║
echo ╚════════════════════════════════════════════════════════╝
echo.
REM Check if Docker is running
docker ps >nul 2>&1
if %errorlevel% neq 0 (
echo ❌ Docker is not running! Please start Docker Desktop.
pause
exit /b 1
)
REM Start database
echo [1/4] Starting PostgreSQL Database (Docker)...
docker compose up db -d
timeout /t 3 /nobreak >nul
REM Wait for database to be ready
echo [2/4] Waiting for database to be ready...
:wait_db
docker exec scanstream-db-1 pg_isready -U scanuser >nul 2>&1
if %errorlevel% neq 0 (
timeout /t 1 /nobreak >nul
goto wait_db
)
echo ✅ Database is ready!
REM Start Scanner API in new window
echo [3/4] Starting Python Scanner API (Port 5001)...
start "Scanstream - Scanner API" cmd /k "python scanner_api.py"
timeout /t 2 /nobreak >nul
REM Start Backend in new window
echo [4/4] Starting Node.js Backend (Port 5000)...
start "Scanstream - Backend" cmd /k "npm run server"
timeout /t 3 /nobreak >nul
echo.
echo ╔════════════════════════════════════════════════════════╗
echo ║ ✅ All Backend Services Started! ║
echo ╠════════════════════════════════════════════════════════╣
echo ║ Database: postgresql://localhost:5432/scandb ║
echo ║ Scanner API: http://localhost:5001 ║
echo ║ Backend API: http://localhost:5000 ║
echo ╚════════════════════════════════════════════════════════╝
echo.
echo 📌 To start frontend dev server, run:
echo npm run dev
echo.
echo 📌 To stop services:
echo - Close the scanner and backend windows
echo - Run: docker compose down
echo.
pause