Add Pitopn digital shop with FastAPI, Postgres 17, and Docker Compose

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
orohi
2026-07-25 05:21:34 +03:00
co-authored by Cursor
parent fb00211c48
commit 08cc4b0f1b
16 changed files with 1126 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
from functools import lru_cache
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
app_name: str = "Pitopn"
secret_key: str = "dev-secret"
debug: bool = False
postgres_user: str = "pitopn"
postgres_password: str = "pitopn"
postgres_db: str = "pitopn"
postgres_host: str = "localhost"
postgres_port: int = 5432
@property
def database_url(self) -> str:
return (
f"postgresql+psycopg2://{self.postgres_user}:{self.postgres_password}"
f"@{self.postgres_host}:{self.postgres_port}/{self.postgres_db}"
)
@lru_cache
def get_settings() -> Settings:
return Settings()