diegobeyl/backtesting
2
1# Backtesting App V2 - Quick Start Guide
2
3echo "=========================================="
4echo " Backtesting App V2 - Setup & Start"
5echo "=========================================="
6echo ""
7
8# Check Python version
9python --version
10if ($LASTEXITCODE -ne 0) {
11 Write-Error "Python not found. Please install Python 3.11+"
12 exit 1
13}
14
15# Create virtual environment if doesn't exist
16if (-not (Test-Path "venv")) {
17 Write-Host "Creating virtual environment..." -ForegroundColor Green
18 python -m venv venv
19}
20
21# Activate virtual environment
22Write-Host "Activating virtual environment..." -ForegroundColor Green
23.\venv\Scripts\Activate.ps1
24
25# Install/upgrade dependencies
26Write-Host "Installing dependencies..." -ForegroundColor Green
27pip install --upgrade pip
28pip install -r requirements.txt
29
30# Create necessary directories
31Write-Host "Creating directories..." -ForegroundColor Green
32New-Item -ItemType Directory -Force -Path logs, cache | Out-Null
33
34# Check if .env exists
35if (-not (Test-Path ".env")) {
36 Write-Host "Creating .env from template..." -ForegroundColor Yellow
37 Copy-Item .env.example .env -ErrorAction SilentlyContinue
38 if (-not (Test-Path ".env")) {
39 Write-Host "WARNING: .env.example not found. Using default .env" -ForegroundColor Yellow
40 }
41}
42
43Write-Host ""
44Write-Host "=========================================="
45Write-Host " Setup Complete! ✓"
46Write-Host "=========================================="
47Write-Host ""
48Write-Host "To start the application:"
49Write-Host ""
50Write-Host "1. FastAPI Backend:" -ForegroundColor Cyan
51Write-Host " python api/main.py"
52Write-Host ""
53Write-Host "2. Streamlit UI (in another terminal):" -ForegroundColor Cyan
54Write-Host " cd backtesting_app/backtesting_app"
55Write-Host " streamlit run app.py"
56Write-Host ""
57Write-Host "3. Or use Docker:" -ForegroundColor Cyan
58Write-Host " docker-compose up -d"
59Write-Host ""
60Write-Host "Endpoints:" -ForegroundColor Green
61Write-Host " - API: http://localhost:8000"
62Write-Host " - API Docs: http://localhost:8000/docs"
63Write-Host " - Health: http://localhost:8000/health"
64Write-Host " - Streamlit: http://localhost:8501"
65Write-Host ""
66 