Add backend and frontend skeleton
This commit is contained in:
1
app/backend/core/__init__.py
Normal file
1
app/backend/core/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
"""Core infrastructure (config, database, etc.)."""
|
||||
23
app/backend/core/config.py
Normal file
23
app/backend/core/config.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""Environment configuration derived from environment variables."""
|
||||
|
||||
from functools import lru_cache
|
||||
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
"""Application settings."""
|
||||
|
||||
service_name: str = "backend"
|
||||
environment: str = "development"
|
||||
database_url: str = (
|
||||
"postgresql+psycopg://postgres:postgres@postgres:5432/avaaz"
|
||||
)
|
||||
|
||||
model_config = SettingsConfigDict(env_prefix="", case_sensitive=False)
|
||||
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
def get_settings() -> Settings:
|
||||
"""Return cached settings instance."""
|
||||
return Settings()
|
||||
14
app/backend/core/database.py
Normal file
14
app/backend/core/database.py
Normal file
@@ -0,0 +1,14 @@
|
||||
"""Database connection placeholders."""
|
||||
|
||||
from contextlib import contextmanager
|
||||
from typing import Iterator
|
||||
|
||||
|
||||
@contextmanager
|
||||
def get_db() -> Iterator[None]:
|
||||
"""
|
||||
Yield a database session placeholder.
|
||||
|
||||
Replace with a real session (e.g., SQLAlchemy) when persistence is added.
|
||||
"""
|
||||
yield None
|
||||
Reference in New Issue
Block a user