89 lines
2.6 KiB
Python
89 lines
2.6 KiB
Python
# app/core/config.py
|
|
"""Summary description ....
|
|
|
|
This module provides classes and functions for:
|
|
- ....
|
|
- ....
|
|
- ....
|
|
"""
|
|
|
|
from typing import List, Optional
|
|
|
|
from pydantic_settings import \
|
|
BaseSettings # This is the correct import for Pydantic v2
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""Settings class inheriting from BaseSettings that allows values to be overridden by environment variables."""
|
|
|
|
# Project information
|
|
project_name: str = "Ecommerce Backend API with Marketplace Support"
|
|
description: str = """
|
|
## 🚀 Letzshop Import API
|
|
|
|
Complete marketplace product import and management system built with FastAPI.
|
|
|
|
### 📚 Documentation Links
|
|
|
|
- **[Complete Documentation Site](#)** - Full project documentation
|
|
- **[Getting Started Guide](#)** - Installation and setup
|
|
- **[User Guides](#)** - How-to guides and tutorials
|
|
- **[API Authentication Guide](#)** - Security and authentication
|
|
- **[Testing Documentation](#)** - Test suite and conventions
|
|
|
|
### 🔗 Quick Links
|
|
|
|
- **[Alternative API Docs](/redoc)** - ReDoc interface
|
|
- **[Health Check](/health)** - System status
|
|
- **[OpenAPI Spec](/openapi.json)** - Machine-readable API spec
|
|
|
|
### 📖 Key Features
|
|
|
|
- **Product Management** - Complete CRUD operations with validation
|
|
- **Multi-Shop Support** - Independent shop configurations
|
|
- **CSV Import System** - Bulk import from various marketplace formats
|
|
- **Stock Management** - Inventory tracking across locations
|
|
- **User Management** - Role-based access control
|
|
- **Marketplace Integration** - Import from multiple platforms
|
|
|
|
### 🏗️ Architecture
|
|
|
|
Built with modern Python stack:
|
|
- **FastAPI** - High-performance async API framework
|
|
- **SQLAlchemy** - Powerful ORM with PostgreSQL
|
|
- **Pydantic** - Data validation and serialization
|
|
- **JWT Authentication** - Secure token-based auth
|
|
- **pytest** - Comprehensive test suite
|
|
"""
|
|
version: str = "2.2.0"
|
|
|
|
# Database
|
|
database_url: str = "sqlite:///./ecommerce.db"
|
|
|
|
# JWT
|
|
jwt_secret_key: str = "change-this-in-production"
|
|
jwt_expire_hours: int = 24
|
|
jwt_expire_minutes: int = 30
|
|
|
|
# Middleware
|
|
allowed_hosts: List[str] = ["*"] # Configure for production
|
|
|
|
# API
|
|
api_host: str = "0.0.0.0"
|
|
api_port: int = 8000
|
|
debug: bool = False
|
|
|
|
# Rate Limiting
|
|
rate_limit_enabled: bool = True
|
|
rate_limit_requests: int = 100
|
|
rate_limit_window: int = 3600
|
|
|
|
# Logging
|
|
log_level: str = "INFO"
|
|
log_file: Optional[str] = None
|
|
|
|
model_config = {"env_file": ".env"} # Updated syntax for Pydantic v2
|
|
|
|
|
|
settings = Settings()
|