rebuild(stage-1): establish isolated application skeleton

This commit is contained in:
leefer
2026-07-30 00:46:43 +08:00
parent 6df26a2545
commit 603e73d128
32 changed files with 2691 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
from __future__ import annotations
import os
from dataclasses import dataclass
from pathlib import Path
@dataclass(frozen=True, slots=True)
class Settings:
environment: str
debug: bool
data_directory: Path
@classmethod
def from_environment(cls) -> Settings:
environment = os.getenv("APP_ENV", "development").strip().lower()
data_directory = Path(os.getenv("APP_DATA_DIR", "data")).resolve()
return cls(
environment=environment,
debug=environment == "development",
data_directory=data_directory,
)