- Remove hardcoded database_url/jwt_secret defaults, require env vars - Add DB indexes for stocks.market, market_cap, backtests.user_id - Optimize backtest engine: preload all prices, move stock_names out of loop - Fix backtest API auth: filter by user_id at query level (6 endpoints) - Add manual transaction entry modal on portfolio detail page - Replace console.error with toast.error in signals, backtest, data explorer - Add backtest delete button with confirmation dialog - Replace simulated sine chart with real snapshot data - Add strategy-to-portfolio apply flow with dialog - Add DC pension risk asset ratio >70% warning on rebalance page - Add backtest comparison page with metrics table and overlay chart
44 lines
880 B
Python
44 lines
880 B
Python
"""
|
|
Application configuration using Pydantic Settings.
|
|
"""
|
|
|
|
from pydantic_settings import BaseSettings
|
|
from functools import lru_cache
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
# Application
|
|
app_name: str = "Galaxis-Po"
|
|
debug: bool = False
|
|
|
|
# Database
|
|
database_url: str
|
|
|
|
# JWT
|
|
jwt_secret: str
|
|
jwt_algorithm: str = "HS256"
|
|
access_token_expire_minutes: int = 60 * 24 # 24 hours
|
|
|
|
# CORS
|
|
cors_origins: str = "http://localhost:3000"
|
|
|
|
# Admin user (auto-created on startup if not exists)
|
|
admin_username: str = ""
|
|
admin_email: str = ""
|
|
admin_password: str = ""
|
|
|
|
# External APIs
|
|
kis_app_key: str = ""
|
|
kis_app_secret: str = ""
|
|
kis_account_no: str = ""
|
|
dart_api_key: str = ""
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
case_sensitive = False
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
return Settings()
|