Automated Action 4cfc9775ae Create betting application API with FastAPI and SQLite
- Set up project structure with FastAPI and SQLite
- Implement user authentication with JWT
- Create database models for users, events, bets, and transactions
- Add API endpoints for user management
- Add API endpoints for events and betting functionality
- Add wallet management for deposits and withdrawals
- Configure Alembic for database migrations
- Add linting with Ruff
- Add documentation in README
2025-06-02 15:02:41 +00:00

38 lines
769 B
Python

import os
from pathlib import Path
from typing import List
from pydantic import EmailStr
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
API_V1_STR: str = "/api/v1"
SECRET_KEY: str
PROJECT_NAME: str
ENVIRONMENT: str
# JWT Settings
ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
JWT_ALGORITHM: str = "HS256"
JWT_SECRET_KEY: str
# Security
ALLOWED_HOSTS: List[str] = ["*"]
# Admin user
FIRST_SUPERUSER_EMAIL: EmailStr
FIRST_SUPERUSER_PASSWORD: str
# Database
DB_DIR: Path = Path("/app") / "storage" / "db"
class Config:
env_file = ".env"
case_sensitive = True
settings = Settings()
# Ensure database directory exists
os.makedirs(settings.DB_DIR, exist_ok=True)