A powerful AI-driven application that analyzes stock market sentiment using Google's Gemini AI. Get real-time sentiment analysis, technical indicators, news feeds, and investment recommendations for any stock across multiple exchanges.
- π Multi-Exchange Support: NSE, BSE, NASDAQ, NYSE, LSE, TSE
- π€ AI-Powered Analysis: Uses Google Gemini 2.5 Flash for sentiment analysis
- π Technical Indicators: RSI, Moving Averages, Volume analysis
- π° News Integration: Latest news articles and market updates
- π Interactive Charts: Price charts with technical overlays
- π― Investment Recommendations: Buy/Hold/Sell suggestions with reasoning
- π± Responsive Design: Works on desktop, tablet, and mobile
- π Real-time Data: Up-to-date market information
- π€ Export & Share: CSV export and social media sharing
- Node.js (v16 or higher)
- npm or yarn
- Google Gemini API Key
-
Clone the repository
git clone <your-repo-url> cd Stock-Market-Sentiment
-
Install dependencies
npm install
-
Set up environment variables
# Copy the template file cp env.template .env # Edit .env file and add your API key GEMINI_API_KEY=your_gemini_api_key_here
-
Get your Gemini API Key
- Visit: https://makersuite.google.com/app/apikey
- Sign in with your Google account
- Create a new API key
- Copy the key to your
.envfile
-
Run the development server
npm run dev
-
Open your browser
- Navigate to
http://localhost:3000 - Start analyzing stocks! π
- Navigate to
# Development
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
# Docker
docker build -t stock-sentiment-analyzer . # Build Docker image
docker run -p 3000:3000 -e GEMINI_API_KEY=xxx stock-sentiment-analyzer # Run container
docker-compose up -d # Run with Docker Compose
docker-compose --profile dev up # Run development mode
# Linting
npm run lint # Run ESLint
npm run lint:fix # Fix ESLint issuesStock-Market-Sentiment/
βββ src/
β βββ components/ # React components
β β βββ icons/ # SVG icon components
β β βββ AspectRadarChart.tsx
β β βββ LoadingSpinner.tsx
β β βββ NewsFeed.tsx
β β βββ PriceChart.tsx
β β βββ SentimentChart.tsx
β β βββ SentimentResult.tsx
β β βββ StockInputForm.tsx
β βββ services/ # API services
β β βββ geminiService.ts
β βββ types.ts # TypeScript type definitions
β βββ utils.ts # Utility functions
β βββ App.tsx # Main application component
βββ public/ # Static assets
βββ .env # Environment variables
βββ env.template # Environment template
βββ package.json # Dependencies and scripts
βββ vite.config.ts # Vite configuration
βββ README.md # This file
Create a .env file in the root directory:
# Required: Gemini API Configuration
GEMINI_API_KEY=your_gemini_api_key_here
# Optional: Server Configuration
PORT=3000- NSE (India) - National Stock Exchange
- BSE (India) - Bombay Stock Exchange
- NASDAQ (USA) - National Association of Securities Dealers
- NYSE (USA) - New York Stock Exchange
- LSE (UK) - London Stock Exchange
- TSE (Japan) - Tokyo Stock Exchange
- Input: Enter a stock symbol and select an exchange
- AI Analysis: Gemini AI analyzes market sentiment using:
- Recent news articles
- Social media trends
- Financial reports
- Technical indicators
- Results: Get comprehensive analysis including:
- Overall sentiment score (-1 to +1)
- Investment recommendation
- Positive and negative points
- Technical indicators (RSI, Moving Averages)
- Historical price data
- Recent news articles
- Frontend: React 18, TypeScript, Vite
- Styling: Tailwind CSS
- Charts: Recharts
- AI: Google Gemini 2.5 Flash
- Icons: Custom SVG components
- Build Tool: Vite
-
Set up environment variables
cp env.template .env # Edit .env with your API key -
Build and run with Docker Compose
# Production docker-compose up -d # Development with hot reload docker-compose --profile dev up
-
Access the application
- Production: http://localhost:3000
- Development: http://localhost:3001
-
Build the image
docker build -t stock-sentiment-analyzer . -
Run the container
docker run -p 3000:3000 \ -e GEMINI_API_KEY=your_api_key_here \ stock-sentiment-analyzer
- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy!
- Build the project:
npm run build - Deploy the
distfolder to Netlify - Add environment variables in Netlify dashboard
- Build the project:
npm run build
- Upload the
distfolder to your web server - Configure your server to serve the built files
- Never commit your
.envfile to version control - Keep your API keys secure
- Use environment variables for all sensitive data
- Consider using a proxy server for production API calls
"GEMINI_API_KEY environment variable is not set"
- Ensure your
.envfile exists in the root directory - Check that the API key is correctly formatted
- Restart the development server after adding the key
"Network error"
- Check your internet connection
- Verify your API key is valid
- Ensure the Gemini API is accessible from your location
"Model not found"
- The app uses
gemini-2.5-flashmodel - Ensure your API key has access to this model
- Check Google's model availability
- Check the browser console for detailed error messages
- Verify your API key is working: https://makersuite.google.com/app/apikey
- Ensure all dependencies are installed:
npm install - Try restarting the development server
This project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
If you encounter any issues or have questions:
- Check the troubleshooting section above
- Search existing issues in the repository
- Create a new issue with detailed information
- Include error messages and steps to reproduce
- Google Gemini AI for powerful language processing
- Recharts for beautiful chart components
- Tailwind CSS for utility-first styling
- React team for the amazing framework
Disclaimer: This application is for educational and informational purposes only. It is not intended as financial advice. Always consult with a qualified financial advisor before making investment decisions.