aboutsummaryrefslogtreecommitdiff
path: root/CLAUDE.md
diff options
context:
space:
mode:
authorTyler <tyler@tylerhoang.xyz>2026-03-28 23:18:52 -0700
committerTyler <tyler@tylerhoang.xyz>2026-03-28 23:18:52 -0700
commit8846653748d1aa2bf42f5cf72161925f37f439e6 (patch)
treef3c69df842ffa25098811ef79352d72453ddbe42 /CLAUDE.md
parent23675b39b8055a8568cdcf71f66482b9d0cf90a9 (diff)
Add CLAUDE.md
Diffstat (limited to 'CLAUDE.md')
-rw-r--r--CLAUDE.md35
1 files changed, 35 insertions, 0 deletions
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.