Spaces:
Sleeping

File size: 1,439 Bytes
a812c01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ce826b0
 
 
 
 
 
 
a812c01
 
 
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""Environment configuration. Every external service is optional —
the backend degrades to local in-memory mode so the demo never blocks."""

import os
from pathlib import Path

from dotenv import load_dotenv

load_dotenv()

BASE_DIR = Path(__file__).parent
MENU_FILE = BASE_DIR / "data" / "byg_menu.json"

SUPABASE_URL = os.getenv("SUPABASE_URL", "")
SUPABASE_SERVICE_KEY = os.getenv("SUPABASE_SERVICE_KEY", "")

BOLNA_API_KEY = os.getenv("BOLNA_API_KEY", "")
BOLNA_AGENT_ID = os.getenv("BOLNA_AGENT_ID", "")
BOLNA_WS_HOST = os.getenv("BOLNA_WS_HOST", "")  # e.g. wss://ws.bolna.ai
BOLNA_API_HOST = os.getenv("BOLNA_API_HOST", "https://api.bolna.ai")

# Bearer token Bolna tools must present when calling this backend.
# Empty value disables auth (local dev).
BACKEND_API_TOKEN = os.getenv("BACKEND_API_TOKEN", "")

# Origins allowed to call this API from the browser.
CORS_ORIGINS = [
    o.strip()
    for o in os.getenv("CORS_ORIGINS", "http://localhost:3000").split(",")
    if o.strip()
]

DEFAULT_OUTLET = "Hennur"
OUTLETS = ["Hennur", "Sarjapur", "Yeshwantpur"]

# Admin key gates /api/copilot, /api/table-tokens, /api/menu/availability.
# Empty value disables auth for local dev.
ADMIN_KEY = os.getenv("ADMIN_KEY", "")

# Secret for HMAC-signed opaque table QR tokens.
TABLE_TOKEN_SECRET = os.getenv("TABLE_TOKEN_SECRET", "dev-secret")


def supabase_configured() -> bool:
    return bool(SUPABASE_URL and SUPABASE_SERVICE_KEY)