The Stock Analysis Platform is a comprehensive web application that replicates the core features of popular trading platforms like Robinhood. It combines real-time market data with intelligent analysis tools to provide users with an immersive trading simulation experience.
π Live Demo
- Frontend: Deployed on Vercel for seamless Next.js integration and global CDN distribution
- Backend: Hosted on Render with automatic scaling and continuous deployment
- Database: Firebase Firestore for real-time data synchronization across clients
- Authentication: Firebase Authentication for secure user management
- Environment Variables: Securely managed through Vercel and Render dashboards
- π Real-time Market Data - Live stock prices and market data via Finnhub API
- π Interactive Charts - Visualize stock performance with customizable time ranges
- π§ Smart Trading Insights - Data-driven recommendations powered by statistical analysis
- πΌ Portfolio Management - Track your investments and performance metrics
- π° Trading Simulation - Buy and sell stocks with virtual currency
- π Secure Authentication - User accounts powered by Firebase
- π± Responsive Design - Optimized for both desktop and mobile devices
- π° News Integration - Latest stock-related news for informed decisions
- π¬ Discussion Forum - Community discussions about stocks and market trends
- π Top Gainers - Track the best-performing stocks in real-time
|
|
- Node.js (v14 or higher)
- Python (v3.8 or higher)
- Firebase account
- Finnhub API key (free tier available)
- Git for version control
git clone https://github.com/shreyas463/Stock-Analysis-platform.git
cd Stock-Analysis-platform- Create a new Firebase project at Firebase Console
- Enable Authentication (with Email/Password) and Firestore in your project
- Generate a new web app in your Firebase project and copy the configuration
- Generate a new service account key for the admin SDK:
- Go to Project Settings > Service Accounts
- Click "Generate New Private Key"
- Save the JSON file as
serviceAccountKey.jsonin thebackenddirectory
# Navigate to the backend directory
cd backend
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Create and configure environment variables
cp .env.example .envUpdate the .env file with your API keys and Firebase configuration:
FLASK_APP=app.py
FLASK_ENV=development
GOOGLE_APPLICATION_CREDENTIALS=serviceAccountKey.json
SECRET_KEY=your-secret-key-here
FINNHUB_API_KEY=your-finnhub-api-key# Navigate to the frontend directory
cd ../frontend
# Install dependencies
npm install
# Create and configure environment variables
cp .env.example .env.localUpdate the .env.local file with your Firebase configuration:
NEXT_PUBLIC_API_URL=http://localhost:5001
NEXT_PUBLIC_FIREBASE_API_KEY=your-api-key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-project-id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your-sender-id
NEXT_PUBLIC_FIREBASE_APP_ID=your-app-id1. Start the backend server:
# From the project root
cd backend
source venv/bin/activate # On Windows: venv\Scripts\activate
python app.pyThe backend server will start on http://localhost:5001
2. Start the frontend development server:
# From the project root (in a new terminal)
cd frontend
npm run dev3. Access the application:
Open http://localhost:3000 in your browser
This application is deployed using a modern cloud architecture:
-
Frontend: Deployed on Vercel
- Automatic deployments from the main branch
- Environment variables configured in Vercel dashboard
- Custom domain configuration with SSL
-
Backend: Hosted on Render
- Web service with automatic scaling
- Environment variables securely stored
- Continuous deployment from GitHub
For detailed deployment instructions, see DEPLOYMENT.md
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
π§ March 2025: Finnhub API Integration Fix
- π Bug Fix: Resolved issues with Finnhub stock price display in production environment
- π Environment Variables: Improved handling of API keys and environment configuration
- π CORS Configuration: Enhanced cross-origin resource sharing for better API communication
- π Logging: Added comprehensive logging for better debugging and monitoring
β οΈ Error Handling: Improved error messages and fallback mechanisms
π Stock Analysis Feature Improvements
- π Backend-Frontend Integration: Fixed mismatch between backend response structure and frontend interface
- πΊοΈ Data Mapping: Implemented proper mapping of backend response data to match frontend expectations
β οΈ Error Handling: Enhanced error handling with proper type checking- π€ User Experience: Improved reliability for better trading decisions
β‘ Performance & Reliability Enhancements
- π° Portfolio Calculations: Enhanced accuracy of value calculations
- β±οΈ Price Loading Optimization:
- Removed unnecessary re-renders
- Extended update intervals from 10s to 15s
- Eliminated redundant console logs
- Simplified portfolio value calculations
- π§ ML Analysis: Separated analysis from buy logic for better maintainability
- π Type Safety: Added comprehensive type checking throughout the application
π¨ UI/UX Refinements
- π Market Overview: Streamlined market data display with unified section
- πΌ Portfolio Display: Improved value accuracy and presentation
- π° Trading Interface: Enhanced buy/sell flow with clearer feedback
- π Layout Optimization: Removed duplicate sections for cleaner interface
- π Enhanced Search: Improved search dropdown with better positioning
- π Top Gainers Section: Redesigned with fallback data for consistent display
π§© Interactive Features
- ποΈ Interactive Login Character: Animated character that watches users type and politely closes its eyes during password entry
- π± Responsive Layout: Trading panel moved next to chart for better usability
- β‘ Real-time Updates: Live stock price updates when selecting stocks
- π¬ Discussion Forum: Enhanced community interaction features
The platform includes intelligent trading capabilities powered by statistical analysis:
| Feature | Description |
|---|---|
| π Price Forecasting | Advanced statistical analysis for stock price prediction |
| π Buy/Sell Recommendations | Data-driven suggestions based on historical performance |
| π Trend Analysis | Identification of potential market trends and patterns |
| π Fallback Mechanisms | Ensures predictions are available even with limited API data |
| βοΈ Risk Assessment | Evaluation of potential investment risks |
Comprehensive tools to track and manage your investments:
- π Real-time Portfolio Valuation: Up-to-date value of your holdings
- π° Transaction History: Complete record of all your trades
- π Performance Metrics: Track your investment performance over time
- π Automatic Updates: Portfolio values refresh automatically
The login page features an engaging animated character that creates a more personalized experience:
- Reactive Eye Movements: Eyes follow along as users type in username fields
- Privacy-Conscious Design: Eyes automatically close during password entry
- Subtle Animations: Natural-looking movements that respond to user input
- Real-time cryptocurrency prices displayed alongside the login form
- Track market movements even before logging in
- Seamlessly integrated with the authentication flow
- Fork the repository
- Create a new branch for your feature
- Commit your changes
- Push to the branch
- Create a new Pull Request
This project is licensed under the MIT License
