Files
bonamin 8ba8c95ecd feat: initial commit — local services (backend + manager dashboard + waiter PWA)
Includes all work to date:
- local_backend: FastAPI backend with products, orders, tables, shifts, cloud sync
- manager_dashboard: React manager UI with product/category management, reports, settings
- waiter_pwa: React PWA for waiter devices
- Category reparent endpoint and UI
- Waiter domain: local_ip sent on heartbeat, waiter_domain persisted from cloud response
- QR code modal in AppInfoTab for waiter domain
- Product form: number input spinners removed, category pre-selected on new product
- Category row: count badge moved to far right

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 14:04:38 +03:00

28 lines
852 B
Python

import os
from pathlib import Path
from pydantic_settings import BaseSettings
_HERE = Path(__file__).parent # always points to local_backend/
# Use AppData on Windows (avoids Controlled Folder Access blocks),
# fall back to local_backend/ on Linux/Mac/Docker
if os.name == "nt":
_DB_DEFAULT = Path(os.environ.get("LOCALAPPDATA", Path.home() / "AppData" / "Local")) / "pos" / "pos.db"
_DB_DEFAULT.parent.mkdir(parents=True, exist_ok=True)
else:
_DB_DEFAULT = _HERE / "pos.db"
class Settings(BaseSettings):
SITE_ID: str = ""
SITE_KEY: str = ""
CLOUD_URL: str = ""
SECRET_KEY: str = "change-me-generate-a-long-random-string"
DATABASE_URL: str = f"sqlite:///{_DB_DEFAULT.as_posix()}"
VERSION: str = "0.0.0"
model_config = {"env_file": str(_HERE / ".env"), "env_file_encoding": "utf-8"}
settings = Settings()