Skip to content

(Mock Stocks, "Where everything's made up and the points don't matter")

Notifications You must be signed in to change notification settings

brendencallahan/Mocks

Repository files navigation

Mocks

To test

username: test

password: 123

(Data may not persist if server provider restarts)

(Mock Stocks, "Where everything's made up and the points don't matter")

Look-up, buy, and sell stocks with functioning login written in Flask.

This was an assignment for Harvard's Intro to Computer Science course. It uses fake money but real data. The only provided code was Bootstrap for the nav bar as well as several small functions. Everything else was written by me in Python.

What I did:

Stored login info using SQLite

Using Flask and SQLite3 I stored the salted hash instead of the user's password. I also stored the username for obvious reasons. :)

Screenshot 2022-08-02 104037

Screenshot 2022-08-02 105407

Implemented look-up feature

Added ability to see a company's current share price by looking up their symbol (i.e NFLX for Netflix) using IEX's API then displayed this JSON data using a table and the Jinja templating language.

Screenshot 2022-08-12 161008

Wrote buy/sell functionality

Also added ability to buy and sell desired number of shares for any given symbol at current market price using IEX's API.

Screenshot 2022-08-12 161030

Screenshot 2022-08-12 161118

Allowed users to see a breakdown of their portfolio

Added main 'hub' that lets users see the current price of all their shares as well as their current account balance.

Screenshot 2022-08-12 161050

Implemented a history page where users can see all previous transactions

Screenshot 2022-08-12 190328

To run locally:

$ git clone https://github.com/brendencallahan/Mocks
$ pip3 install cs50 flask flask_sessions
$ export API_KEY=xxxxxxxxxxxxxxxxxxxxxxx
$ flask run

(Visit assignment page here, no login required) https://cs50.harvard.edu/x/2022/psets/9/finance/

  • The money used in this is not real. You start with $10,000 fake USD when you register. :)

About

(Mock Stocks, "Where everything's made up and the points don't matter")

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published