feat: replace mock mode with real backend dev mode

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>
This commit is contained in:
2026-02-17 17:07:34 +01:00
parent 80ea17227d
commit d51c6da18d
8 changed files with 111 additions and 468 deletions
Executable
+32
View File
@@ -0,0 +1,32 @@
#!/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