-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_complete.ps1
More file actions
106 lines (92 loc) · 4.08 KB
/
setup_complete.ps1
File metadata and controls
106 lines (92 loc) · 4.08 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
#!/usr/bin/env pwsh
Write-Host "============================================================" -ForegroundColor Cyan
Write-Host " PortaBella PSA System - Complete Setup" -ForegroundColor Cyan
Write-Host "============================================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "[STEP 1] Installing Python Dependencies..." -ForegroundColor Yellow
pip install -r requirements.txt
if ($LASTEXITCODE -ne 0) {
Write-Host "ERROR: Failed to install Python dependencies" -ForegroundColor Red
Read-Host "Press Enter to exit"
exit 1
}
Write-Host "[OK] Python dependencies installed" -ForegroundColor Green
Write-Host ""
Write-Host "[STEP 2] Installing Frontend Dependencies..." -ForegroundColor Yellow
Set-Location frontend
npm install
if ($LASTEXITCODE -ne 0) {
Write-Host "ERROR: Failed to install frontend dependencies" -ForegroundColor Red
Read-Host "Press Enter to exit"
exit 1
}
Write-Host "[OK] Frontend dependencies installed" -ForegroundColor Green
Write-Host ""
Write-Host "[STEP 3] Processing Documents..." -ForegroundColor Yellow
Set-Location ..
Write-Host "Processing Word documents..."
python "import docx.py"
if ($LASTEXITCODE -ne 0) {
Write-Host "WARNING: Document processing failed, continuing..." -ForegroundColor Yellow
}
Write-Host "Processing case logs..."
python parse_case_logs.py
if ($LASTEXITCODE -ne 0) {
Write-Host "WARNING: Case log processing failed, continuing..." -ForegroundColor Yellow
}
Write-Host ""
Write-Host "[STEP 4] Setting up Databases..." -ForegroundColor Yellow
python setup.py
if ($LASTEXITCODE -ne 0) {
Write-Host "ERROR: Database setup failed" -ForegroundColor Red
Read-Host "Press Enter to exit"
exit 1
}
Write-Host "[OK] Databases initialized" -ForegroundColor Green
Write-Host ""
Write-Host "[STEP 5] Ingesting Knowledge Base..." -ForegroundColor Yellow
python ingest.py
if ($LASTEXITCODE -ne 0) {
Write-Host "WARNING: Knowledge base ingestion failed, continuing..." -ForegroundColor Yellow
}
Write-Host ""
Write-Host "[STEP 6] Creating Application Logs Directory..." -ForegroundColor Yellow
if (!(Test-Path "Application Logs")) {
New-Item -ItemType Directory -Name "Application Logs" | Out-Null
Write-Host "[OK] Created Application Logs directory" -ForegroundColor Green
} else {
Write-Host "[OK] Application Logs directory already exists" -ForegroundColor Green
}
Write-Host ""
Write-Host "[STEP 7] Creating Environment File..." -ForegroundColor Yellow
if (!(Test-Path ".env")) {
Copy-Item "env.example" ".env"
Write-Host "[OK] Created .env file from template" -ForegroundColor Green
Write-Host "[IMPORTANT] Please edit .env file with your API keys" -ForegroundColor Yellow
} else {
Write-Host "[OK] .env file already exists" -ForegroundColor Green
}
Write-Host ""
Write-Host "============================================================" -ForegroundColor Cyan
Write-Host " SETUP COMPLETE!" -ForegroundColor Cyan
Write-Host "============================================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "[INFO] Starting PortaBella PSA System..." -ForegroundColor Blue
Write-Host "[INFO] Backend will run on: http://localhost:5000" -ForegroundColor Blue
Write-Host "[INFO] Frontend will run on: http://localhost:3000" -ForegroundColor Blue
Write-Host ""
Write-Host "Starting servers in background..." -ForegroundColor Yellow
# Start backend server
Start-Process powershell -ArgumentList "-NoExit", "-Command", "`$env:GOOGLE_API_KEY='test_key'; python app.py" -WindowStyle Normal
# Wait a moment for backend to start
Start-Sleep -Seconds 3
# Start frontend server
Start-Process powershell -ArgumentList "-NoExit", "-Command", "cd frontend; npm run dev" -WindowStyle Normal
Write-Host ""
Write-Host "[SUCCESS] PortaBella PSA System is now running!" -ForegroundColor Green
Write-Host ""
Write-Host "Access your application at:" -ForegroundColor Blue
Write-Host " Frontend: http://localhost:3000" -ForegroundColor White
Write-Host " Backend API: http://localhost:5000" -ForegroundColor White
Write-Host ""
Read-Host "Press Enter to exit this setup window"