-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdev.sh
More file actions
31 lines (24 loc) · 891 Bytes
/
Copy pathdev.sh
File metadata and controls
31 lines (24 loc) · 891 Bytes
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
# dev.sh — fast local dev loop for Linux/WSL
#
# Kills any old instance, then starts:
# Vite HMR -> http://localhost:5173 (open this — frontend with instant hot reload)
# uvicorn -> http://localhost:7979 (API, auto-reloads on Python changes)
#
# Ctrl+C stops both.
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Kill anything holding our ports
fuser -k 7979/tcp 5173/tcp 2>/dev/null || true
sleep 0.5
cleanup() { kill "$(jobs -p)" 2>/dev/null || true; }
trap cleanup EXIT INT TERM
export PROGRAMMARR_DATA="$ROOT/data"
export PROGRAMMARR_SCRIPTS="$ROOT"
echo ""
echo " Frontend (HMR): http://localhost:5173 <- open this"
echo " Backend (API): http://localhost:7979"
echo " Ctrl+C to stop."
echo ""
"$ROOT/.venv/bin/python3" -m uvicorn main:app --reload --port 7979 --app-dir "$ROOT/backend" &
cd "$ROOT/frontend" && npm run dev &
wait