From 8846653748d1aa2bf42f5cf72161925f37f439e6 Mon Sep 17 00:00:00 2001 From: Tyler Date: Sat, 28 Mar 2026 23:18:52 -0700 Subject: Add CLAUDE.md --- CLAUDE.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..a9a6607 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,35 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Running the app + +```bash +source .venv/bin/activate +streamlit run app.py +``` + +Opens at `http://localhost:8501`. The `.venv/` virtual environment has all dependencies pre-installed. + +## Architecture + +Prism is a single-page Streamlit dashboard. `app.py` is the entry point — it owns the sidebar, injects global CSS, renders the market bar, and mounts the four tab components. + +**Data flow:** `app.py` → `components/` → `services/` → external APIs + +- `services/data_service.py` — all yfinance calls (price history, financials, market indices, ticker search). No API key required. +- `services/fmp_service.py` — Financial Modeling Prep REST calls (ratios, peers, news). Requires `FMP_API_KEY` in `.env`. +- `services/news_service.py` — Finnhub REST calls (company news, sentiment). Requires `FINNHUB_API_KEY` in `.env`. +- `services/valuation_service.py` — pure Python DCF engine (Gordon Growth Model). Takes a FCF `pd.Series` + assumptions, returns a dict with per-year breakdown. No external calls. + +Every service function that hits a network is wrapped with `@st.cache_data(ttl=...)`. TTLs: financials 1h, news 10min, indices 5min, search 60s. + +**Components** (`components/`) are stateless render functions called `render_*(ticker)`. Each catches its own exceptions so one failing panel doesn't break the page. + +## Environment + +Copy `.env.example` → `.env` and fill in keys. Without keys, yfinance-backed features (price, financials, indices, search) still work; FMP and Finnhub features return empty gracefully. + +## Theme / styling + +`.streamlit/config.toml` sets the dark theme and `sans serif` font. Global metric/heading sizing is overridden via injected CSS at the top of `app.py` — adjust there if layout feels too large or small. -- cgit v1.3-2-g0d8e