d51c6da18d
Add --dev flag to `opal server start` that disables auth (injects userID=1 for all requests) and exposes a /auth/dev-session endpoint, so the frontend can develop against a real backend without OAuth config. Remove VITE_MOCK_MODE and all mock data/branches from the frontend stores. Add scripts/dev.sh to start both services locally. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
33 lines
726 B
Bash
Executable File
33 lines
726 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# Start backend and frontend for local development.
|
|
# Backend runs with --dev (auth disabled), frontend points at localhost:8080.
|
|
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
|
|
cleanup() {
|
|
echo ""
|
|
echo "Shutting down..."
|
|
kill $BACKEND_PID $FRONTEND_PID 2>/dev/null || true
|
|
wait $BACKEND_PID $FRONTEND_PID 2>/dev/null || true
|
|
}
|
|
trap cleanup EXIT INT TERM
|
|
|
|
# Start backend
|
|
echo "Starting backend (dev mode) on :8080..."
|
|
cd "$ROOT/opal-task"
|
|
go run . server start --dev --addr :8080 &
|
|
BACKEND_PID=$!
|
|
|
|
# Give the backend a moment to start before launching the frontend
|
|
sleep 1
|
|
|
|
# Start frontend
|
|
echo "Starting frontend..."
|
|
cd "$ROOT/opal-web"
|
|
bun run dev &
|
|
FRONTEND_PID=$!
|
|
|
|
wait
|