Automated Action 91405a6195 Implement authentication service with FastAPI and SQLite
- Setup project structure and dependencies
- Create SQLite database with SQLAlchemy models
- Initialize Alembic for database migrations
- Implement JWT-based authentication utilities
- Create API endpoints for signup, login, and logout
- Add health check endpoint
- Implement authentication middleware for protected routes
- Update README with setup and usage instructions
- Add linting with Ruff
2025-05-17 17:33:29 +00:00

33 lines
740 B
Python

from pathlib import Path
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
"""Application settings class."""
API_V1_STR: str = "/api/v1"
PROJECT_NAME: str = "Authentication Service"
# SECURITY
SECRET_KEY: str = "your-secret-key-please-change-in-production"
ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
# CORS
BACKEND_CORS_ORIGINS: list[str] = ["*"]
# DATABASE
DB_DIR: Path = Path("/app") / "storage" / "db"
SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
class Config:
"""Configuration class for Settings."""
case_sensitive = True
settings = Settings()
# Ensure DB directory exists
settings.DB_DIR.mkdir(parents=True, exist_ok=True)