
- Setup project structure with FastAPI app - Create SQLAlchemy models for categories, questions, quizzes, and results - Implement API endpoints for all CRUD operations - Set up Alembic migrations for database schema management - Add comprehensive documentation in README.md
25 lines
670 B
Python
25 lines
670 B
Python
import os
|
|
from pathlib import Path
|
|
from pydantic_settings import BaseSettings
|
|
|
|
class Settings(BaseSettings):
|
|
PROJECT_NAME: str = "Bible Quiz App API"
|
|
API_V1_STR: str = "/api/v1"
|
|
|
|
# Database settings
|
|
DB_DIR: Path = Path("/app") / "storage" / "db"
|
|
|
|
# Secret key for tokens
|
|
SECRET_KEY: str = os.environ.get("SECRET_KEY", "insecuresecretkey")
|
|
|
|
# Token expiration time in minutes
|
|
ACCESS_TOKEN_EXPIRE_MINUTES: int = 60 * 24 * 7 # 7 days
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
env_file_encoding = "utf-8"
|
|
|
|
settings = Settings()
|
|
|
|
# Ensure database directory exists
|
|
settings.DB_DIR.mkdir(parents=True, exist_ok=True) |