
- Added user model and schema definitions - Implemented JWT token authentication - Created endpoints for user registration and login - Added secure password hashing with bcrypt - Set up SQLite database with SQLAlchemy - Created Alembic migrations - Added user management endpoints - Included health check endpoint generated with BackendIM... (backend.im)
21 lines
472 B
Python
21 lines
472 B
Python
from pydantic_settings import BaseSettings
|
|
import secrets
|
|
from typing import Optional
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
# API settings
|
|
API_V1_STR: str = "/api/v1"
|
|
|
|
# Security settings
|
|
SECRET_KEY: str = secrets.token_urlsafe(32)
|
|
ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
|
|
|
|
# CORS settings
|
|
BACKEND_CORS_ORIGINS: list[str] = ["*"]
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
env_file_encoding = "utf-8"
|
|
|
|
settings = Settings() |