Automated Action d1c05cbd6e Implement Task Manager API with FastAPI and SQLite
- 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
2025-06-12 18:14:56 +00:00

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()