intelligent stock analysis, simplified
A modern, full-stack Next.js application for AI-powered stock analysis with beautiful UI and real-time insights for both Indian and international stocks.
- π€ AI-Powered Analysis: Real-time stock analysis using Perplexity AI
- π Global Market Support: Both Indian (NSE/BSE) and international stocks
- π Comprehensive Metrics: Current price, target price, PE ratio, price changes
- πΉ Smart Recommendations: Buy/sell/hold with risk assessment
- π Sentiment Analysis: Bullish/bearish/neutral market sentiment
- β‘ Real-time Data: Live stock prices and market information
- π Secure Authentication: Clerk-powered user management
- πΎ Data Persistence: Supabase PostgreSQL database
- π± Mobile Responsive: Beautiful UI optimized for all devices
- π¨ Modern Design: Glass morphism effects, dark theme, smooth animations
- β‘ Performance: Next.js 14 with App Router, optimized builds
- π‘οΈ Security: RLS policies, environment protection, CSP headers
- π Analysis History: Save and review past stock analyses
- β Favorites: Mark important analyses for quick access
- π Smart Search: Intelligent ticker validation and suggestions
- π Dashboard: Personalized overview with statistics
- π Dark Theme: Beautiful Perplexity-inspired design
- Next.js 14 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- Framer Motion - Smooth animations
- Radix UI - Accessible component primitives
- Lucide React - Beautiful icons
- Perplexity AI - Stock analysis and market data
- Supabase - PostgreSQL database with real-time features
- Clerk - Authentication and user management
- Next.js API Routes - Server-side logic
- Netlify - Hosting and deployment
- Edge Functions - Serverless API endpoints
- Node.js 18+ and npm
- Supabase account
- Clerk account
- Perplexity AI API key
git clone https://github.com/yourusername/tradeo-next.git
cd tradeo-nextnpm installCreate a .env.local file in the root directory:
# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_your_key_here
CLERK_SECRET_KEY=sk_test_your_key_here
# Clerk URLs
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/dashboard
# Supabase
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key_here
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key_here
# Perplexity AI
PERPLEXITY_API_KEY=your_perplexity_api_key_here
# App Configuration
NEXT_PUBLIC_APP_URL=http://localhost:3000- Create a new Supabase project
- Run the SQL commands from
database-setup.sqlin your Supabase SQL editor - Verify the tables and policies are created correctly
- Create a Clerk application
- Configure OAuth providers (optional)
- Set up redirects in Clerk dashboard
- Copy your publishable and secret keys
- Get your Perplexity AI API key from perplexity.ai
- Add it to your
.env.localfile
npm run devVisit http://localhost:3000 to see your application.
-
Build Configuration
npm run build
-
Environment Variables Set all environment variables in Netlify dashboard under Site settings > Environment variables
-
Deploy
- Connect your GitHub repository to Netlify
- Set build command:
npm run build - Set publish directory:
.next - Deploy
- Fork this repository
- Connect to Netlify
- Configure environment variables
- Deploy automatically on push
- id (UUID, Primary Key)
- user_id (TEXT, Unique)
- email (TEXT)
- first_name (TEXT)
- last_name (TEXT)
- avatar_url (TEXT)
- created_at (TIMESTAMP)
- updated_at (TIMESTAMP)- id (UUID, Primary Key)
- user_id (TEXT)
- ticker (TEXT)
- stock_data (JSONB)
- analysis (JSONB)
- is_favorite (BOOLEAN)
- created_at (TIMESTAMP)
- updated_at (TIMESTAMP)- Perplexity AI: Check your plan limits
- Supabase: 500MB database, 500MB bandwidth (free tier)
- Clerk: 10,000 MAU (free tier)
- Row Level Security (RLS) on all tables
- Environment variable protection
- CSP headers for XSS protection
- Secure cookie settings
Edit tailwind.config.ts to customize the color scheme:
colors: {
primary: "hsl(var(--primary))",
// Add your custom colors
}All components use Tailwind CSS with custom utility classes defined in globals.css.
POST /api/analyze
{
"ticker": "AAPL"
}
Response:
{
"stockData": StockData,
"analysis": StockAnalysis,
"analysisId": string
}GET /api/analyze?limit=10&offset=0
Response:
{
"analyses": DatabaseAnalysis[]
}-
Database Connection Error
- Verify Supabase URL and keys
- Check RLS policies are enabled
-
Authentication Issues
- Verify Clerk keys and domain settings
- Check redirect URLs match
-
API Errors
- Verify Perplexity API key
- Check rate limits
NODE_ENV=development npm run dev- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.
This application is for informational purposes only and should not be considered as financial advice. Always do your own research and consult with a qualified financial advisor before making investment decisions.
For support, email [email protected] or join our Discord community.
Built with β€οΈ by the tradeo team