This is the backend server for a stock portfolio management application. It provides APIs for user authentication, stock trading, portfolio management, and stock analysis using AI.
- User registration and authentication
- Real-time stock quotes
- Buy and sell stocks
- View portfolio and transaction history
- AI-powered stock analysis using Google's Gemini API
- Database integration for persistent storage
- Python 3.8+
- Flask
- Google Generative AI (Gemini)
- PostgreSQL
Before you begin, ensure you have met the following requirements:
- Python 3.8 or higher installed
- pip (Python package manager)
- PostgreSQL database
Follow these steps to set up the project locally:
-
Clone the repository:
git clone https://github.com/akshatg5/Finance-CS50
-
Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
-
Set up the environment variables: Create a
.env
file in the root directory with the following content:JWT_SECRET=your_jwt_secret_here FINNHUB_API_KEY=your_finnhub_api_key_here DATABASE_URI=your_database_uri_here POLYGON_API_KEY=your_polygon_api_key_here GEMINI_API_KEY=your_gemini_api_key_here
Replace the placeholder values with your actual API keys and database URI.
-
Initialize the database:
flask db init flask db migrate flask db upgrade
-
Run the application:
flask --app api/index.py run
The server should now be running on http://127.0.0.1:5000
Contributions to the Litekite Backend are welcome. Please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature/featureName
) - Make your changes
- Commit your changes (
git commit -m 'feat/fix:Add/fix this feature'
) - Push to the branch (
git push origin feature/featureName
) - Open a Pull Request
If you have any questions or feedback, please reach out to Me.