Stock Trading Platform (Website)
Stock trading platform simulator to teach young kids about Finance/stock markets, uses IEX API to pull live stock prices from the NASDAQ.
Description
Tech Stack
- Flask: Manages database executions, routing and function calls
- HTML (Jinja) / CSS (Bootstrap): Used to render pages quickly and to make them look visually appealing
- SQL
- Python: Database executions, template rendering, function calls
- IEX Cloud API: Pulls live stock prices from the NASDAQ
Challenges
- Executing SQL queries according to the user's actions (buying stocks/selling stocks/fetching portfolio etc.)
Requirements
- Install Python (https://python.org/download/)
- Install SetupTools ($ pip install setuptools)
- Install pip ($ easy_install pip)
- Install Flask ($ pip install flask)
- Install cs50 module ($ pip install cs50)
- Install flask_session ($ pip install flask_session)
- Install requests ($ pip install requests)
- Create IEX API Access Token (see below)
Create API Access Token
- Visit iexcloud.io/cloud-login#/register/.
- Select the “Individual” account type, then enter your name, email address, and a password, and click “Create account”.
- Once registered, scroll down to “Get started for free” and click “Select Start plan” to choose the free plan.
- Once you’ve confirmed your account via a confirmation email, visit https://iexcloud.io/console/tokens.
- Copy the key that appears under the Token column (it should begin with pk_).
How to run (must execute code everytime the program is ran)
- $ export API_KEY=value (where value is the generated key from the steps above) -- for UNIX shells
- $ set API_KEY=value (where value is the generated key from the steps above) -- for windows
- $ flask run -- for UNIX shells
- $ python app.py -- for windows
Features
Login Page
Register Page
Navbar
- stockme.io/logo: Redirects user to the home page, can quote stock prices.
- Buy: Redirects user to the buy page, can buy stocks.
- Sell: Redirects user to the sell page, can sell stocks.
- My Transactions: Redirects user to the transactions page, can view transaction history.
- My Friends: Redirects user to the friends page, can add friends and view their portfolios.
- My Portfolio: Redirects user to the portfolio page, can view their personal portfolio and its breakdown.
- Log Out: Logs user out.