Spaces:
Sleeping
Sleeping
Download setup.sh from shield137/shockmap-api: direct link, hf CLI and curl.
- Browser
- Download file 1.71 kB
-
https://huggingface.co/spaces/shield137/shockmap-api/resolve/main/setup.sh
- Command line
-
hf download hf://spaces/shield137/shockmap-api/setup.sh
-
curl -L -o setup.sh https://huggingface.co/spaces/shield137/shockmap-api/resolve/main/setup.sh
1.71 kB
| # PharmaShield One-Shot Setup Script | |
| set -e | |
| echo "π‘οΈ Starting PharmaShield Setup..." | |
| # 1. Verify Prerequisites | |
| echo "π Verifying prerequisites..." | |
| # Python Check | |
| if command -v python3.11 &> /dev/null; then | |
| PYTHON_CMD="python3.11" | |
| elif command -v python3 &> /dev/null && [[ $(python3 --version) == *"3.11"* ]]; then | |
| PYTHON_CMD="python3" | |
| else | |
| echo "β Error: Python 3.11 is required but not found." | |
| exit 1 | |
| fi | |
| echo "β $PYTHON_CMD found." | |
| # Flutter Check | |
| if command -v flutter &> /dev/null; then | |
| FLUTTER_VERSION=$(flutter --version | head -n 1) | |
| echo "β Flutter found: $FLUTTER_VERSION" | |
| else | |
| echo "β Error: Flutter is required but not found." | |
| exit 1 | |
| fi | |
| # Node Check | |
| if command -v node &> /dev/null; then | |
| NODE_VERSION=$(node -v) | |
| echo "β Node found: $NODE_VERSION" | |
| else | |
| echo "β Error: Node.js is required but not found." | |
| exit 1 | |
| fi | |
| # 2. Backend Setup | |
| echo "βοΈ Setting up Backend..." | |
| cd backend | |
| $PYTHON_CMD -m venv .venv | |
| source .venv/bin/activate || source .venv/Scripts/activate | |
| pip install --upgrade pip | |
| pip install -r requirements.txt | |
| cd .. | |
| # 3. Frontend Setup | |
| echo "βοΈ Setting up Frontend..." | |
| cd frontend | |
| flutter pub get | |
| cd .. | |
| echo "" | |
| echo "π Setup Complete!" | |
| echo "--------------------------------------------------" | |
| echo "π Next Steps:" | |
| echo "1. Configure Environment: cp .env.example .env and fill in your GEMINI_API_KEY and QDRANT_URL." | |
| echo "2. Run Backend: cd backend && source .venv/bin/activate && uvicorn app.main:app --reload --port 8080" | |
| echo "3. Run Frontend: cd frontend && flutter run -d chrome --dart-define=BACKEND_URL=http://localhost:8080" | |
| echo "--------------------------------------------------" | |