StockAI is a simple, modern platform for stock prediction and analysis. It combines deep learning (LSTM) for price forecasting, technical analysis tools, and an AI-powered chat advisor all in a clean, responsive web app.
- AI Predictions: LSTM neural networks forecast stock prices with confidence scores.
- Technical Analysis: RSI, MACD, Bollinger Bands, and more.
- Interactive Charts: Visualize trends, signals, and portfolio performance.
- AI Stock Advisor: Chat with AI for investment tips and insights.
- Real-Time Data: Live prices, news, and market sentiment.
- Responsive Design: Works great on desktop and mobile.
-
Homepage: Overview of features and benefits.
-
Dashboard: Personalized portfolio, market data and AI insights.
-
Predictions: Search stocks, view forecasts, and technical indicators.
-
Learning Resources: Educational content and blogs on stock trading and AI.
-
Stocks News and Sentiment: Latest news and sentiment analysis.
├── project/
│ ├── app/
│ │ ├── page.tsx
│ │ ├── dashboard/
│ │ ├── predictions/
│ │ ├── advisor/
│ │ ├── analytics/
│ │ ├── portfolio/
│ │ ├── news/
│ │ |── globals.css
| | └── layout.tsx
│ ├── components/
│ │ ├── ui/
│ │ │ ├── button.tsx
│ │ │ ├── card.tsx
│ │ │ ├── input.tsx
│ │ │ ├── chart.tsx
│ │ │ └── dialog.tsx
│ │ ├── charts/
│ │ │ ├── StockChart.tsx
│ │ │ ├── PredictionChart.tsx
│ │ │ ├── TechnicalChart.tsx
│ │ │ └── PortfolioChart.tsx
│ │ ├── prediction/
│ │ │ ├── PredictionCard.tsx
│ │ │ ├── ConfidenceScore.tsx
│ │ │ ├── RiskAssessment.tsx
│ │ │ └── SignalIndicator.tsx
│ │ ├── advisor/
│ │ │ ├── ChatInterface.tsx
│ │ │ ├── MessageBubble.tsx
│ │ │ ├── SuggestionCard.tsx
│ │ │ └── AnalysisReport.tsx
│ │ └── layout/
│ │ ├── Header.tsx
│ │ ├── Sidebar.tsx
│ │ ├── Footer.tsx
│ │ └── MobileNav.tsx
│ ├── lib/
│ │ ├── utils.ts
│ │ ├── api.ts
│ │ ├── ml-utils.ts
│ │ ├── validators.ts
│ │ ├── constants.ts
│ │ └── types.ts
│ ├── hooks/
│ │ ├── useStockData.ts
│ │ ├── usePredictions.ts
│ │ ├── usePortfolio.ts
│ │ └── useWebSocket.ts
│ ├── public/
│ │ ├── images/
│ │ ├── icons/
│ │ └── favicon.ico
│ ├── styles/
│ │ └── globals.css
│ ├── package.json
│ ├── next.config.js
│ ├── tailwind.config.ts
│ ├── tsconfig.json
│ └── .env.local (gitignored)
│
├── ML Backend / notebooks:
│ ├── stock_prediction_lstm.ipynb
│ ├── technical_analysis.ipynb
│ ├── model_training.py
│ └── data_preprocessing.py
│
├── README.md
├── LICENSE
├── vercel.json
└── requirements.txt
-
Clone & Install
git clone https://github.com/Aryanwadhwa14/Stocks-prediction-analysis.git cd Stocks-prediction-analysis/project npm install # or yarn install # or pnpm install
-
Environment configuration:
# Create environment file cp .env.example .env.local # Add your API keys to .env.local: NEXT_PUBLIC_STOCK_API_KEY=your_stock_api_key NEXT_PUBLIC_BASE_URL=http://localhost:3000 DATABASE_URL=your_database_url (if using database)
-
Run the development server:
npm run dev # or yarn dev # or pnpm dev
Open http://localhost:3000 in your browser to see the application.
-
Navigate to project directory:
cd Stocks-prediction-analysis/project -
Install Python dependencies (if using local ML models):
pip install numpy pandas matplotlib scikit-learn tensorflow yfinance requests
-
For Jupyter notebook exploration:
pip install jupyter notebook jupyter notebook # Open stock_prediction_lstm.ipynb in the browser
Note: The main application integrates ML predictions via API services and doesn't require a separate Python backend for basic functionality.
- Framework: Next.js 14+ with App Router
- Language: TypeScript for type safety
- Styling: Tailwind CSS for utility-first styling
- UI Components: shadcn/ui for modern, accessible components
- Charts: Recharts for interactive financial charts
- State Management: React Context/useState for component state
- Icons: Lucide React for consistent iconography
- Animations: Framer Motion for smooth transitions
- API Routes: Next.js API routes for server-side functionality
- External APIs: Fintech graded apps Finance API, Alpha Vantage for stock data, Nasdaq and other market data sources
- ML Models: TensorFlow.js for client-side predictions or external ML APIs
- AI Integration: Google API for investment advisory
- Data Processing: Client-side processing with JavaScript/TypeScript
- Real-time Data: WebSocket connections for live market data
- Frontend Hosting: Vercel for optimal Next.js deployment
- Database: Vercel Postgres or external database (if needed)
- Environment Management: Vercel environment variables
- CDN: Vercel Edge Network for global content delivery
- Analytics: Vercel Analytics for performance monitoring
- Domain: Custom domain support through Vercel
model = Sequential([
LSTM(50, return_sequences=True, input_shape=(sequence_length, features)),
Dropout(0.2),
LSTM(50, return_sequences=True),
Dropout(0.2),
LSTM(50),
Dropout(0.2),
Dense(25),
Dense(1)
])- RSI (Relative Strength Index): Momentum oscillator (0-100)
- MACD: Moving Average Convergence Divergence
- Bollinger Bands: Volatility and price level indicator
- SMA/EMA: Simple and Exponential Moving Averages
- Volume Analysis: On-Balance Volume (OBV)
- RMSE: Root Mean Square Error
- MAE: Mean Absolute Error
- MAPE: Mean Absolute Percentage Error
- Directional Accuracy: Prediction of price direction
- Sharpe Ratio: Risk-adjusted returns
- Hero section with value proposition
- Feature highlights and benefits
- Live prediction preview
- Call-to-action for user registration
- Portfolio overview and performance
- Real-time market data feed
- Quick access to top predictions
- News and market sentiment analysis
- Stock symbol search and selection
- Interactive prediction charts
- Confidence intervals and risk metrics
- Historical accuracy display
- Natural language investment queries
- Contextual market analysis
- Portfolio optimization suggestions
- Educational content and explanations
{
"dependencies": {
"next": "^14.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.2.0",
"tailwindcss": "^3.3.0",
"@radix-ui/react-*": "^1.0.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"tailwind-merge": "^1.14.0",
"recharts": "^2.8.0",
"lucide-react": "^0.290.0",
"framer-motion": "^10.16.0"
},
"devDependencies": {
"@types/node": "^20.8.0",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"eslint": "^8.52.0",
"eslint-config-next": "^14.0.0",
"autoprefixer": "^10.4.16",
"postcss": "^8.4.31"
}
}GET /api/stocks/{symbol} # Get stock information
GET /api/stocks/{symbol}/history # Historical price data
GET /api/stocks/{symbol}/predict # Get predictions
POST /api/predict # Generate new prediction
GET /api/predictions/{id} # Get prediction details
GET /api/predictions/batch # Bulk predictions
POST /api/advisor/chat # Chat with AI advisor
GET /api/advisor/suggestions # Get recommendations
POST /api/advisor/analyze # Analyze portfolio
- API Rate Limiting: Prevents abuse and ensures fair usage
- Input Validation: Comprehensive data validation and sanitization
- CORS Configuration: Secure cross-origin resource sharing
- Environment Variables: Secure API key management
- Error Handling: Graceful error handling and user feedback
- Mobile-First: Optimized for mobile devices
- Tablet Support: Enhanced experience on tablets
- Desktop: Full-featured desktop interface
- Touch-Friendly: Intuitive touch interactions
- Accessibility: WCAG compliance and screen reader support
- Educational Purpose: This platform is for educational and research purposes only
- Not Financial Advice: Predictions should not be considered as financial advice
- Market Risk: All investments carry risk of loss
- Data Accuracy: While we strive for accuracy, data may have delays or errors
- Past Performance: Historical performance doesn't guarantee future results
- LSTM stock prediction model
- Web interface with Next.js
- AI advisor integration
- Technical analysis tools
- Real-time WebSocket data feeds
- Advanced portfolio management
- Social trading features
- Options and derivatives prediction
- Cryptocurrency support
- Multi-language support
- Advanced risk management tools
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes and add tests
- Commit your changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Create a Pull Request
- Follow TypeScript best practices
- Write tests for new features
- Update documentation as needed
- Follow the existing code style
- Add meaningful commit messages
- GitHub Issues: Report bugs or request features
- Email: Aryan Wadhwa
- Documentation: Check the docs folder for detailed guides
Aryan Wadhwa
- GitHub: Aryanwadhwa14
- LinkedIn: Aryan Wadhwa
Dipesh Gupta
- GitHub: Dipesh_Gupta
- LinkedIn: Dipesh Gupta
- TensorFlow Team: For the excellent ML framework
- Vercel: For seamless deployment platform
- shadcn/ui: For beautiful UI components
- Yahoo Finance: For reliable market data
- Google Gemini: For AI advisor capabilities
- Open Source Community: For inspiration and resources
This project is licensed under the MIT License - see the LICENSE file for details.
** Star this repository if you find it helpful!**
🌐 Live Demo • 📚 Documentation • Report Bug • ✨ Request Feature
Note: This platform is only for educational purpose and continuously evolving. Check back for updates and new features!