StockSage is an AI-powered stock market consultant that provides beginner-friendly investment advice. Built with Next.js, it combines rule-based analysis with AI-generated insights to help users make informed investment decisions.
- Portfolio Analysis: Input your stocks and get comprehensive analysis
- AI-Powered Advice: Get personalized investment recommendations
- Risk Assessment: Understand your portfolio's risk level and diversification
- Usage Tracking: Monitor your analysis usage with Flexprice integration
- Real-time Data: Live stock data via Pathway integration (with mock fallback)
To enable full functionality, add these environment variables to your Vercel project:
-
Flexprice API Key (for usage tracking and billing): ``` FLEXPRICE_API_KEY=your_flexprice_api_key_here ```
-
Pathway API Key (for real-time stock data): ``` PATHWAY_API_KEY=your_pathway_api_key_here ```
- Go to your Vercel project dashboard
- Navigate to Settings → Environment Variables
- Add the variables above with your actual API keys
- Redeploy your application
- Visit Flexprice.io
- Sign up for an account
- Create a new project
- Copy your API key from the dashboard
- Configure usage events for:
portfolio_analysisadvice_generationstock_search
- Visit Pathway.com
- Sign up for their financial data API
- Subscribe to stock data endpoints
- Copy your API key from the dashboard
StockSage is designed to work even without API keys:
- Without Flexprice: Usage tracking will log to console instead of billing service
- Without Pathway: Mock stock data will be used for demonstrations
This allows you to test and develop the application before setting up paid integrations.
```bash npm install npm run dev ```
Visit http://localhost:3000 to see the application.
Deploy to Vercel with one click:
Remember to add your environment variables after deployment for full functionality.
- Frontend: Next.js 14 with App Router
- Styling: Tailwind CSS with dark theme
- AI: Vercel AI SDK for advice generation
- Data: Pathway API for live stock data (with mock fallback)
- Billing: Flexprice for usage tracking
- Deployment: Vercel platform
The application tracks these events for billing:
portfolio_analysis: When a user analyzes their portfolioadvice_generation: When AI advice is generatedstock_search: When users search for stocks
Each event includes relevant metadata for usage analytics and billing purposes.