CancerAtHomeV2 / setup.ps1
Mentors4EDU's picture
Upload 33 files
7a92197 verified
# Windows Setup Script for Cancer@Home v2
# Run this in PowerShell as Administrator
Write-Host "==================================" -ForegroundColor Cyan
Write-Host "Cancer@Home v2 - Windows Setup" -ForegroundColor Cyan
Write-Host "==================================" -ForegroundColor Cyan
Write-Host ""
# Check Python
Write-Host "Checking Python installation..." -ForegroundColor Yellow
try {
$pythonVersion = python --version 2>&1
Write-Host "βœ“ Python found: $pythonVersion" -ForegroundColor Green
} catch {
Write-Host "βœ— Python not found. Please install Python 3.8+ from https://www.python.org/" -ForegroundColor Red
exit 1
}
# Check Docker
Write-Host "Checking Docker installation..." -ForegroundColor Yellow
try {
$dockerVersion = docker --version 2>&1
Write-Host "βœ“ Docker found: $dockerVersion" -ForegroundColor Green
} catch {
Write-Host "βœ— Docker not found. Please install Docker Desktop from https://www.docker.com/products/docker-desktop" -ForegroundColor Red
exit 1
}
# Create virtual environment
Write-Host ""
Write-Host "Creating Python virtual environment..." -ForegroundColor Yellow
python -m venv venv
Write-Host "βœ“ Virtual environment created" -ForegroundColor Green
# Activate virtual environment and install dependencies
Write-Host ""
Write-Host "Installing Python dependencies..." -ForegroundColor Yellow
& ".\venv\Scripts\Activate.ps1"
pip install --upgrade pip
pip install -r requirements.txt
Write-Host "βœ“ Dependencies installed" -ForegroundColor Green
# Create necessary directories
Write-Host ""
Write-Host "Creating directory structure..." -ForegroundColor Yellow
$dirs = @(
"data\gdc",
"data\boinc",
"data\processed\fastq",
"data\processed\blast",
"data\processed\variants",
"data\cache",
"logs"
)
foreach ($dir in $dirs) {
New-Item -ItemType Directory -Force -Path $dir | Out-Null
}
Write-Host "βœ“ Directories created" -ForegroundColor Green
# Start Docker containers
Write-Host ""
Write-Host "Starting Neo4j database..." -ForegroundColor Yellow
docker-compose up -d
Start-Sleep -Seconds 10
Write-Host "βœ“ Neo4j started" -ForegroundColor Green
Write-Host ""
Write-Host "==================================" -ForegroundColor Cyan
Write-Host "Setup Complete!" -ForegroundColor Green
Write-Host "==================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "To start the application:" -ForegroundColor Yellow
Write-Host " 1. Activate virtual environment: .\venv\Scripts\Activate.ps1" -ForegroundColor White
Write-Host " 2. Run the application: python run.py" -ForegroundColor White
Write-Host ""
Write-Host "Access points:" -ForegroundColor Yellow
Write-Host " - Application: http://localhost:5000" -ForegroundColor White
Write-Host " - Neo4j Browser: http://localhost:7474 (neo4j/cancer123)" -ForegroundColor White
Write-Host " - API Docs: http://localhost:5000/docs" -ForegroundColor White
Write-Host ""