Spaces:
3SCError404
/
Paused

nexus / scripts /setup.ps1
dushyantsingh0
Beta 1.0: Pure Backend Release (Excluding Frontend)
5eb4857
Raw History Blame Contribute Delete
2.32 kB
# 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