Simple Dashboard for Tracking Your Stock Portfolio with all of the information you need in one place.
Most portfolio apps either oversimplify (just show me a green number) or overcomplicate (spreadsheet hell). This one sits in the middle — it tracks exactly what you bought and when, calculates realised/unrealised P&L per lot, pulls live quotes and fundamentals, and shows a TradingView-style chart for any ticker you hold or want to look up.
| Layer | What |
|---|---|
| Framework | TanStack Start (React 19, file-based routing) |
| Styling | Tailwind CSS 4, Radix UI primitives |
| Charts | Recharts |
| Database | Turso (hosted SQLite) + Drizzle ORM |
| Auth | Better Auth + Google OAuth |
| AI | Anthropic Claude SDK (optional — AI portfolio insights) |
| Deployment | Vercel (Nitro preset) |
- Node.js 20+
- Bun (package manager — faster installs)
- A Turso account (free tier is fine)
- Google OAuth credentials (for login)
git clone https://github.com/yourusername/stocktracker.git
cd stocktracker
bun installcp .dev.vars.example .dev.varsOpen .dev.vars and fill in the values. The comments in the file explain where to get each one. The three required ones to boot the app are:
TURSO_DATABASE_URL+TURSO_AUTH_TOKEN— from turso.techBETTER_AUTH_SECRET— any 32-character random string (openssl rand -base64 32)BETTER_AUTH_URL—http://localhost:8080for local devGOOGLE_CLIENT_ID+GOOGLE_CLIENT_SECRET— from Google Cloud Console
bun run db:migratebun run devOpen http://localhost:8080. Sign in with Google, add a holding, and start tracking.
bun run db:generate # generate a new migration after schema changes
bun run db:migrate # apply pending migrations
bun run db:studio # open Drizzle Studio (visual DB explorer)
bun run db:reset # wipe and re-migrate (destructive — local only)- Push to GitHub.
- Import the repo in Vercel.
- Add all environment variables from
.dev.varsin the Vercel dashboard. ChangeBETTER_AUTH_URLto your production domain (e.g.https://stocktracker.example.com). - Deploy. Vercel auto-detects the Nitro/Vite config.
For the Google OAuth redirect URI, add https://yourdomain.com/api/auth/callback/google in the Google Cloud Console.
src/
routes/ # Pages (file-based routing via TanStack Router)
components/ # Shared UI components
server/
api/ # API route handlers
db/ # Drizzle schema + client
auth.ts # Better Auth config
market/ # Yahoo Finance data fetching + caching
services/ # Business logic (portfolio math, FX, etc.)
fns/ # TanStack Start server functions
lib/ # Shared utilities
drizzle/
migrations/ # SQL migration files
packages/
api-contracts/ # Shared TypeScript types
shared/ # Portfolio math, formatting helpers
scripts/ # DB maintenance scripts
- Web app commands — dev server, build, database, deployment
- Mobile app commands — Expo, EAS build, environment setup
- Mobile app: github.com/derekyuan1000/StockTracker-Mobile — iOS and Android companion with home screen widget and biometric unlock
See CONTRIBUTING.md for code style, conventions, and how to submit changes.
MIT — do whatever you want, just don't hold me responsible if your portfolio goes to zero.