
- Built complete CEX platform with FastAPI and Python - JWT-based authentication system with secure password hashing - Multi-currency crypto wallet support (BTC, ETH, USDT) - Fiat account management (USD, EUR, GBP) - Local transaction signing without external APIs - Comprehensive transaction handling (send/receive/deposit/withdraw) - SQLAlchemy models with Alembic migrations - Security middleware (rate limiting, headers, logging) - Input validation and sanitization - Encrypted private key storage with PBKDF2 - Standardized codebase architecture with service layer pattern - Complete API documentation with health endpoints - Comprehensive README with setup instructions Features: - User registration and authentication - Crypto wallet creation and management - Secure transaction signing using local private keys - Fiat deposit/withdrawal system - Transaction history and tracking - Rate limiting and security headers - Input validation for all endpoints - Error handling and logging
35 lines
887 B
Python
35 lines
887 B
Python
from pydantic_settings import BaseSettings
|
|
import os
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
app_name: str = "Cryptocurrency Exchange Platform"
|
|
app_version: str = "1.0.0"
|
|
debug: bool = True
|
|
|
|
# Security
|
|
secret_key: str = os.getenv("SECRET_KEY", "your-secret-key-change-in-production")
|
|
algorithm: str = "HS256"
|
|
access_token_expire_minutes: int = 30
|
|
|
|
# Database
|
|
database_url: str = "sqlite:////app/storage/db/db.sqlite"
|
|
|
|
# CORS
|
|
allowed_origins: list = ["*"]
|
|
|
|
# Crypto settings
|
|
btc_network: str = "testnet" # mainnet or testnet
|
|
eth_network: str = "goerli" # mainnet or goerli
|
|
|
|
# Fiat settings
|
|
min_fiat_deposit: float = 10.0
|
|
max_fiat_deposit: float = 10000.0
|
|
min_fiat_withdrawal: float = 10.0
|
|
max_fiat_withdrawal: float = 5000.0
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
|
|
|
|
settings = Settings() |