feat: project foundation — monorepo setup, shared config, redis streams, telemetry

- pyproject.toml with core deps and optional dep groups per service
- shared/config.py: Pydantic BaseSettings with TRADING_ env prefix
- shared/redis_streams.py: StreamPublisher/StreamConsumer wrappers
- shared/telemetry.py: OpenTelemetry + Prometheus metric export
- tests for Redis Streams helpers (5 passing)
This commit is contained in:
Viktor Barzin 2026-02-22 15:13:26 +00:00
parent 0ac9884b89
commit ae5b3f89d1
No known key found for this signature in database
GPG key ID: 0EB088298288D958
7 changed files with 248 additions and 0 deletions

19
shared/config.py Normal file
View file

@ -0,0 +1,19 @@
"""Shared configuration for all trading bot services."""
from pydantic_settings import BaseSettings
class BaseConfig(BaseSettings):
"""Base configuration shared across all services.
All settings can be overridden via environment variables
prefixed with ``TRADING_``.
"""
database_url: str = "postgresql+asyncpg://trading:trading@localhost:5432/trading"
redis_url: str = "redis://localhost:6379/0"
log_level: str = "INFO"
otel_service_name: str = "trading-bot"
otel_metrics_port: int = 9090
model_config = {"env_prefix": "TRADING_"}