diff --git a/README.md b/README.md index 551426e..576ec34 100644 --- a/README.md +++ b/README.md @@ -173,8 +173,16 @@ pirats/ ### Frontend Development -Run the backend (`pirats --reload`) and the Vite dev server side by side; Vite proxies `/api` to port 8000: +Start the backend and Vite dev server together from the repository root. Pressing Ctrl-C stops both: + +```bash +./dev.sh +``` + +To run only the frontend, start the backend separately on port 8000, then run: ```bash cd frontend && npm install && npm run dev ``` + +Vite proxies `/api` to the backend on port 8000. diff --git a/dev.sh b/dev.sh new file mode 100755 index 0000000..d4271f6 --- /dev/null +++ b/dev.sh @@ -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 diff --git a/frontend/src/lib/changelog.js b/frontend/src/lib/changelog.js index b95a240..83cde4a 100644 --- a/frontend/src/lib/changelog.js +++ b/frontend/src/lib/changelog.js @@ -6,7 +6,7 @@ // - Add a CHANGELOG entry only when a commit changes something players can // see. Skip refactors, tests, and tooling. Keep wording player-facing. -export const VERSION = 21; +export const VERSION = 22; // Newest first. Each entry: { version, date: 'YYYY-MM-DD', changes: [string, ...] }. export const CHANGELOG = [