How parthsurve07/phoenix__laser works
Fintrack is an Indian-equity portfolio dashboard: users sign in, import or sync holdings, then review portfolio valuation and allocation alongside market data, alerts, stock signals, and AI guidance. The frontend is a Next.js application and the backend exposes Express API routes backed by Prisma. Broker synchronization enriches holdings before saving them; portfolio reads combine stored holdings with live prices. The tree documents several additional route families whose implementations were not sampled, so their internal call relationships are not expanded here.
Main entry points: index.js API router · db.js Prisma database · marketData.js Market data service · authRoutes.js Authentication
Components 28
Fintrack interface
- Dashboard pages
frontend/app - Stock search
frontend/components/stock-search-bar.jsx - API client
frontend/lib/api.js - CSV import endpoint
frontend/app/api/portfolio-import/csv/route.js - Broker import placeholder
frontend/app/api/portfolio-import/broker/route.js - AI insights endpoint
frontend/app/api/ai-insights/route.js
API and identity
- Express app
backend/src/app.js - API router
backend/src/routes/index.js - Authentication
backend/src/routes/authRoutes.js - Session middleware
backend/src/middleware/auth.js
Portfolio and market
- Portfolio routes
backend/src/routes/portfolioRoutes.js - Broker sync routes
backend/src/routes/brokerRoutes.js - Market data service
backend/src/services/marketData.js - Sector mapping
backend/src/utils/sectorMap.js - Prisma database
backend/src/db.js - Market and stock routes
backend/src/routes - Watchlist routes
backend/src/routes/watchlistRoutes.js
Insights and alerts
- Alert routes
backend/src/routes/alertRoutes.js - AI routes
backend/src/routes/aiRoutes.js - AI service
backend/src/services/geminiService.js - Suggestions routes
backend/src/routes/suggestionRoutes.js
External integrations
- OTP email
backend/src/services/emailService.js - Gemini API
- Market data provider
- Broker APIs
- Resend email
- ML service
Other components
- Investor
Connections 38
- Investor → Dashboard pages: uses
- Dashboard pages → API client: requests API
- Stock search → API client: searches stocks
- Investor → CSV import endpoint: uploads CSV
- CSV import endpoint → Prisma database: normalizes holdings
- Investor → Broker import placeholder: selects broker
- Express app → API router: mounts API
- API router → Authentication: dispatches
- API router → Portfolio routes: dispatches
- API router → Broker sync routes: dispatches
- API router → Market and stock routes: dispatches
- API router → Watchlist routes: dispatches
- API router → Alert routes: dispatches
- API router → AI routes: dispatches
- API router → Suggestions routes: dispatches
- Authentication → Session middleware: creates sessions
- Authentication → Prisma database: reads and writes users
- Authentication → OTP email: sends OTP
- OTP email → Resend email: sends email
- Portfolio routes → Prisma database: reads and writes holdings
- Portfolio routes → Market data service: fetches live prices
- Portfolio routes → Sector mapping: maps sectors
- Broker sync routes → Broker APIs: syncs holdings
- Broker sync routes → Market data service: enriches profiles
- Broker sync routes → Prisma database: replaces source holdings
- Market data service → Market data provider: fetches market data
- Watchlist routes → Prisma database: reads and writes watchlists
- Alert routes → Prisma database: reads and writes alerts
- Alert routes → Market data service: fetches live prices
- AI routes → AI service: generates analysis
- AI routes → Market data service: fetches news and trends
- AI routes → Prisma database: saves signals
- AI service → Gemini API: requests generation
- AI service → ML service: requests ML data
- Suggestions routes → Market data service: gets trending stocks
- Suggestions routes → AI service: generates suggestions
- Investor → AI insights endpoint: requests insights
- AI insights endpoint → Gemini API: generates insights