Add combined development server launcher

This commit is contained in:
2026-07-10 19:09:16 -07:00
parent 9a5a319cb9
commit 929941b8ff
3 changed files with 48 additions and 2 deletions

38
dev.sh Executable file
View File

@@ -0,0 +1,38 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PIDS=()
cleanup() {
local status=$?
trap - EXIT INT TERM
if ((${#PIDS[@]})); then
kill "${PIDS[@]}" 2>/dev/null || true
wait "${PIDS[@]}" 2>/dev/null || true
fi
exit "$status"
}
trap cleanup EXIT
trap 'exit 130' INT
trap 'exit 143' TERM
cd "$ROOT_DIR"
echo "Starting backend at http://localhost:8000"
"$ROOT_DIR/.venv/bin/uvicorn" pirats.main:app --host 0.0.0.0 --port 8000 --reload &
PIDS+=("$!")
echo "Starting frontend at http://localhost:5173"
(
cd "$ROOT_DIR/frontend"
exec ./node_modules/.bin/vite
) &
PIDS+=("$!")
echo "Press Ctrl-C to stop both servers."
wait