Spaces:
Paused

File size: 2,316 Bytes
5eb4857
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Nexus AI Platform Setup Script (Windows PowerShell)
# This script initializes the environment, installs dependencies, and seeds the database.

Write-Host "--- Nexus AI Platform Setup ---" -ForegroundColor Cyan

# 1. Dependency Checks
Write-Host "`n[1/4] Checking Dependencies..." -ForegroundColor Yellow
if (!(Get-Command python -ErrorAction SilentlyContinue)) {
    Write-Host "❌ Python is not installed or not in PATH." -ForegroundColor Red
    exit 1
}
if (!(Get-Command docker -ErrorAction SilentlyContinue)) {
    Write-Host "❌ Docker is not installed or not in PATH." -ForegroundColor Red
    exit 1
}
Write-Host "βœ… Dependencies OK." -ForegroundColor Green

# 2. Python Environment & Requirements
Write-Host "`n[2/4] Installing Python Requirements..." -ForegroundColor Yellow
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
if ($LASTEXITCODE -ne 0) {
    Write-Host "❌ Failed to install requirements." -ForegroundColor Red
    exit 1
}
Write-Host "βœ… Requirements installed." -ForegroundColor Green

# 3. Infrastructure (Docker)
Write-Host "`n[3/4] Starting Infrastructure (Postgres, Redis)..." -ForegroundColor Yellow
docker-compose up -d
if ($LASTEXITCODE -ne 0) {
    Write-Host "❌ Failed to start docker-compose services." -ForegroundColor Red
    exit 1
}
Write-Host "⏳ Waiting 10 seconds for services to initialize..." -ForegroundColor Cyan
Start-Sleep -Seconds 10
Write-Host "βœ… Infrastructure ready." -ForegroundColor Green

# 4. Database Seeding
Write-Host "`n[4/4] Seeding Database..." -ForegroundColor Yellow
$env:PYTHONPATH = "."
python seeds/seed_data.py
if ($LASTEXITCODE -ne 0) {
    Write-Host "❌ Database seeding failed." -ForegroundColor Red
    exit 1
}
Write-Host "βœ… Database initialized with seed data." -ForegroundColor Green

# 🏁 Final Instructions
Write-Host "`n--- Setup Complete! ---" -ForegroundColor Cyan
Write-Host "To run the system, open two terminals and run the following:" -ForegroundColor White
Write-Host "`n1. Start the Task Worker:" -ForegroundColor Green
Write-Host "   arq worker.WorkerSettings"
Write-Host "`n2. Start the API Server:" -ForegroundColor Green
Write-Host "   uvicorn main:app --reload"
Write-Host "`nWait for the worker to show 'Worker starting' before using automated features." -ForegroundColor Gray