- 新增 docker-compose 与 Tiltfile,容器化 backend/frontend/postgres(宿主口+10000) - 新增 services/config-service(GET /api/v1/system, /analysis-modules),并加入 compose - backend ConfigManager 移除本地文件回退,强制依赖 config-service - 新增 backend/frontend Dockerfile - 清理根目录:移动 pm2.config.js -> deployment/;dev.py -> scripts/;删除根 package.json 与 lock - 新增 .gitignore,忽略二进制与临时文件
35 lines
1.0 KiB
Python
35 lines
1.0 KiB
Python
"""
|
|
Application settings management using Pydantic
|
|
"""
|
|
from typing import List, Optional
|
|
from pydantic_settings import BaseSettings
|
|
|
|
class Settings(BaseSettings):
|
|
"""Application settings loaded from environment variables."""
|
|
APP_NAME: str = "Fundamental Analysis System"
|
|
APP_VERSION: str = "1.0.0"
|
|
DEBUG: bool = False
|
|
|
|
# Default database URL switched to SQLite (async) to avoid optional driver issues.
|
|
# You can override via config or env to PostgreSQL later.
|
|
DATABASE_URL: str = "sqlite+aiosqlite:///./app.db"
|
|
DATABASE_ECHO: bool = False
|
|
|
|
# API settings
|
|
API_V1_STR: str = "/api"
|
|
ALLOWED_ORIGINS: List[str] = ["http://localhost:3000", "http://127.0.0.1:3000"]
|
|
|
|
# External service credentials, can be overridden
|
|
GEMINI_API_KEY: Optional[str] = None
|
|
TUSHARE_TOKEN: Optional[str] = None
|
|
|
|
# Microservices
|
|
CONFIG_SERVICE_BASE_URL: str = "http://config-service:7000/api/v1"
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
case_sensitive = True
|
|
|
|
# Global settings instance
|
|
settings = Settings()
|