Spaces:
Sleeping
Sleeping
File size: 946 Bytes
dc24342 | 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 29 30 31 32 | #!/bin/bash
echo "Setting up FinRAG..."
# Setup backend
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
# Create .env if it doesn't exist
if [ ! -f .env ]; then
cp .env.example .env
echo ""
echo "Please enter your GOOGLE_API_KEY (or press enter to use the existing one if set):"
read -r GOOGLE_API_KEY
if [ ! -z "$GOOGLE_API_KEY" ]; then
# Use awk or sed to replace the placeholder
sed -i '' "s/GOOGLE_API_KEY=.*/GOOGLE_API_KEY=\"$GOOGLE_API_KEY\"/" .env 2>/dev/null || sed -i "s/GOOGLE_API_KEY=.*/GOOGLE_API_KEY=\"$GOOGLE_API_KEY\"/" .env
fi
fi
# Setup frontend
cd finrag-ui
npm install
if [ ! -f .env.local ]; then
cp .env.example .env.local
fi
cd ..
echo "Setup complete! Run the project with:"
echo "Terminal 1: cd finrag-ui && npm run dev"
echo "Terminal 2: source .venv/bin/activate && uvicorn finrag.api.app:create_app --factory --reload --port 8002 --env-file .env"
|