StockSavvy: Streamlined Stock Trading and Finance
Welcome to StockSavvy, your streamlined Python and Flask-based web app for stock trading and finance management.
StockSavvy allows users to easily create an account, manage their portfolio, and trade stocks with intuitive features.
- Account Management: Users can create accounts or log in securely.
- Portfolio Overview: View the current valuation of owned stocks alongside the cash balance.
- Stock Quoting: Easily search for stock prices using symbols via an intuitive API request.
- Buying and Selling: Seamlessly execute stock trades - buy or sell stocks effortlessly.
- Transaction History: Keep track of all transactions, displaying date, time, and price at that moment.
- Error Handling: Ensures a smooth experience by handling various errors:
- Wrong stock symbols
- Buying more stocks than the cash balance
- Selling stocks in excess of what's owned
- Incorrect login credentials
- Registration with an existing username
- π
static
: Contains icons and CSS file - π
templates
: HTML files for different pagesapology.html
: Error handlingbuy.html
: Stock buying pagehistory.html
: Transaction history pagelayout.html
: Main home pagelogin.html
: User login pagequote.html
: Stock quote pagequoted.html
: Display stock price after searchregister.html
: User registration pagesell.html
: Stock selling page
- π
app.py
: Flask app with sessions and routes- Uses session and database
- Contains routes for HTML templates
- π
finance.db
: Main database with tables for users, transactions, and portfolios - π
helpers.py
: Python module with functions and decoratorsapology()
,login_required()
,lookup()
,usd()
- CS50
- Flask
- Flask_Session
- Requests
- Urllib
- UUID
- Pytz
- Functools
- CSV
- Datetime
- Werkzeug.security
Python
Flask
HTML
CSS
Bootstrap
SQLite3
API
Overview: Visual representation of the stock trading web app.
Database: Track all past transactions, users, and portfolios with date, time, and prices.
- Clone the repository.
- Install required dependencies:
pip install cs50 Flask Flask_Session requests pytz
- Execute
flask run
. - Access the app through the provided localhost URL.
Feel free to contribute and enhance StockSavvy! πππΌ