Spaces:
Sleeping
Sleeping
File size: 962 Bytes
082d661 | 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 | #!/usr/bin/env bash
# Launch the Aperture backend (FastAPI) and frontend (Vite) together.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"
echo "▶ Aperture dev launcher"
# 1) ensure samples exist
if [ ! -f backend/evals/datasets/invoice_acme_digital.gt.json ]; then
echo " · generating sample corpus…"
python3 scripts/generate_samples.py >/dev/null
fi
# 2) backend
echo " · starting backend on :8000"
( cd backend && uvicorn app.main:app --port 8000 --reload ) &
BACK=$!
# 3) frontend
if [ ! -d frontend/node_modules ]; then
echo " · installing frontend deps (first run)…"
( cd frontend && npm install --silent )
fi
echo " · starting frontend on :5173"
( cd frontend && npm run dev ) &
FRONT=$!
trap 'echo; echo "stopping…"; kill $BACK $FRONT 2>/dev/null || true' INT TERM
echo
echo " backend: http://localhost:8000/docs"
echo " frontend: http://localhost:5173"
echo " (Ctrl-C to stop)"
wait
|