-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart_all.ps1
More file actions
59 lines (50 loc) · 4.94 KB
/
start_all.ps1
File metadata and controls
59 lines (50 loc) · 4.94 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
# HomeNetAI - Start Frontend and Backend
# This script starts both the FastAPI backend and Vite frontend in parallel
Write-Host "==================================================" -ForegroundColor Cyan
Write-Host " HomeNetAI - Starting All Services " -ForegroundColor Cyan
Write-Host "==================================================" -ForegroundColor Cyan
Write-Host ""
# Check if .env file exists
if (-not (Test-Path ".env")) {
Write-Host "ERROR: .env file not found!" -ForegroundColor Red
Write-Host "Please create a .env file with required configuration" -ForegroundColor Yellow
exit 1
}
# Check if Python is available
try {
$pythonVersion = python --version 2>&1
Write-Host "Γ£ô Python found: $pythonVersion" -ForegroundColor Green
} catch {
Write-Host "ERROR: Python not found. Please install Python 3.8+" -ForegroundColor Red
exit 1
}
# Check if Node.js is available
try {
$nodeVersion = node --version 2>&1
Write-Host "Γ£ô Node.js found: $nodeVersion" -ForegroundColor Green
} catch {
Write-Host "ERROR: Node.js not found. Please install Node.js" -ForegroundColor Red
exit 1
}
Write-Host ""
Write-Host "Starting services..." -ForegroundColor Cyan
Write-Host ""
# Start Backend in a new window
Write-Host "→ Starting Backend Server (http://localhost:8000)" -ForegroundColor Yellow
Start-Process powershell -ArgumentList "-NoExit", "-Command", "cd '$PWD'; Write-Host 'Backend Server' -ForegroundColor Magenta; python backend/start_backend.py"
# Wait a moment for backend to start
Start-Sleep -Seconds 2
# Start Frontend in a new window
Write-Host "→ Starting Frontend Dev Server (http://localhost:5173)" -ForegroundColor Yellow
Start-Process powershell -ArgumentList "-NoExit", "-Command", "cd '$PWD/frontend'; Write-Host 'Frontend Dev Server' -ForegroundColor Cyan; npm run dev"
Write-Host ""
Write-Host "==================================================" -ForegroundColor Green
Write-Host " Services Started Successfully! " -ForegroundColor Green
Write-Host "==================================================" -ForegroundColor Green
Write-Host ""
Write-Host "Backend: http://localhost:8000" -ForegroundColor Yellow
Write-Host "API Docs: http://localhost:8000/docs" -ForegroundColor Yellow
Write-Host "Frontend: http://localhost:5173" -ForegroundColor Cyan
Write-Host ""
Write-Host "Press Ctrl+C in each window to stop services" -ForegroundColor Gray
Write-Host ""