MuleGuard / start.sh
MuleGuard
MuleGuard: end-to-end mule-account detection + HF Space deploy
af879c2
Raw
History Blame Contribute Delete
705 Bytes
#!/usr/bin/env bash
# Launch the MuleGuard backend (FastAPI) + frontend (Streamlit) together.
set -e
# Pre-score the bundled sample so the alert queue is populated on first load,
# unless a pre-generated store already shipped with the image.
if [ ! -f src/simulator/alerts_store.jsonl ]; then
python -m src.simulator.feed --once || true
fi
# Backend: FastAPI scoring API on :8000 (internal).
uvicorn src.api.main:app --host 0.0.0.0 --port 8000 --log-level warning &
# Frontend: Streamlit analyst console on :7860 (exposed by the Space).
exec streamlit run dashboard/app.py \
--server.port "${PORT:-7860}" \
--server.address 0.0.0.0 \
--server.headless true \
--browser.gatherUsageStats false