-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-wizard.sh
More file actions
108 lines (96 loc) · 3.83 KB
/
setup-wizard.sh
File metadata and controls
108 lines (96 loc) · 3.83 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/bin/bash
# Setup wizard for TrackMyProgress with Gemini AI
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ ║"
echo "║ 🚀 TrackMyProgress v2.0 - Setup Wizard ║"
echo "║ ║"
echo "║ This will help you configure Gemini API and Email ║"
echo "║ ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
# Check if .env exists
ENV_FILE="$(dirname "$0")/.env"
if [ ! -f "$ENV_FILE" ]; then
echo "❌ .env file not found!"
exit 1
fi
echo "📋 Current Configuration:"
echo ""
# Check Gemini API Key
API_KEY=$(grep "^GOOGLE_API_KEY=" "$ENV_FILE" | cut -d'=' -f2)
if [ -z "$API_KEY" ] || [ "$API_KEY" = "your-gemini-api-key-here" ]; then
echo "❌ GOOGLE_API_KEY: NOT CONFIGURED"
HAS_ERRORS=1
else
echo "✅ GOOGLE_API_KEY: Configured (${API_KEY:0:15}...)"
fi
# Check Model
MODEL=$(grep "^GENAI_MODEL=" "$ENV_FILE" | cut -d'=' -f2)
echo "✅ GENAI_MODEL: $MODEL"
# Check SMTP
SMTP_USER=$(grep "^SMTP_USER=" "$ENV_FILE" | cut -d'=' -f2)
if [ -z "$SMTP_USER" ] || [ "$SMTP_USER" = "your-email@gmail.com" ]; then
echo "⚠️ SMTP_USER: NOT CONFIGURED (optional)"
else
echo "✅ SMTP_USER: Configured ($SMTP_USER)"
fi
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
if [ "$HAS_ERRORS" = "1" ]; then
echo "🔧 SETUP REQUIRED"
echo ""
echo "Step 1: Get Gemini API Key"
echo " 1. Open: https://ai.google.dev"
echo " 2. Click 'Create API Key' (or sign in first)"
echo " 3. Copy the API key"
echo " 4. Open .env file and replace GOOGLE_API_KEY value"
echo ""
echo "Step 2 (Optional): Setup Email Notifications"
echo " 1. Enable Gmail 2FA: myaccount.google.com/security"
echo " 2. Create app password: myaccount.google.com/apppasswords"
echo " 3. Copy the 16-character password"
echo " 4. Update .env with SMTP settings"
echo ""
echo "Step 3: Install Dependencies"
echo " npm install"
echo " python3 -m pip install -r server/requirements.txt"
echo ""
echo "Step 4: Start the Application"
echo " chmod +x start.sh"
echo " ./start.sh"
echo ""
exit 1
else
echo "✅ Configuration looks good!"
echo ""
echo "📦 Installing dependencies..."
echo ""
# Install Node dependencies
if [ -f "package.json" ]; then
echo "Installing Node.js packages..."
npm install --legacy-peer-deps
echo ""
fi
# Install Python dependencies
if [ -f "server/requirements.txt" ]; then
echo "Installing Python packages..."
python3 -m pip install -q -r server/requirements.txt
echo ""
fi
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "✅ Setup Complete!"
echo ""
echo "🚀 Ready to start! Run:"
echo " chmod +x start.sh"
echo " ./start.sh"
echo ""
echo "Or start manually:"
echo " Terminal 1: cd server && python3 -m uvicorn ai_server:app --reload"
echo " Terminal 2: npm run dev"
echo ""
echo "🌐 Then open: http://localhost:5173"
echo ""
fi