Repository navigation
Expand file tree
/
Copy pathsetup.ps1
More file actions
60 lines (52 loc) · 2.29 KB
/
Copy pathsetup.ps1
File metadata and controls
60 lines (52 loc) · 2.29 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
# DataAgent Setup Script
# Run: powershell -ExecutionPolicy Bypass -File setup.ps1
Write-Host "========================================" -ForegroundColor Cyan
Write-Host " DataAgent - Setup Script" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
# Check Python version
try {
$pyVersion = python --version 2>&1
Write-Host "✓ Python: $pyVersion (requires 3.11-3.13)" -ForegroundColor Green
} catch {
Write-Host "✗ Python not found. Install Python 3.11-3.13 from python.org" -ForegroundColor Red
exit 1
}
# Create virtual environment
if (-not (Test-Path "venv")) {
Write-Host "Creating virtual environment..." -ForegroundColor Yellow
python -m venv venv
Write-Host "✓ Virtual environment created" -ForegroundColor Green
} else {
Write-Host "✓ Virtual environment exists" -ForegroundColor Green
}
# Activate and install dependencies
Write-Host "Installing dependencies..." -ForegroundColor Yellow
& .\venv\Scripts\pip install -r requirements.txt
Write-Host "✓ Dependencies installed" -ForegroundColor Green
# Create required directories
$dirs = @("data/raw", "data/staging", "data/curated", "logs", "outputs/charts", "outputs/reports", "config/pipelines", "config/schedules")
foreach ($dir in $dirs) {
if (-not (Test-Path $dir)) {
New-Item -ItemType Directory -Path $dir -Force | Out-Null
}
}
Write-Host "✓ Data directories created" -ForegroundColor Green
# Initialize database
Write-Host "Initializing database..." -ForegroundColor Yellow
& .\venv\Scripts\python run.py init-db
Write-Host "✓ Database initialized" -ForegroundColor Green
# Run system check
Write-Host "Running system check..." -ForegroundColor Yellow
& .\venv\Scripts\python run.py check
Write-Host ""
Write-Host "========================================" -ForegroundColor Cyan
Write-Host " Setup Complete!" -ForegroundColor Green
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "To start the application:"
Write-Host " .\venv\Scripts\python run.py init-db # first run only"
Write-Host " .\venv\Scripts\python run.py web # serve API + UI (port from config/settings.yaml)"
Write-Host ""
Write-Host "Or use Docker: docker compose up --build (requires JWT_SECRET>=16 chars)"
Write-Host ""