A comprehensive stock portfolio tracker and earnings call analysis tool built with React, Supabase, and AI-powered transcript analysis.
- Frontend: React + Vite + TypeScript + Tailwind CSS + shadcn/ui
- Backend: Supabase (Postgres, Edge Functions, RLS)
- Charts: Recharts
- State: TanStack React Query
- Node.js (v18+)
- Supabase CLI (
npm install -g supabase) - Docker (required for local Supabase)
git clone <YOUR_GIT_URL>
cd <YOUR_PROJECT_NAME>
npm installThis will spin up a local Postgres database and apply all migrations from supabase/migrations/:
supabase startAfter starting, the CLI will output local credentials:
API URL: http://127.0.0.1:54321
anon key: eyJhbGci...
service_role key: eyJhbGci...
DB URL: postgresql://postgres:postgres@127.0.0.1:54322/postgres
Create a .env.local file in the project root (do not commit this file):
VITE_SUPABASE_URL=http://127.0.0.1:54321
VITE_SUPABASE_PUBLISHABLE_KEY=<anon_key_from_supabase_start>Use .env.frontend.example for Vite (VITE_*) and .env.example for the Express backend (DATABASE_URL, JWT_SECRET, etc.); merge both into .env.local for local dev.
The React app and Express API are gated behind a single admin account (JWT in an httpOnly cookie).
-
Add to
.env.local(same file asDATABASE_URL):JWT_SECRET=<output of: openssl rand -hex 32>
-
Apply DB migrations (includes
app_admin_users):npm run db:migrate
-
Set a strong password and seed the admin user (default username
admin):ADMIN_SEED_PASSWORD=your_secure_password_at_least_8_chars
npm run db:seed:admin
-
Start the backend (
npm run server) and frontend (npm run dev), then open/login.
Note: This protects the Express API and downloaded files under /files. The Supabase client in the browser still uses the public anon key; for stronger data isolation you would add Supabase Auth + RLS separately.
If you want to use your own hosted Supabase project instead of the default Lovable one:
-
Create a new project in the Supabase dashboard.
-
Link this repo to that project:
supabase login supabase link --project-ref <your_project_ref>
-
Apply the schema + seed data to your project:
supabase db reset
-
In
.env.local, set your cloud project values:VITE_SUPABASE_URL=https://<your-project-ref>.supabase.co VITE_SUPABASE_PUBLISHABLE_KEY=<your_anon_public_key>
-
Set edge function secrets (service role key and external APIs) for that project:
supabase secrets set SUPABASE_URL=https://<your-project-ref>.supabase.co supabase secrets set SUPABASE_SERVICE_ROLE_KEY=<your_service_role_key> supabase secrets set SCREENER_SESSION_ID=<your_screener_session_cookie> supabase secrets set SCREENER_CSRF_TOKEN=<your_screener_csrf_token>
-
Deploy the edge functions:
supabase functions deploy --project-ref <your_project_ref> --all
Edge functions need secrets to operate. Set them for local development:
# Required for edge functions to access the database
supabase secrets set SUPABASE_URL=http://127.0.0.1:54321
supabase secrets set SUPABASE_SERVICE_ROLE_KEY=<service_role_key_from_supabase_start>
# Required for Screener.in financial data scraping
supabase secrets set SCREENER_SESSION_ID=<your_screener_session_cookie>
supabase secrets set SCREENER_CSRF_TOKEN=<your_screener_csrf_token>- Go to screener.in and log in
- Open browser DevTools → Application → Cookies
- Copy the values of
sessionidandcsrftoken
In a separate terminal:
supabase functions servenpm run devThe app will be available at http://localhost:5173.
├── src/
│ ├── components/ # React components
│ ├── hooks/ # Custom React hooks (useStocks, useFinancials, etc.)
│ ├── integrations/ # Auto-generated Supabase client & types
│ ├── lib/ # Utilities, signals detection, types
│ └── pages/ # Route pages (Index, StocksPage, StockDetailPage, etc.)
├── supabase/
│ ├── config.toml # Supabase project config
│ ├── migrations/ # Database migrations (auto-applied on `supabase start`)
│ └── functions/ # Edge functions
│ ├── fetch-price/ # Yahoo Finance price fetcher
│ ├── fetch-financials/ # Screener.in financial data scraper
│ ├── fetch-deals/ # Bulk/insider deal fetcher
│ ├── fetch-sector-indices/ # Nifty sector index tracker
│ ├── fetch-results-calendar/ # Upcoming results date fetcher
│ ├── refresh-all-prices/ # Batch price refresh
│ ├── refresh-all-financials/ # Batch financials refresh
│ └── analyze-transcript/ # AI transcript analysis
- Auto-import on stock add: Price + financials fetched automatically
- 3Y price backfill: Historical daily prices from Yahoo Finance
- Earnings call analysis: Paste transcripts → AI extracts signals, promises, thesis drift
- Multibagger signal detection: Automated scoring based on financials, shareholding, management credibility
- Thesis tracking: Track investment thesis drift across quarters
- Sector indices: Nifty sector performance comparison
- Announcements: On each stock’s detail page, an Announcements tab lists downloaded filings (earnings, concall transcripts, investor presentations) by quarter and type with View links. Use Download filings to fetch from NSE & Screener.
- Google Drive upload (optional): Upload announcements to a Drive folder in a structured layout. See docs/GOOGLE_DRIVE_SETUP.md for creating a service account and API key.
All tables have RLS enabled. Migrations in supabase/migrations/ are applied automatically when you run supabase start. Key tables:
| Table | Purpose |
|---|---|
stocks |
Portfolio stocks with thesis & tracking config |
prices |
Daily price history |
financial_metrics |
Annual financial data (ROCE, ROE, etc.) |
financial_results |
Quarterly results |
shareholding |
Quarterly shareholding pattern |
peer_comparison |
Peer company metrics |
transcript_analysis |
AI-analyzed earnings call data |
quarterly_snapshots |
V5 quarterly thesis snapshots |
management_promises |
Tracked management commitments |
bulk_deals / insider_trades |
Deal activity |
sector_indices |
Nifty sector index prices |
supabase start # Start local Supabase (applies migrations)
supabase stop # Stop local Supabase
supabase db reset # Reset DB and re-apply all migrations
supabase functions serve # Serve edge functions locally
npm run dev # Start frontend dev server
npm run build # Production buildThe app is deployed via Lovable. Click Publish in the editor to deploy.
Edge functions deploy automatically on code changes. Frontend requires clicking Update in the publish dialog.