Skip to content

sonnymay/dividend-tracker

Repository files navigation

Dividend Tracker

CI Python FastAPI License: MIT Live Demo

Track your dividend portfolio's yield, payout history, and breakdown β€” without juggling five brokerage tabs.

πŸ”— Live demo: dividend-tracker-pi-navy.vercel.app

Built to track a real dividend portfolio targeting $5,000/month passive income for early retirement.


Table of contents


Why this exists

Most portfolio dashboards bury dividend data three clicks deep, or assume you only care about share price. As a long-term dividend investor I wanted answers to three questions at a glance:

  • What's my forward yield across the whole portfolio?
  • When am I getting paid, and how much?
  • Which positions are actually carrying the income?

Dividend Tracker exists to answer those three questions on one screen.


Features

  • πŸ“Š Portfolio overview β€” total value, cost basis, forward yield
  • πŸ“… Payout history β€” past distributions visualized over time
  • πŸ€– AI portfolio chat β€” ask questions about your holdings in natural language (OpenRouter)
  • πŸ“ˆ Forward yield projections β€” estimate future income based on current positions
  • πŸ” Stock search β€” add any ticker with live data from yfinance
  • πŸŒ™ Dark mode β€” easy on the eyes for late-night portfolio reviews
  • πŸ”” Upcoming payouts β€” ex-div and pay dates so you stop missing them
  • πŸ₯§ Position breakdown β€” yield, weight, and income contribution per holding
  • πŸ“‘ Live price + dividend data pulled from Yahoo Finance via yfinance

Stack

Layer Tech
Frontend React 19, Vite, TypeScript, Recharts, Tailwind CSS v4
Backend FastAPI (Python 3.11+), Pydantic Settings
Data yfinance (Yahoo Finance) Β· Supabase Β· OpenRouter
CI/CD GitHub Actions Β· pre-commit Β· pytest
Hosting Vercel (frontend) Β· Render (backend)

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  React + Vite β”‚ ───▢ β”‚   FastAPI    β”‚ ───▢ β”‚   yfinance   β”‚
β”‚   (Vercel)   β”‚     β”‚   (Render)   β”‚     β”‚  + Supabase  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

FastAPI handles ticker lookups via yfinance for live price and dividend history, persists user holdings in Supabase, and powers portfolio chat with OpenRouter. Recharts renders payout history and portfolio breakdown on the client.


Screenshots

Dashboard view

Dashboard with AI Portfolio Chat visible

AI Portfolio Chat

AI Chat starter chips

AI response β€” "When can I retire?"

AI response grounded in live portfolio data


Local development

docker compose up --build

Docker starts the API at http://localhost:8000. Create backend/.env from backend/.env.example before first run.

Prerequisites

  • Python 3.11+
  • Node.js 20+
  • A Supabase project (free tier is fine)
  • An OpenRouter API key (free models are fine)

Backend

cd backend
python -m venv .venv && source .venv/bin/activate
pip install -r requirements-dev.txt
pre-commit install
cp .env.example .env   # fill in SUPABASE_URL, SUPABASE_KEY, OPENROUTER_API_KEY
uvicorn app.main:app --reload

API runs at http://localhost:8000. Interactive docs at /docs.

For Render deploys, set SUPABASE_URL, SUPABASE_KEY, and OPENROUTER_API_KEY on the backend web service. Use /health/dependencies to verify connectivity after deploy.

Frontend

cd frontend
npm install
npm run dev

App runs at http://localhost:5173.


Roadmap

  • DRIP simulation (reinvested vs cash payout)
  • Dividend growth rate (1y / 3y / 5y CAGR)
  • Sector + geography breakdown
  • CSV import from broker statements
  • Dividend safety / payout ratio flags
  • Publish backend as a PyPI package

Contributing

Issues and PRs welcome β€” particularly around new data sources, additional chart types, or broker-import formats. Open an issue before sending large PRs.


Disclaimer

This project is for personal portfolio tracking and educational purposes only. It is not financial, investment, tax, or legal advice. Dividend and price data are provided by Yahoo Finance via yfinance and may be delayed, incomplete, or incorrect. Do your own research and consult a licensed advisor before making investment decisions.


License

MIT Β© Sonny May

Acknowledgements

About

Dividend portfolio tracker with live stock data (yfinance), FastAPI backend, and Recharts visualizations.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors