Spaces:
Sleeping
Sleeping
Download setup/setup_frontend.sh from afnhf/dynamo-backend: direct link, hf CLI and curl.
- Browser
- Download file 2.63 kB
-
https://huggingface.co/spaces/afnhf/dynamo-backend/resolve/main/setup/setup_frontend.sh
- Command line
-
hf download hf://spaces/afnhf/dynamo-backend/setup/setup_frontend.sh
-
curl -L -o setup_frontend.sh https://huggingface.co/spaces/afnhf/dynamo-backend/resolve/main/setup/setup_frontend.sh
2.63 kB
| # βββββββββββββββββββββββββββββββββββββββββββββ | |
| # setup_frontend.sh β Frontend Environment Setup | |
| # Usage: bash setup/setup_frontend.sh | |
| # βββββββββββββββββββββββββββββββββββββββββββββ | |
| set -e | |
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" | |
| FRONTEND_DIR="$PROJECT_ROOT/frontend" | |
| echo "" | |
| echo "ββββββββββββββββββββββββββββββββββββββββ" | |
| echo " Dynamo Frontend Setup" | |
| echo "ββββββββββββββββββββββββββββββββββββββββ" | |
| echo "" | |
| # ββ Step 1: Node & NPM check βββββββββββββββββ | |
| echo "[1/4] Checking Node.js and npm..." | |
| if ! command -v node &>/dev/null; then | |
| echo "β Error: Node.js is not installed or not in PATH." | |
| exit 1 | |
| fi | |
| if ! command -v npm &>/dev/null; then | |
| echo "β Error: npm is not installed or not in PATH." | |
| exit 1 | |
| fi | |
| echo " β Node: $(node --version)" | |
| echo " β npm: $(npm --version)" | |
| echo "" | |
| # ββ Step 2: Navigate to frontend directory βββ | |
| echo "[2/4] Verifying frontend workspace..." | |
| if [ ! -d "$FRONTEND_DIR" ]; then | |
| echo "β Error: Frontend directory not found at $FRONTEND_DIR" | |
| exit 1 | |
| fi | |
| cd "$FRONTEND_DIR" | |
| echo " β Working directory set to frontend" | |
| echo "" | |
| # ββ Step 3: Environment file setup βββββββββββ | |
| echo "[3/4] Setting up environment configuration (.env)..." | |
| if [ ! -f ".env" ]; then | |
| if [ -f ".env.example" ]; then | |
| cp .env.example .env | |
| echo " β Created frontend/.env from frontend/.env.example" | |
| else | |
| echo " β οΈ No frontend/.env.example found. Skipping .env creation." | |
| fi | |
| else | |
| echo " β frontend/.env already exists" | |
| fi | |
| echo "" | |
| # ββ Step 4: Install NPM dependencies βββββββββ | |
| echo "[4/4] Installing frontend packages..." | |
| npm install | |
| echo " β NPM packages installed successfully" | |
| echo "" | |
| echo "ββββββββββββββββββββββββββββββββββββββββ" | |
| echo " Frontend Setup Complete! π" | |
| echo "" | |
| echo " To start the frontend development server:" | |
| echo " cd frontend && npm run dev" | |
| echo "ββββββββββββββββββββββββββββββββββββββββ" | |
| echo "" | |