A web-based platform that allows users to simulate buying and selling stocks with virtual money. Built with Flask, this application provides a safe environment to practice trading strategies without risking real money.
- User Authentication: Register an account, log in, and change passwords securely
- Portfolio Management: View your current holdings and cash balance
- Real-time Quotes: Look up real-time stock prices using IEX API
- Trading: Buy and sell stocks with virtual money
- Transaction History: Track all your past transactions
- Security: Password hashing and session management for secure user experience
- Backend: Flask (Python)
- Database: SQLite
- Frontend: HTML, CSS, Bootstrap 4.1
- APIs: IEX Cloud for real-time stock data
- Clone the repository
- Install the required packages:
pip install -r requirements.txt - Set your IEX API key as an environment variable:
(On Windows:
export API_KEY=your_api_keyset API_KEY=your_api_key) - Run the application:
flask run
- Register for an account
- Use the "Quote" feature to look up stock prices
- Buy stocks with your initial cash balance
- Track your portfolio performance
- Sell stocks when needed
- Check your transaction history
The application uses the following main tables:
users: Stores user accounts and cash balancescurrent: Tracks users' current stock holdingsrecord: Stores all transaction records
- The application uses a SQLite database named
finance.db(not included in the repository) - Each new user starts with $10,000 in virtual cash
- Stock data is provided by IEX Cloud, which requires an API key