init commit

This commit is contained in:
2025-12-10 22:09:31 +09:00
commit b79adf1c69
361 changed files with 47414 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
"""Core module - configuration and utilities"""
from app.core.config import Settings
__all__ = ["Settings"]

View File

@@ -0,0 +1,5 @@
"""Core module - configuration and utilities"""
from app.core.config import Settings
__all__ = ["Settings"]

View File

@@ -0,0 +1,43 @@
"""Application configuration using pydantic-settings"""
from typing import Optional
from pydantic_settings import BaseSettings
from functools import lru_cache
class Settings(BaseSettings):
"""Main application settings"""
# Bot Configuration
bot_token: str
bot_admin_id: int
# Database Configuration
database_url: str
database_echo: bool = False
# Redis Configuration
redis_url: str = "redis://localhost:6379/0"
# Application Configuration
app_debug: bool = False
app_env: str = "development"
log_level: str = "INFO"
# API Configuration
api_host: str = "0.0.0.0"
api_port: int = 8000
# Timezone
tz: str = "Europe/Moscow"
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
case_sensitive = False
@lru_cache()
def get_settings() -> Settings:
"""Get cached settings instance"""
return Settings()

View File

@@ -0,0 +1,43 @@
"""Application configuration using pydantic-settings"""
from typing import Optional
from pydantic_settings import BaseSettings
from functools import lru_cache
class Settings(BaseSettings):
"""Main application settings"""
# Bot Configuration
bot_token: str
bot_admin_id: int
# Database Configuration
database_url: str
database_echo: bool = False
# Redis Configuration
redis_url: str = "redis://localhost:6379/0"
# Application Configuration
app_debug: bool = False
app_env: str = "development"
log_level: str = "INFO"
# API Configuration
api_host: str = "0.0.0.0"
api_port: int = 8000
# Timezone
tz: str = "Europe/Moscow"
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
case_sensitive = False
@lru_cache()
def get_settings() -> Settings:
"""Get cached settings instance"""
return Settings()

View File

@@ -0,0 +1,48 @@
"""Application configuration using pydantic-settings"""
from typing import Optional
from pydantic_settings import BaseSettings
from functools import lru_cache
class Settings(BaseSettings):
"""Main application settings"""
# Bot Configuration
bot_token: str
bot_admin_id: int
# Database Configuration
database_url: str
database_echo: bool = False
# Database Credentials (for Docker)
db_password: Optional[str] = None
db_user: Optional[str] = None
db_name: Optional[str] = None
# Redis Configuration
redis_url: str = "redis://localhost:6379/0"
# Application Configuration
app_debug: bool = False
app_env: str = "development"
log_level: str = "INFO"
# API Configuration
api_host: str = "0.0.0.0"
api_port: int = 8000
# Timezone
tz: str = "Europe/Moscow"
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
case_sensitive = False
@lru_cache()
def get_settings() -> Settings:
"""Get cached settings instance"""
return Settings()

View File

@@ -0,0 +1,48 @@
"""Application configuration using pydantic-settings"""
from typing import Optional
from pydantic_settings import BaseSettings
from functools import lru_cache
class Settings(BaseSettings):
"""Main application settings"""
# Bot Configuration
bot_token: str
bot_admin_id: int
# Database Configuration
database_url: str
database_echo: bool = False
# Database Credentials (for Docker)
db_password: Optional[str] = None
db_user: Optional[str] = None
db_name: Optional[str] = None
# Redis Configuration
redis_url: str = "redis://localhost:6379/0"
# Application Configuration
app_debug: bool = False
app_env: str = "development"
log_level: str = "INFO"
# API Configuration
api_host: str = "0.0.0.0"
api_port: int = 8000
# Timezone
tz: str = "Europe/Moscow"
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
case_sensitive = False
@lru_cache()
def get_settings() -> Settings:
"""Get cached settings instance"""
return Settings()

View File

@@ -0,0 +1,66 @@
"""Application configuration using pydantic-settings"""
from typing import Optional
from pydantic_settings import BaseSettings
from functools import lru_cache
class Settings(BaseSettings):
"""Main application settings"""
# Bot Configuration
bot_token: str
bot_admin_id: int
# Database Configuration
database_url: str
database_echo: bool = False
# Database Credentials (for Docker)
db_password: Optional[str] = None
db_user: Optional[str] = None
db_name: Optional[str] = None
# Redis Configuration
redis_url: str = "redis://localhost:6379/0"
# Application Configuration
app_debug: bool = False
app_env: str = "development"
log_level: str = "INFO"
# API Configuration
api_host: str = "0.0.0.0"
api_port: int = 8000
# Timezone
tz: str = "Europe/Moscow"
# Security Configuration
jwt_secret_key: str = "your-secret-key-change-in-production"
hmac_secret_key: str = "your-hmac-secret-change-in-production"
require_hmac_verification: bool = False # Disabled by default in MVP
access_token_expire_minutes: int = 15
refresh_token_expire_days: int = 30
# CORS Configuration
cors_allowed_origins: list[str] = ["http://localhost:3000", "http://localhost:8081"]
cors_allow_credentials: bool = True
cors_allow_methods: list[str] = ["GET", "POST", "PUT", "DELETE", "OPTIONS"]
cors_allow_headers: list[str] = ["*"]
# Feature Flags
feature_telegram_bot_enabled: bool = True
feature_transaction_approval: bool = True
feature_event_logging: bool = True
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
case_sensitive = False
@lru_cache()
def get_settings() -> Settings:
"""Get cached settings instance"""
return Settings()

