How tanishqsarkar/portfoliomanager works
NSE Portfolio Manager is a browser-based portfolio tracker: users authenticate, select or manage portfolios, then review and update holdings and see portfolio metrics. Supabase provides authentication and private persisted portfolio data; market quotes remain simulated in a client-side service. The graph covers the dashboard’s key views, stock entry, calculations, and documented database/RLS capability. Some page-to-component wiring is supported by the source index rather than full excerpts; unsampled details are not inferred.
Main entry points: DashboardPage.tsx Dashboard Orchestrator · PortfolioContext.tsx Portfolio and Holding State · App.tsx Routes and Guards · AuthContext.tsx Authentication State
Components 21
App and Access
- Routes and Guards
src/App.tsx - Sign-in and Recovery
src/pages/LoginPage.tsx - Authentication State
src/context/AuthContext.tsx - Setup Notice
src/pages/SupabaseSetupNotice.tsx
Portfolio Data
- Supabase Client
src/lib/supabaseClient.ts - Tables and RLS
supabase/schema.sql - Portfolio and Holding State
src/context/PortfolioContext.tsx - Portfolio Selection
src/pages/PortfolioSelectionPage.tsx
Market and Metrics
- Demo Quote Catalog
src/services/marketDataService.ts - Portfolio Calculations
src/utils/calculations.ts - Number Formatting
src/utils/format.ts
Portfolio Views
- Dashboard Orchestrator
src/pages/DashboardPage.tsx - Summary Cards
src/components/SummaryCards.tsx - Allocation Chart
src/components/AllocationChart.tsx - Search and Sort Holdings
src/components/HoldingsList.tsx - Gainer and Loser Cards
src/components/GainerLoserCard.tsx - Add and Edit Stock
src/components/AddStockModal.tsx - Portfolio Card
src/components/PortfolioCard.tsx - Demo Data Banner
src/components/DemoModeBanner.tsx
Other components
- Investor
- Supabase Auth and Postgres
Connections 34
- Investor → Routes and Guards: opens app
README.md - Routes and Guards → Sign-in and Recovery: routes to
src/App.tsx - Routes and Guards → Portfolio Selection: routes to
src/App.tsx - Routes and Guards → Dashboard Orchestrator: routes to
src/App.tsx - Routes and Guards → Setup Notice: shows when unconfigured
src/App.tsx - Routes and Guards → Authentication State: provides auth
src/App.tsx - Routes and Guards → Portfolio and Holding State: provides state
src/App.tsx - Sign-in and Recovery → Authentication State: requests auth
src/pages/LoginPage.tsx - Authentication State → Supabase Client: uses client
src/context/AuthContext.tsx - Supabase Client → Supabase Auth and Postgres: connects to
src/lib/supabaseClient.ts - Portfolio and Holding State → Authentication State: reads user
src/context/PortfolioContext.tsx - Portfolio and Holding State → Supabase Client: reads and writes
src/context/PortfolioContext.tsx - Portfolio and Holding State → Supabase Auth and Postgres: loads and persists
README.md - Tables and RLS → Supabase Auth and Postgres: defines tables and RLS
README.md - Portfolio Selection → Portfolio and Holding State: uses portfolio data
src/pages/PortfolioSelectionPage.tsx - Portfolio Selection → Portfolio Card: renders cards
src/pages/PortfolioSelectionPage.tsx - Dashboard Orchestrator → Authentication State: reads user
src/pages/DashboardPage.tsx - Dashboard Orchestrator → Portfolio and Holding State: reads and updates
src/pages/DashboardPage.tsx - Portfolio and Holding State → Demo Quote Catalog: enriches with quotes
src/context/PortfolioContext.tsx - Dashboard Orchestrator → Portfolio Calculations: computes metrics
src/pages/DashboardPage.tsx - Dashboard Orchestrator → Summary Cards: renders
src/pages/DashboardPage.tsx - Dashboard Orchestrator → Allocation Chart: renders
src/pages/DashboardPage.tsx - Dashboard Orchestrator → Search and Sort Holdings: renders
src/pages/DashboardPage.tsx - Dashboard Orchestrator → Gainer and Loser Cards: renders
src/pages/DashboardPage.tsx - Dashboard Orchestrator → Add and Edit Stock: opens for edits
src/pages/DashboardPage.tsx - Search and Sort Holdings → Portfolio Calculations: sorts with
src/components/HoldingsList.tsx - Add and Edit Stock → Demo Quote Catalog: searches catalog
src/components/AddStockModal.tsx - Add and Edit Stock → Portfolio and Holding State: submits changes
- Portfolio and Holding State → Demo Quote Catalog: refreshes quotes
src/context/PortfolioContext.tsx - Dashboard Orchestrator → Demo Data Banner: shows demo status
src/App.tsx - Search and Sort Holdings → Number Formatting: formats values
src/components/HoldingsList.tsx - Allocation Chart → Number Formatting: formats values
src/components/AllocationChart.tsx - Gainer and Loser Cards → Number Formatting: formats values
src/components/GainerLoserCard.tsx - Portfolio Card → Portfolio Calculations: computes summary
src/components/PortfolioCard.tsx