# shellcheck shell=bash # Load devbox environment (generates shell env from devbox.json) eval "$(devbox generate direnv --print-envrc)" # ── Auto-bootstrap Python venv & deps for backend/api ──────────────────────── if [ ! -d backend/api/.venv ]; then echo "direnv: creating backend/api/.venv ..." (cd backend/api && uv venv --quiet) fi if [ -f backend/api/uv.lock ] && [ backend/api/uv.lock -nt backend/api/.venv/.direnv-synced ] \ || [ ! -f backend/api/.venv/.direnv-synced ]; then echo "direnv: running uv sync in backend/api/ ..." (cd backend/api && uv sync --all-extras --quiet) && touch backend/api/.venv/.direnv-synced fi # ── Auto-bootstrap Node deps for ui/web ──────────────────────────────────── if [ -f ui/web/package.json ] && [ ! -d ui/web/node_modules ]; then echo "direnv: running pnpm install in ui/web/ ..." (cd ui/web && pnpm install --no-fund --reporter=silent) fi # ── Activate Python venv so pytest / CLI tools are on PATH ─────────────────── export VIRTUAL_ENV="$PWD/backend/api/.venv" PATH_add "$VIRTUAL_ENV/bin" # ── Add ui/web/node_modules/.bin so jest / biome are on PATH ─────────────── PATH_add ui/web/node_modules/.bin # ── Project-level environment variables ────────────────────────────────────── export API_URL="${API_URL:-http://localhost:8000}"