File size: 688 Bytes
42ae0b9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env bash
# build.sh — Build the React frontend and start the FastAPI server
# Usage: ./build.sh [--port 7860]

set -e

PORT=${2:-7860}

echo "=== SQL Analyzer Build Script ==="
echo ""

# 1. Install Python deps
echo "[1/3] Installing Python dependencies..."
pip install -r requirements.txt --quiet

# 2. Build the React frontend
echo "[2/3] Building React frontend..."
cd frontend
pnpm install --frozen-lockfile --silent
pnpm build --silent
cd ..

echo "      → Built to api/static/"

# 3. Start the server
echo "[3/3] Starting FastAPI server on port $PORT..."
echo "      → Open http://localhost:$PORT"
echo ""
cd api
exec uvicorn main:app --host 0.0.0.0 --port "$PORT"