-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.ps1
More file actions
60 lines (49 loc) · 1.77 KB
/
start.ps1
File metadata and controls
60 lines (49 loc) · 1.77 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
#!/usr/bin/env pwsh
Write-Host "🚀 Starting ITL Documentation Hub..." -ForegroundColor Green
# Check if Node.js is installed
if (-not (Get-Command node -ErrorAction SilentlyContinue)) {
Write-Host "❌ Node.js is not installed. Please install Node.js first." -ForegroundColor Red
exit 1
}
# Check if Python is installed
if (-not (Get-Command python -ErrorAction SilentlyContinue)) {
Write-Host "❌ Python is not installed. Please install Python first." -ForegroundColor Red
exit 1
}
# Install API dependencies if needed
if (-not (Test-Path "api/node_modules")) {
Write-Host "📦 Installing API dependencies..." -ForegroundColor Yellow
Set-Location api
npm install
Set-Location ..
}
# Install MkDocs dependencies if needed
if (-not (Test-Path "venv")) {
Write-Host "📦 Installing MkDocs dependencies..." -ForegroundColor Yellow
python -m venv venv
if ($IsWindows) {
.\venv\Scripts\Activate.ps1
} else {
source venv/bin/activate
}
pip install -r requirements.txt
}
# Create .env file if it doesn't exist
if (-not (Test-Path "api/.env")) {
Write-Host "⚙️ Creating API configuration..." -ForegroundColor Yellow
Copy-Item "api/.env.example" "api/.env"
}
Write-Host "🌐 Starting services..." -ForegroundColor Green
Write-Host "📚 Documentation Hub: http://localhost:8000" -ForegroundColor Cyan
Write-Host "🔌 API Backend: http://localhost:3000" -ForegroundColor Cyan
# Start API in background
Start-Process -FilePath "powershell" -ArgumentList "-NoExit", "-Command", "cd api; npm start" -WindowStyle Minimized
# Wait a moment for API to start
Start-Sleep -Seconds 3
# Start MkDocs
if ($IsWindows) {
.\venv\Scripts\Activate.ps1
} else {
source venv/bin/activate
}
mkdocs serve --dev-addr=127.0.0.1:8000