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
- FastAPI Transport Layer (
routers/): Receives incoming REST and WebSocket requests, converts transport DTOs to internal business entities, and handles status codes. - Use Case Layer (
use_cases/): Contains pure application business rules. Free from FastAPI or SQLAlchemy dependencies. - Storage & Services (
database/,cache/,historical/): Interfaces with TimescaleDB hypertables for OHLCV bars and Redis for volatile caches. - Scraping & Providers (
financials/providers/,news/providers/): Asynchronous connectors scraping financial metrics, insider trades, and financial news. - Quality Assurance (
monitoring/): Performs real-time consensus checking and automated daily canary synthetic queries against upstream providers.