forked from Hitarth2510/Cloudify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-server.ps1
More file actions
56 lines (44 loc) Β· 1.91 KB
/
start-server.ps1
File metadata and controls
56 lines (44 loc) Β· 1.91 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
#!/usr/bin/env powershell
# CloudCostOptimizer Server Startup Script
Write-Host "π Starting CloudCostOptimizer Server..." -ForegroundColor Green
# Check if .env file exists
$envFile = ".env"
if (-not (Test-Path $envFile)) {
Write-Host "β οΈ .env file not found. Creating default configuration..." -ForegroundColor Yellow
$defaultEnv = @"
# Environment Configuration for CloudCostOptimizer
# Server Configuration
NODE_ENV=development
PORT=5000
# Database Configuration (Supabase)
# Get these from your Supabase project settings: https://app.supabase.com
SUPABASE_URL=your_supabase_url_here
SUPABASE_ANON_KEY=your_supabase_anon_key_here
# AI Configuration (Google Gemini)
# Get this from Google AI Studio: https://aistudio.google.com/app/apikey
GEMINI_API_KEY=your_gemini_api_key_here
# JWT Configuration (for authentication)
JWT_SECRET=your_super_secret_jwt_key_change_this_in_production_2024
# Development Mode (will use mock data if DB/AI not configured)
# Set to 'false' to force real API usage even in development
USE_MOCK_DATA=true
"@
$defaultEnv | Out-File -FilePath $envFile -Encoding UTF8
Write-Host "β
Created .env file with default configuration" -ForegroundColor Green
Write-Host "π Please edit .env to add your actual API keys if needed" -ForegroundColor Cyan
}
# Check if node_modules exists
if (-not (Test-Path "node_modules")) {
Write-Host "π¦ Installing dependencies..." -ForegroundColor Yellow
npm install
if ($LASTEXITCODE -ne 0) {
Write-Host "β Failed to install dependencies" -ForegroundColor Red
exit 1
}
}
# Start the development server
Write-Host "π Starting development server with mock data enabled..." -ForegroundColor Cyan
Write-Host "π Server will be available at: http://localhost:5000" -ForegroundColor Green
Write-Host "π€ AI and DB APIs will use fallback/mock data for development" -ForegroundColor Yellow
Write-Host ""
npm run dev