- Add map_preview service resolving short links, cordinates, and OSM 3x3 tile stitching - Draw theme-matched golden venue marker pin centered on location cordinates - Validate Google Maps URL structure and domain invariants in Pydantic schema - Trigger automatic regeneration on PUT /config only when map_url changes - Add POST /admin/map-preview/generate for ad-hoc generation withoug database writes - Add circular preview widget and "Regenerar Mapa" action button to ConfigEditor - Add public GET /birthday/api/map-preview.png endpoint with cache-control headers - Update backend specifications and test suite
27 lines
641 B
Python
27 lines
641 B
Python
from pathlib import Path
|
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
SERVICE_NAME: str = "bdinvite"
|
|
SERVICE_DOMAIN: str = "demos.roadtotech.me"
|
|
BASE_PATH: str = "/birthday"
|
|
APP_PORT: int = 8000
|
|
DATABASE_URL: str = "sqlite:///./data/bdinvite.db"
|
|
DATA_DIR: str = "./data"
|
|
|
|
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
|
|
|
|
@property
|
|
def data_path(self) -> Path:
|
|
return Path(self.DATA_DIR).resolve()
|
|
|
|
@property
|
|
def map_preview_file(self) -> Path:
|
|
return self.data_path / "map_preview.png"
|
|
|
|
|
|
settings = Settings()
|
|
|