Demo Link : https://stocks-portfolio-app.onrender.com/
Stocks Portfolio Management Web Application is a web application designed to help users manage their personal financial portfolio. Users can buy and sell stocks, view their financial history, check stock prices, and track their total net worth. The application uses a combination of Flask for the backend, Jinja for templating, and SQLite for data storage, making it lightweight and easy to deploy.
- User Registration/Login: Secure user authentication for tracking personalized portfolios.
- Quote Stocks: Users can search for real-time stock quotes using an external API.
- Buy and Sell Stocks: Users can buy shares of stock at current market prices and sell them when needed.
- Transaction History: A complete history of all transactions (buys and sells) is maintained for each user.
- Portfolio Overview: A dashboard where users can view the current state of their portfolio, including the stocks they own and their respective values.
- Check Account Balance: Users can keep track of their cash balance after transactions.
To run this project locally, you will need:
- Python 3.8+
- Flask 2.0+
- SQLite3
- IEX Exchange API for fetching stock quotes
git clone https://github.com/uzair401/flask.git
cd flask/financepython3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txt- Register for an API key with a stock quote provider (such as Alpha Vantage or IEX Cloud).
- Store the API key in your environment variables or in the
.envfile.
flask shell
from app import db
db.create_all()flask runThe app will run locally at http://127.0.0.1:5000/. Open your browser and start managing your finances!
- Register/Login: Start by creating an account and logging in to the system.
- View Stock Quotes: Use the stock quote feature to search for stocks and get real-time price updates.
- Buy Stocks: Select a stock and input the number of shares to buy. The cost will be deducted from your cash balance.
- Sell Stocks: Choose stocks you own, and input the number of shares to sell. The proceeds will be added to your cash balance.
- Portfolio Management: View your portfolio and track the performance of your investments.
- Transaction History: A log of all your buys and sells is available for review.
flask/
│
├── finance/ # Main application directory
│ ├── app/ # Flask application files
│ ├── templates/ # HTML templates for rendering views
│ ├── static/ # Static files (CSS, JS)
│ ├── __init__.py # App initialization
│ └── database.db # Database for user and transactions
│
├── requirements.txt # Python dependencies
└── README.md # Project documentation



