Data_eng_designer / setup.sh
focustiki's picture
Upload 12 files
9bcadf3 verified
#!/bin/bash
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# DE Knowledge Assistant β€” One-command Local Setup
# Usage: chmod +x setup.sh && ./setup.sh
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
set -e
echo ""
echo "πŸ—„οΈ Data Engineering Knowledge Assistant Setup"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
# ── 1. Python check ───────────────────────────────────────
PYTHON=$(python3 --version 2>&1 | awk '{print $2}')
echo "βœ“ Python $PYTHON found"
# ── 2. Virtual environment ────────────────────────────────
if [ ! -d ".venv" ]; then
echo "β†’ Creating virtual environment…"
python3 -m venv .venv
fi
source .venv/bin/activate
echo "βœ“ Virtual environment activated"
# ── 3. Install dependencies ───────────────────────────────
echo "β†’ Installing dependencies (this takes ~2 min on first run)…"
pip install -q --upgrade pip
pip install -q -r requirements.txt
echo "βœ“ Dependencies installed"
# ── 4. Environment variables ──────────────────────────────
if [ ! -f ".env" ]; then
cp .env.example .env
echo ""
echo "⚠️ ACTION REQUIRED:"
echo " Edit .env and add your free Groq API key."
echo " Get one at: https://console.groq.com (takes 30 seconds)"
echo ""
if command -v open &>/dev/null; then open https://console.groq.com; fi
read -p " Press Enter after you've added your GROQ_API_KEY to .env…" -r
fi
echo "βœ“ Environment configured"
# ── 5. Start server ───────────────────────────────────────
echo ""
echo "πŸš€ Starting DE Knowledge Assistant…"
echo " First run will download the embedding model (~90 MB) and index the PDF."
echo " This takes about 60 seconds. Subsequent starts are instant."
echo ""
echo " Open http://localhost:8000 in your browser"
echo " On iPhone: open Safari β†’ http://your-local-ip:8000 β†’ Share β†’ Add to Home Screen"
echo ""
export $(grep -v '^#' .env | xargs)
export PORT=8000
python app.py