Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Portfolio Tracker

A read-only stock portfolio tracker with an AI assistant. Upload your buy and sell trades (or use the made-up sample) and see holdings, returns and XIRR in a clean dashboard.

Live app: https://portfolio-tracker-react.pages.dev

Built with Claude Code for the Maven "Mastering Agentic AI" (Gen Academy) Week 1 project.

What it does

Tab What you see
Current Portfolio Current value, allocation donut, holdings with gain/loss and weight
Historical Performance Total invested, total return, XIRR, value vs net invested over time
Input Transactions Sample portfolio, CSV drag-and-drop or manual entry, all validated
Architecture How the app is built, with a zoomable diagram

Ask your portfolio. The round "Ask" button opens a chat about the loaded portfolio:

  • It answers questions like "What's my XIRR?" or "What if I sell 2 AAPL?"
  • Every number comes from the same tested code as the dashboards; the model never does arithmetic.
  • It explains, but never recommends buying or selling. Off-topic questions are politely declined.

How it works

Architecture diagram

  • Frontend: React 19, Vite, TypeScript, Recharts, on Cloudflare Pages
  • Backend: Python 3.12 FastAPI (uv), on Render's free tier (the first visit after 15 idle minutes takes about a minute to wake)
  • Prices: Yahoo Finance daily closes, cached, with a clearly labelled stored-price fallback
  • Assistant: Claude Haiku 5.5 through LangChain, with five portfolio tools and a scope check

Privacy and safety

  • Your trades are saved in your browser only. "Clear my data" removes them. The server stores nothing.
  • The API key lives only on the server. CSV text is treated as data, never as instructions.
  • Logs hold counts and timings only, never questions, answers or holdings. Assistant spend is capped at $5/month.

Run it locally

Needs uv and Node 20+. Two terminals:

cd backend; uv sync; uv run uvicorn app.main:app --reload
cd frontend; npm install; npm run dev

Then open http://localhost:5173. Tests: cd backend; uv run pytest (129, offline). The assistant needs ANTHROPIC_API_KEY in the backend's environment; the rest works without it.

Docs

Doc What's in it
Developer guide Settings, tests, monitoring, price snapshot, deploy
Spec Every product and design decision
Status Where things stand, timeline, results
QA checklist Manual checks before a release
Deploy notes Cloudflare Pages and Render setup
Build prompt The one prompt that sums up the build
Sample CSVs Made-up files for testing uploads
AGENTS.md Rules for AI coding agents in this repo

Limits

USD only; splits, dividends and non-US tickers are ignored; daily closing prices. Use sample or made-up data.

Built by Shashank Patel. Read-only demo. Not investment advice.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages