
- Set up project structure and dependencies - Create database models for tasks and users with SQLAlchemy - Configure Alembic for database migrations - Implement authentication system with JWT tokens - Create CRUD API endpoints for tasks and users - Add health check endpoint - Update README with documentation
28 lines
727 B
Python
28 lines
727 B
Python
import os
|
|
import secrets
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
API_V1_STR: str = "/api/v1"
|
|
PROJECT_NAME: str = "Task Manager API"
|
|
DESCRIPTION: str = "API for managing tasks and users"
|
|
VERSION: str = "0.1.0"
|
|
|
|
# Security
|
|
SECRET_KEY: str = os.environ.get("SECRET_KEY", secrets.token_urlsafe(32))
|
|
# 8 days expiration
|
|
ACCESS_TOKEN_EXPIRE_MINUTES: int = int(os.environ.get("ACCESS_TOKEN_EXPIRE_MINUTES", 60 * 24 * 8))
|
|
|
|
# Database
|
|
SQLALCHEMY_DATABASE_URL: str = os.environ.get(
|
|
"DATABASE_URL", "sqlite:////app/storage/db/db.sqlite"
|
|
)
|
|
|
|
class Config:
|
|
case_sensitive = True
|
|
env_file = ".env"
|
|
|
|
|
|
settings = Settings() |