File size: 808 Bytes
c67d8f3
 
 
 
 
c4fd681
 
 
 
 
 
 
 
 
 
 
 
c67d8f3
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env bash
set -euo pipefail

ROOT="$(cd "$(dirname "$0")/.." && pwd)"
BACKEND_DIR="$ROOT/apps/backend-api"
LEGACY_BACKEND_DIR="$ROOT/archive/gradio-demo-backend-legacy"

if [[ ! -f "$BACKEND_DIR/requirements.txt" ]]; then
  if [[ -f "$LEGACY_BACKEND_DIR/requirements.txt" ]]; then
    echo "apps/backend-api was removed in recent cleanup; using legacy backend from archive/ for local dev."
    BACKEND_DIR="$LEGACY_BACKEND_DIR"
  else
    echo "No local backend requirements found." >&2
    echo "Use Modal endpoint via NATURALCAD_BACKEND_URL for frontend testing." >&2
    exit 1
  fi
fi

cd "$BACKEND_DIR"

if [[ ! -d .venv ]]; then
  python3 -m venv .venv
fi

source .venv/bin/activate
pip install -r requirements.txt
exec uvicorn app.main:app --reload --port "${NATURALCAD_BACKEND_PORT:-8010}"