Skip to content

web app that allows user to register and manage stock portfolio

Notifications You must be signed in to change notification settings

luckyguy73/python_flask_iex_web_app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a project I had to do for the Harvard Computer Science course on edX. It is a web app made with Python, Flask, Javascript, SQL, HTML, and CSS. I just used sqlite3 db to persist the data.

To start out you can register for an account which will then log the user in and start them off with a $10K cash balance. I used regex to enforce the 8 character minimum and alphanumeric characters.

register

Validation includes checking for empty data and ensuring passwords match or else you get a meme error message.

apology

Once successfully registered redirects to root and flashes success message.

registered
If you logout or close your browser you will need to login again. Login compares hashed password from request to hashed password in database to login successfully. login

The quote tab allows user to input stock symbol to findout the latest price. Uses an api call to IEX. quote

A successful quote is flashed on the dashboard.

quoted

Buying stock requires stock symbol and number of shares. Combination of frontend validation from browser and backend validation ensures proper input. I used Javascript to add a feature that when a user enters a symbol the script uses a blur event listener on the text field that will fetch a quote via json and then inform the user the maximum number of shares possible to purchase that stock based on the latest price of the stock and their current cash balance.

buy_first buy_two bought

Selling is similar to buying except using the change event listener on the select input field to find out via sql query how many shares of that symbol the user owns in order to display the maximum number of shares allowed to sell. The options in the select input field are populated via an sql query which finds the symbols they currently own.

sell_dropdown sell_two sold

The history tab will display all the users transactions ordered by company name first, then by transaction date ascending. history

About

web app that allows user to register and manage stock portfolio

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published