Skip to main content

Architecture Overview

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. Quality Assurance (monitoring/): Performs real-time consensus checking and automated daily canary synthetic queries against upstream providers.