View File

@@ -0,0 +1,66 @@
"""Application configuration using pydantic-settings"""
from typing import Optional
from pydantic_settings import BaseSettings
from functools import lru_cache
class Settings(BaseSettings):
"""Main application settings"""
# Bot Configuration
bot_token: str
bot_admin_id: int
# Database Configuration
database_url: str
database_echo: bool = False
# Database Credentials (for Docker)
db_password: Optional[str] = None
db_user: Optional[str] = None
db_name: Optional[str] = None
# Redis Configuration
redis_url: str = "redis://localhost:6379/0"
# Application Configuration
app_debug: bool = False
app_env: str = "development"
log_level: str = "INFO"
# API Configuration
api_host: str = "0.0.0.0"
api_port: int = 8000
# Timezone
tz: str = "Europe/Moscow"
# Security Configuration
jwt_secret_key: str = "your-secret-key-change-in-production"
hmac_secret_key: str = "your-hmac-secret-change-in-production"
require_hmac_verification: bool = False # Disabled by default in MVP
access_token_expire_minutes: int = 15
refresh_token_expire_days: int = 30
# CORS Configuration
cors_allowed_origins: list[str] = ["http://localhost:3000", "http://localhost:8081"]
cors_allow_credentials: bool = True
cors_allow_methods: list[str] = ["GET", "POST", "PUT", "DELETE", "OPTIONS"]
cors_allow_headers: list[str] = ["*"]
# Feature Flags
feature_telegram_bot_enabled: bool = True
feature_transaction_approval: bool = True
feature_event_logging: bool = True
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
case_sensitive = False
@lru_cache()
def get_settings() -> Settings:
"""Get cached settings instance"""
return Settings()

View File

@@ -0,0 +1,70 @@
"""Application configuration using pydantic-settings"""
from typing import Optional
from pydantic_settings import BaseSettings
from functools import lru_cache
class Settings(BaseSettings):
"""Main application settings"""
# Bot Configuration
bot_token: str
bot_admin_id: int
# Database Configuration
database_url: str
database_echo: bool = False
# Database Credentials (for Docker)
db_password: Optional[str] = None
db_user: Optional[str] = None
db_name: Optional[str] = None
# Redis Configuration
redis_url: str = "redis://localhost:6379/0"
# Application Configuration
app_debug: bool = False
app_env: str = "development"
log_level: str = "INFO"
# API Configuration
api_host: str = "0.0.0.0"
api_port: int = 8000
# Timezone
tz: str = "Europe/Moscow"
# Security Configuration
jwt_secret_key: str = "your-secret-key-change-in-production"
hmac_secret_key: str = "your-hmac-secret-change-in-production"
require_hmac_verification: bool = False # Disabled by default in MVP
access_token_expire_minutes: int = 15
refresh_token_expire_days: int = 30
# CORS Configuration
cors_allowed_origins: list[str] = ["http://localhost:3000", "http://localhost:8081"]
cors_allow_credentials: bool = True
cors_allow_methods: list[str] = ["GET", "POST", "PUT", "DELETE", "OPTIONS"]
cors_allow_headers: list[str] = ["*"]
# Feature Flags
feature_telegram_bot_enabled: bool = True
feature_transaction_approval: bool = True
feature_event_logging: bool = True
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
case_sensitive = False
@lru_cache()
def get_settings() -> Settings:
"""Get cached settings instance"""
return Settings()
# Global settings instance for direct imports
settings = get_settings()

View File

@@ -0,0 +1,70 @@
"""Application configuration using pydantic-settings"""
from typing import Optional
from pydantic_settings import BaseSettings
from functools import lru_cache
class Settings(BaseSettings):
"""Main application settings"""
# Bot Configuration
bot_token: str
bot_admin_id: int
# Database Configuration
database_url: str
database_echo: bool = False
# Database Credentials (for Docker)
db_password: Optional[str] = None
db_user: Optional[str] = None
db_name: Optional[str] = None
# Redis Configuration
redis_url: str = "redis://localhost:6379/0"
# Application Configuration
app_debug: bool = False
app_env: str = "development"
log_level: str = "INFO"
# API Configuration
api_host: str = "0.0.0.0"
api_port: int = 8000
# Timezone
tz: str = "Europe/Moscow"
# Security Configuration
jwt_secret_key: str = "your-secret-key-change-in-production"
hmac_secret_key: str = "your-hmac-secret-change-in-production"
require_hmac_verification: bool = False # Disabled by default in MVP
access_token_expire_minutes: int = 15
refresh_token_expire_days: int = 30
# CORS Configuration
cors_allowed_origins: list[str] = ["http://localhost:3000", "http://localhost:8081"]
cors_allow_credentials: bool = True
cors_allow_methods: list[str] = ["GET", "POST", "PUT", "DELETE", "OPTIONS"]
cors_allow_headers: list[str] = ["*"]
# Feature Flags
feature_telegram_bot_enabled: bool = True
feature_transaction_approval: bool = True
feature_event_logging: bool = True
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
case_sensitive = False
@lru_cache()
def get_settings() -> Settings:
"""Get cached settings instance"""
return Settings()
# Global settings instance for direct imports
settings = get_settings()