跳到主要内容

架构概述

Fonrex is designed as a modular financial data processing pipeline. It decouples market data providers, business logic, storage engines, and client transport protocols.

High-Level System Architecture

Key Components

  1. FastAPI Transport Layer (routers/): Receives incoming REST and WebSocket requests, converts transport DTOs to internal business entities, and handles status codes.
  2. Use Case Layer (use_cases/): Contains pure application business rules. Free from FastAPI or SQLAlchemy dependencies.
  3. Storage & Services (database/, cache/, historical/): Interfaces with TimescaleDB hypertables for OHLCV bars and Redis for volatile caches.
  4. Scraping & Providers (financials/providers/, news/providers/): Asynchronous connectors scraping financial metrics, insider trades, and financial news.
  5. 质量保证 (monitoring/):对上游提供商执行实时共识检查和每日自动化金丝雀合成查询。