Spaces:
Sleeping
Sleeping
File size: 950 Bytes
3e219fa | 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 | #!/usr/bin/env bash
# Local non-docker dev runner — useful when you want to attach a debugger
# or rerun without rebuilding containers.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"
if [[ ! -f .env ]]; then
echo "missing .env — copy .env.example and fill in keys"
exit 1
fi
export $(grep -v '^#' .env | xargs -I {} echo {} | xargs)
# Use SQLite locally so we don't need postgres on the host.
if [[ "${USE_LOCAL_SQLITE:-1}" = "1" ]]; then
export DATABASE_URL="sqlite:///./data/variantlens.dev.db"
mkdir -p ./data
fi
echo "→ running migrations against $DATABASE_URL"
alembic upgrade head || true
echo "→ starting uvicorn on :8000"
uvicorn backend.app.main:app --host 0.0.0.0 --port 8000 --reload &
API_PID=$!
cleanup() {
echo "→ stopping uvicorn ($API_PID)"
kill "$API_PID" 2>/dev/null || true
}
trap cleanup EXIT
echo "→ starting Vite dev server on :5173"
cd frontend
npm run dev
|