forked from odsc2015/agentic-hackathon-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·89 lines (75 loc) · 2.65 KB
/
start.sh
File metadata and controls
executable file
·89 lines (75 loc) · 2.65 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
#!/bin/bash
# Quick start script - Sets up and runs both frontend and backend
echo "╔══════════════════════════════════════════════════════════════════════╗"
echo "║ ║"
echo "║ 🚀 PodVibe.fm - Quick Start ║"
echo "║ ║"
echo "╚══════════════════════════════════════════════════════════════════════╝"
echo ""
# Check for .env file
if [ ! -f "src/.env" ]; then
echo "⚠️ No .env file found!"
echo ""
echo "You need to set up your API keys first:"
echo " 1. Run: ./setup_youtube_api.sh"
echo " OR"
echo " 2. Manually create src/.env with:"
echo " GEMINI_API_KEY=your_key"
echo " YOUTUBE_API_KEY=your_key"
echo ""
exit 1
fi
# Load environment variables
source src/.env 2>/dev/null || true
echo "✅ Configuration found"
echo ""
echo "Starting services..."
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "This will start:"
echo " • Backend API on http://localhost:8000"
echo " • Frontend UI on http://localhost:3000"
echo ""
echo "Press Ctrl+C to stop both services"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
# Function to cleanup on exit
cleanup() {
echo ""
echo "Stopping services..."
kill $BACKEND_PID $FRONTEND_PID 2>/dev/null
exit 0
}
trap cleanup INT TERM
# Start backend
echo "🔧 Starting backend..."
cd src
export GEMINI_API_KEY=$GEMINI_API_KEY
export YOUTUBE_API_KEY=$YOUTUBE_API_KEY
python3 api.py > ../backend.log 2>&1 &
BACKEND_PID=$!
cd ..
sleep 3
# Start frontend
echo "🎨 Starting frontend..."
cd frontend
npm run dev > ../frontend.log 2>&1 &
FRONTEND_PID=$!
cd ..
sleep 3
echo ""
echo "✅ Services started!"
echo ""
echo "📡 Backend: http://localhost:8000"
echo "🌐 Frontend: http://localhost:3000"
echo ""
echo "Logs:"
echo " Backend: tail -f backend.log"
echo " Frontend: tail -f frontend.log"
echo ""
echo "Press Ctrl+C to stop"
echo ""
# Wait for services
wait