Skip to content

Developed a stock trading web app using Python, Flask, SQLite3, Jinja, Bootsrap4, and HTML. This app enables users register and trade stocks with play money, and also tracks your portfolio balance and history. Data is provided by IEXCLOUD.IO API (https://iexcloud.io/)

License

Notifications You must be signed in to change notification settings

jhustles/bloomstrade

Repository files navigation

BloomsTrade - Free Stock Trading Web Application Using Real-Time Quotes From API

about

Scope & Purpose

  • I built a stock trading web application where users can invest stocks with a real-time stock quotes starting with $10,0000 of virtual money. This project is inspired by my passion for stock trading, computer science, and coding. This is a Python web application using Flask, Werkzeug exceptions and security, SQLite3, Requests, Jinja, Bootstrap4, Javascript, HTML5, and CSS3.

System Prerequisites To Get Started

You will need the following installed on your computer system and import the following libraries:

  • Python >= 3.7
  • os
  • datetime
  • time
  • SQLite3
  • Flask and flash, jsonify, redirect, render_template, and request
  • Flask_session
  • tempfile
  • Werkzeug.exceptions and default_exceptions, HTTPException, InternalServerError
  • Werkzeug.security and check_password_hash, generate_password_hash

Getting Started

  • API Key from https://iexcloud.io/ as they are the real-time stock data provider

  • Clone / Download Entire Repository

  • Open up the terminal and navigate to the repository

  • Export your API_KEY into the terminal

  • Run "python application.py"

Code Review - Recruiters / Hiring Managers

  • Please view the application.py - here is where most of my Python logic and coding remains, including most of my SQL queries (e.g. common expression tables, Insert, and Update queries)

  • Jinja Templates are in the "templates" folder where I created a layout, and created several custom dynamic pages

Main Built-in Functionalities

  • Password Hashing - this web application hashes the user's password upon account registration, so no real passwords are stored in the database

  • Portfolio Balance - presents users current investment portfolio and cash position. Default new users start with $10,000.

  • Quote & Buy - in a three step process, the user will first query for a stock ticker, perform a buy estimate, and either executes a buy order, or not, using real time API quotes provided by IEX Cloud (https://iexcloud.io/) This process is concluded with a buy order confirmation

  • Sell - in a two step process, users may estimate, and subsequently, execute a sell order

  • Transaction History - view when all orders were place in the History page where the database displays all executed orders

  • Responsive Algorithm Preventing Errors - the algorithm will not allow users to purchase more shares of stock they can afford, or sell more shares than they have or do not own. The program will also instruct users what they need to fix in order to proceed

Web Application Walkthrough

  • Account Registration Page - all fields must be complete or application will return an error message registration

  • Registration Error - Example of an error message if a field is missing registrationError

  • Registration Complete registrationComplete

  • Initial Login Page Of New Users signedInEmpty

  • Quote & Buy - Phase 1 - Enter in a Valid Stock Ticker quotebuy1

  • Quote & Buy - Phase 2 - Enter in a Valid Stock Ticker quotebuy2

  • Quote & Buy - Phase 3 - Enter in a Valid Stock Ticker quotebuy3

  • Quote & Buy - Phase 3b - If user click's "Estimate" with a blank quantity quotebuy3b

  • Buy Confirmation quotebuyConfirm

  • Portfolio View portfolio

  • Sell - Phase 1 Estimate Order sell1

  • Sell - Phase 1a Estimate Order - Error Example Invalid "Sell Quantity" sell2

  • Sell - Phase 1b Estimate Order - Error Example Invalid Stock Symbol sell3

  • Sell - Phase 2 Successful Estimate Order sell4

  • Sell Confirmation sell4

  • Transaction History history

  • Portfolio View After Sale portfolioAfterSale

  • Database Structure Design - Entity Relationship Diagram erd

  • Flask App Snippets - Python, Flask and SQLite3 1 2 3 4 5 6 7 8 9 10 11 12 13 14

Next Steps Considerations

  • Use Regular Expressions to vet unwanted inputs

  • Update to production grade database infrastructure using PostGres SQL and deploy using Heroku because of it's free cost structure for dynamic data

  • Create function to allow users to change passwords or add more money

Personal Note

  • Hope you enjoyed it. Thank you for your time!

Author

  • Johneson Giang - Invidual Project - Github

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments & Credits

  • Shout out to David J. Mahlan and Brian Yu

  • BootStrap4 Free Templates - Kelly

  • I definitely want to give a shout out to my dear teacher, mentor, and friend @CodingWithCorgis!

About

Developed a stock trading web app using Python, Flask, SQLite3, Jinja, Bootsrap4, and HTML. This app enables users register and trade stocks with play money, and also tracks your portfolio balance and history. Data is provided by IEXCLOUD.IO API (https://iexcloud.io/)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published