How jeremiahogingo/crypto-portfolio-tracker works
Crypto Portfolio Tracker is a Next.js portfolio-management and market-information app, not a trading or custodial system. Users sign in and onboard, record holdings and ledger transactions, then review priced positions, analytics, markets, news, watchlists, and stored alert configurations. The README documents authenticated Server Actions and a decimal ledger/database layer; sampled hooks and route handlers show the public market/news data path. Some feature implementations were not sampled, so their connections are included only where the README explicitly describes them.
Main entry points: actions Portfolio actions · client.ts Browser API client · app App pages · page.tsx Dashboard
Components 26
Application
- App pages
src/app
Portfolio
- Portfolio views
src/components/portfolio - Dashboard
src/app/(dashboard)/page.tsx - Portfolio actions
src/lib/actions - Portfolio queries
src/lib/portfolio/queries.ts - Ledger and recompute
src/lib/portfolio/ledger.ts - Analytics calculations
src/lib/analytics/calc.ts - Priced holdings
src/hooks/useHoldingsWithPrices.ts
Market intelligence
- Market query hook
src/hooks/useMarkets.ts - Browser API client
src/lib/api/client.ts - Market handlers
src/app/api/crypto - CoinGecko adapter
src/lib/api/coingecko.ts - Market normalizer
src/lib/api/normalize.ts - News query hook
src/hooks/useNews.ts - News handler
src/app/api/crypto/news/route.ts - RSS aggregation
src/lib/api/news.ts
User features
- Watchlist
src/components/watchlist/WatchlistView.tsx - Price alerts
src/components/alerts/AlertsView.tsx
Identity and storage
- Session verification
src/lib/auth/get-current-user.ts - User Server Actions
src/lib/actions - Database schema
src/db/schema.ts
Other components
- User
- CoinGecko
- RSS and Atom feeds
- Supabase Auth
- PostgreSQL
Connections 26
- User → App pages: uses
- App pages → Portfolio views: renders
- App pages → Dashboard: renders
src/app/(dashboard)/page.tsx - Dashboard → Portfolio queries: loads holdings
src/app/(dashboard)/page.tsx - Dashboard → Analytics calculations: calculates summary
src/app/(dashboard)/page.tsx - Portfolio views → Portfolio actions: mutates portfolio
- Portfolio actions → Session verification: verifies session
- Portfolio actions → Ledger and recompute: replays ledger
- Portfolio actions → PostgreSQL: persists changes
- Portfolio queries → PostgreSQL: reads positions
- Ledger and recompute → Database schema: uses transaction model
- Database schema → PostgreSQL: defines tables
src/db/schema.ts - Priced holdings → Market query hook: requests quotes
src/hooks/useHoldingsWithPrices.ts - Market query hook → Browser API client: fetches JSON
src/hooks/useMarkets.ts - Browser API client → Market handlers: calls endpoint
- Market handlers → CoinGecko adapter: fetches market data
src/app/api/crypto/markets/route.ts - Market handlers → Market normalizer: normalizes coins
src/app/api/crypto/markets/route.ts - CoinGecko adapter → CoinGecko: requests quotes
src/lib/api/coingecko.ts - News query hook → Browser API client: fetches JSON
src/hooks/useNews.ts - Browser API client → News handler: calls endpoint
- News handler → RSS aggregation: gets articles
src/app/api/crypto/news/route.ts - RSS aggregation → RSS and Atom feeds: aggregates feeds
- Watchlist → User Server Actions: manages assets
- Price alerts → User Server Actions: stores configs
- Session verification → Supabase Auth: checks session
- User Server Actions → PostgreSQL: writes user data