An advanced financial investment recommendation platform that leverages machine learning to generate personalized investment strategies. The system integrates real-time market data, historical stock data, user preferences, and predictive analytics to provide intelligent investment guidance.

- Personalized stock recommendations based on user preferences
- Portfolio management and performance tracking
- Real-time market data integration
- Historical stock price data and visualization
- News sentiment analysis
- Interactive dashboard with charts and analytics
This project uses PostgreSQL as the database.
- Python 3.8 or higher
- PostgreSQL
- Git (for cloning the repository)
git clone https://github.com/marinaredamekhael/FinancialAdvisor.git
cd FinancialAdvisorpython -m venv venv
venv\Scripts\activatepython3 -m venv venv
source venv/bin/activatepip install -r project_requirements.txt- Create a PostgreSQL database
- Note down your database credentials (host, database name, username, password, port)
Create a .env file in the root directory with the following variables:
# Database configuration
DATABASE_URL=postgresql://username:password@host:port/database_name
# API Keys
# Optional for enhanced functionality
ALPHAVANTAGE_API_KEY=your_alphavantage_api_key
NEWS_API_KEY=your_newsapi_key
# Flask configuration
FLASK_SECRET_KEY=your_secret_key
You have two options to set up the database:
# Run the setup script to create tables and add sample data
python setup_local.pyThis will:
- Create all database tables
- Add a demo user (username: demo_user, password: password123)
- Add sample stocks, portfolio items, news, and recommendations
# Run the application once to create the database tables only
python main.pypython main.pyOr with gunicorn (for production):
gunicorn --bind 0.0.0.0:5000 main:appThe application will be available at http://localhost:5000
- Register a new user account
- Set up your investment preferences
- Navigate to
/test/generate-recommendationsto populate sample stocks and recommendations - Add stocks to your portfolio
- Explore the dashboard, recommendations, and news features
main.py: Entry point for the applicationapp.py: Flask app configurationmodels.py: Database modelsroutes.py: Application routes and viewsdata_fetcher.py: Functions to fetch stock and news datarecommendation.py: Recommendation enginesentiment_analysis.py: News sentiment analysistemplates/: HTML templatesstatic/: CSS, JavaScript, and other static files
- Backend: Python, Flask, SQLAlchemy
- Database: PostgreSQL
- Data Processing: Pandas, NumPy, scikit-learn
- Natural Language Processing: NLTK
- Frontend: HTML, CSS, Bootstrap, Chart.js
- APIs: Yahoo Finance, News API, Alpha Vantage