shockmap-api / setup.sh
Dhruva P Gowda
Implement core backend foundation, seed data, and documentation
1638b2e
Raw History Blame Contribute Delete
1.71 kB
#!/bin/bash
# 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 "--------------------------------------------------"