""" Configuration file for Supabase connection This file helps set up environment variables for both local development and Hugging Face deployment """ import os # For Hugging Face deployment, set these as secrets in your Space settings SUPABASE_CONFIG = { 'host': 'db.bnjblzcqaumctpehgoid.supabase.co', 'port': '5432', 'database': 'postgres', 'user': 'postgres', # Password should be set as environment variable: DB_PASSWORD } HUGGINGFACE_CONFIG = { 'token': os.getenv('HF_TOKEN', 'your_hf_token_here') } def get_db_connection_string(password: str) -> str: """Generate database connection string""" return f"postgresql://{SUPABASE_CONFIG['user']}:{password}@{SUPABASE_CONFIG['host']}:{SUPABASE_CONFIG['port']}/{SUPABASE_CONFIG['database']}" def setup_environment_variables(db_password: str): """Setup environment variables for local development""" os.environ['DB_HOST'] = SUPABASE_CONFIG['host'] os.environ['DB_PORT'] = SUPABASE_CONFIG['port'] os.environ['DB_NAME'] = SUPABASE_CONFIG['database'] os.environ['DB_USER'] = SUPABASE_CONFIG['user'] os.environ['DB_PASSWORD'] = db_password os.environ['HF_TOKEN'] = os.getenv('HF_TOKEN', 'your_hf_token_here') print("✅ Environment variables set successfully!") print(f"Database URL: {get_db_connection_string('[HIDDEN]')}")