A Next.js (App Router) financial dashboard that lets you:
- 🔎 Search companies/tickers and view price history
- 📈 Visualize time-range charts (1D, 1W, 1M, 6M, 1Y, All)
- 📰 Summarize market/news sentiment with an AI agent
- 🤖 Generate a 30-day price outlook (explanation + target + confidence)
- ⚖️ Run Black–Scholes option pricing (calls & puts)
- ☁️ Deploy on Firebase App Hosting
Stack: Next.js + TypeScript, Tailwind + shadcn/ui, Recharts, Zod, React Hook Form, Genkit + Gemini, Polygon.io market data
- Use the Company Search to find a ticker (e.g., AAPL).
- The Dashboard fetches:
- Company details, aggregates, and news via Polygon.io.
- An AI sentiment summary over the latest headlines.
- Toggle the time range on the chart to explore price history.
- Open Price Predictor to get a 30-day outlook (model rationale + target + confidence).
- Use Option Pricer to calculate Black–Scholes call/put values with your inputs.
src/
ai/
flows/
genkit.ts
dev.ts
app/
layout.tsx, page.tsx
globals.css
components/
dashboard.tsx
company-search.tsx
stock-chart-card.tsx
sentiment-analysis-card.tsx
ai-summary-card.tsx
price-predictor-card.tsx
option-pricer-card.tsx
ui/*
hooks/
use-debounce.ts, use-toast.ts, use-mobile.tsx
lib/
stock-api.ts
black-scholes.ts
types.ts, utils.ts
docs/
blueprint.md
- Node.js 18+
- Polygon.io API key
- Google Generative AI key for Genkit + Gemini 2.0 Flash
-
Install dependencies
npm install
-
Create
.env.localPOLYGON_API_KEY=your_polygon_api_key GOOGLE_GENAI_API_KEY=your_google_genai_api_key
-
Run the app
npm run dev
-
(Optional) Run Genkit dev loop
npm run genkit:watch
npm run dev– Next.js dev servernpm run build– Production buildnpm run start– Start production servernpm run lint– ESLintnpm run typecheck– TypeScriptnpm run genkit:dev/npm run genkit:watch– Genkit local dev
- Summarize Market Sentiment – Analyzes ticker news via Gemini 2.0 Flash and returns sentiment + summary.
- Predict Stock Price – Generates a 30-day prediction with rationale, target, and confidence.
All market/metadata/news calls live in src/lib/stock-api.ts and use Polygon.io for:
- Aggregates (OHLCV/time series)
- Company details & branding
- Ticker search
- News sentiment inputs
Implements the Black–Scholes model with:
- Call & put valuation
- Standard normal CDF approximation
- User input validation via Zod + React Hook Form
- Tailwind CSS + shadcn/ui
- Recharts for responsive graphs
- Lucide icons
- Install Firebase tools:
npm install -g firebase-tools firebase login
- Configure:
firebase init hosting
- Add your API keys to Firebase environment.
- Build and deploy:
npm run build firebase deploy
- Add indicators (SMA/EMA/RSI/MACD)
- Backtesting features
- Watchlists & alerts
- Caching for API quotas
- Multi-provider data failover
- Polygon.io – Market data & news
- Google Genkit + Gemini – AI flow orchestration
- shadcn/ui, Recharts, Zod, React Hook Form, Lucide