-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·26 lines (21 loc) · 827 Bytes
/
Copy pathrun.sh
File metadata and controls
executable file
·26 lines (21 loc) · 827 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
#!/usr/bin/env bash
# Mapr3D — one process, one port. Serves the studio UI and the API together.
# Builds the app bundle on first run. Ctrl+C stops it.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PORT="${MAPR3D_PORT:-8000}"
command -v uv >/dev/null 2>&1 || { echo "error: 'uv' not found (https://docs.astral.sh/uv/)"; exit 1; }
if [ ! -d "$ROOT/backend/.venv" ]; then
echo "→ Installing engine dependencies…"
(cd "$ROOT/backend" && uv sync)
fi
if [ ! -f "$ROOT/backend/mapr3d/static/index.html" ]; then
echo "→ App bundle missing; building it now (first run only, takes a few minutes)…"
"$ROOT/build-app.sh"
fi
echo ""
echo "Mapr3D running → http://localhost:${PORT}"
echo "Press Ctrl+C to stop."
echo ""
cd "$ROOT/backend"
exec uv run uvicorn mapr3d.main:app --port "$PORT"