-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·64 lines (51 loc) · 1.49 KB
/
run.sh
File metadata and controls
executable file
·64 lines (51 loc) · 1.49 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
#!/bin/bash
# Startup script for GCS Bucket Viewer
set -e
echo "🚀 Starting GCS Bucket Viewer..."
# Check if .env file exists
if [ ! -f .env ]; then
echo "❌ Error: .env file not found!"
echo "Please create a .env file with your GCS configuration."
exit 1
fi
# Check if credentials file exists
CREDS_FILE=$(grep GOOGLE_APPLICATION_CREDENTIALS .env | cut -d '=' -f2)
if [ ! -f "$CREDS_FILE" ]; then
echo "⚠️ Warning: GCS credentials file not found at $CREDS_FILE"
echo "Please ensure your service account JSON file is in the correct location."
fi
# Install Python dependencies if needed
echo "📦 Installing Python dependencies..."
uv sync
# Install Node dependencies if needed
if [ ! -d "frontend/node_modules" ]; then
echo "📦 Installing Node dependencies..."
cd frontend && npm install && cd ..
fi
# Start backend in background
echo "🐍 Starting FastAPI backend on port 8000..."
uv run python -m src.api &
BACKEND_PID=$!
# Wait for backend to start
sleep 3
# Start frontend
echo "⚡ Starting Svelte frontend on port 5173..."
cd frontend && npm run dev &
FRONTEND_PID=$!
# Function to cleanup on exit
cleanup() {
echo ""
echo "🛑 Shutting down..."
kill $BACKEND_PID 2>/dev/null || true
kill $FRONTEND_PID 2>/dev/null || true
exit 0
}
trap cleanup INT TERM
echo ""
echo "✅ Application is running!"
echo " Backend: http://localhost:8000"
echo " Frontend: http://localhost:5173"
echo ""
echo "Press Ctrl+C to stop..."
# Wait for processes
wait