
Features: - Project structure with FastAPI framework - SQLAlchemy models with SQLite database - Alembic migrations system - CRUD operations for items - API routers with endpoints for items - Health endpoint for monitoring - Error handling and validation - Comprehensive documentation
24 lines
578 B
Python
24 lines
578 B
Python
from pathlib import Path
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
API_V1_STR: str = "/api/v1"
|
|
PROJECT_NAME: str = "Generic REST API Service"
|
|
PROJECT_DESCRIPTION: str = (
|
|
"A generic REST API service built with FastAPI and SQLite"
|
|
)
|
|
VERSION: str = "0.1.0"
|
|
|
|
# Database configuration
|
|
DB_DIR = Path("/app") / "storage" / "db"
|
|
DB_DIR.mkdir(parents=True, exist_ok=True)
|
|
|
|
SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
|
|
|
|
class Config:
|
|
case_sensitive = True
|
|
|
|
|
|
settings = Settings()
|