
This API provides endpoints for: - Product and inventory management - Customer management - Order processing - Payment processing with Stripe integration - User authentication generated with BackendIM... (backend.im)
35 lines
888 B
Python
35 lines
888 B
Python
from pathlib import Path
|
|
from typing import List
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
# Base settings
|
|
PROJECT_NAME: str = "Retail Management and Payment API"
|
|
API_V1_STR: str = "/api/v1"
|
|
|
|
# CORS
|
|
CORS_ORIGINS: List[str] = ["*"]
|
|
|
|
# JWT
|
|
JWT_SECRET_KEY: str = "your-secret-key-change-in-production"
|
|
JWT_ALGORITHM: str = "HS256"
|
|
JWT_ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
|
|
|
|
# Database
|
|
DB_DIR = Path("/app") / "storage" / "db"
|
|
DB_DIR.mkdir(parents=True, exist_ok=True)
|
|
SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
|
|
|
|
# Stripe
|
|
STRIPE_API_KEY: str = "your-stripe-api-key"
|
|
STRIPE_WEBHOOK_SECRET: str = "your-stripe-webhook-secret"
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
env_file_encoding = "utf-8"
|
|
case_sensitive = True
|
|
|
|
|
|
settings = Settings() |