How nnamdi-sys/finalytics works
Project Type and Purpose
• Finalytics is a multi‐language monorepo centered on a Rust core library for financial data retrieval, security analysis, and portfolio optimization.
• It provides:
• A Rust crate (rust/) implementing analytics (fundamentals, performance, optimization, etc.), data models, charting, and reporting modules.
• A Python binding (python/) via Rust FFI, exposing the same functionality to Python users.
• A sample web application (web/) built in Rust, rendering dashboards for tickers and portfolios.
• CI/CD workflows (GitHub Actions) and containerization (Docker + Fly.io) are included for building, testing, and deployment.
File Structure Analysis
• Top level:
• Cargo.toml, Cargo.lock – root Rust project metadata
• python/ – Python wrapper (pyproject.toml, Rust FFI code, documentation)
• rust/ – core library source (src/analytics/, src/data/, src/models/, src/charts/, src/reports/, src/utils/)
• web/ – web server application (router, components, templates)
• .github/workflows – CI pipelines for Python and Rust
• Dockerfile + fly.toml – container build and Fly.io deployment config
• Patterns:
• Modular Rust library following feature domains (analytics, data, charts, reports, utils)
• FFI layer linking Rust library to Python
• Web server using MVC‐like routing + templates
README Insights
• Core functionality: building Tickers, generating reports (performance, financials, options, news), portfolio optimization.
• Python usage mirrors Rust API.
• Sample web dashboards (Ticker Dashboard, Portfolio Dashboard) hosted at finalytics.rs.
• Deployment target: Fly.io container.
Detailed Capture of Architectural Elements
• Python process invoking FFI functions.
• Web server routing layer calling core library.
• External data source (e.g., “Yahoo Finance API”) as a separate entity.