#!/usr/bin/env bash set -e # SQLite lives in a writable dir on the Space. export SCHED_DB_PATH="${SCHED_DB_PATH:-/tmp/scheduling.db}" # Fresh schema + reference seed (categories, templates, default calendar, holidays) # + sample contractors/project for the demo. python -m scripts.migrate up SEED_TEST_DATA=true python -m scripts.seed # Backend API on an internal port; the Streamlit UI calls it at 127.0.0.1:8000. python -m uvicorn app.api.app:app --host 127.0.0.1 --port 8000 & sleep 3 # Streamlit on the port Hugging Face exposes. CORS/XSRF disabled because the app # runs behind HF's reverse proxy. exec streamlit run streamlit_app.py \ --server.port "${PORT:-7860}" \ --server.address 0.0.0.0 \ --server.headless true \ --server.enableCORS false \ --server.enableXsrfProtection false \ --browser.gatherUsageStats false