https://github.com/vincenganga/CS50x-Finance
Flask web application that enables the user to "buy" and "sell" stocks.
https://github.com/vincenganga/CS50x-Finance
cs50x css flask html5 iex-api javascript python3 sqlite3
Last synced: 10 months ago
JSON representation
Flask web application that enables the user to "buy" and "sell" stocks.
- Host: GitHub
- URL: https://github.com/vincenganga/CS50x-Finance
- Owner: vincenganga
- Created: 2024-09-05T12:26:15.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-05T13:12:24.000Z (almost 2 years ago)
- Last Synced: 2024-09-10T16:17:31.170Z (almost 2 years ago)
- Topics: cs50x, css, flask, html5, iex-api, javascript, python3, sqlite3
- Language: Python
- Homepage:
- Size: 802 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CS50x-Finance
## Introduction
This is one of the assignments provided in CS50x - Introduction to Computer Science.
The goal of the exercise is to:
* Implement a website that allows users to "buy" and "sell" stock with the following functions:
* Complete the implementation of a registration system, enabling users to register for an account.
* Complete the implementation of a quote feature, allowing users to look up the current price of a stock.
* Complete the implementation of a buying system, enabling users to buy stocks.
* Complete the implementation of an index page to display an HTML table summarizing which stocks the logged-in user owns, how many shares, the current price of each stock, and the total value of each holding (i.e., shares times price). Also display the user's current cash balance and a grand total (i.e., the total value of stocks plus cash).
* Complete the implementation of a selling system to allow users to sell shares of stocks they own.
* Complete the implementation of a history page that displays an HTML table summarizing all of a user’s transactions, showing each buy and sell action.
In addition to the required functions, I added some extra features to the website:
* Allow users to change their password.
* Allow users to add more cash to their account.
For more information, click [here](https://cs50.harvard.edu/x/2023/psets/9/finance/).
## Built With
* HTML for website structure.
* Flask for backend development.
* Bootstrap for design.
* [IEX API](https://iexcloud.io/) to fetch real-time stock prices.
* sqlite3 for storing user information (username, hashed passwords) and transaction records (bought or sold stocks).
## Website
After registering, each user will have a default cash balance of $10,000.
* **Login Page**:

* **Register Page**:

* **Index Page**:
This is the homepage of the website, which also contains the history of the user's transactions.

* **Quote Page** (Enter the stock symbol to check the stock info):

* **Quoted Page** (Displays the info of the entered stock symbol):

* **Buy Page** (Enter the stock symbol and the number of shares to buy):

* **Bought Page** (The bought stock is displayed in the user's history):

* **Sell Page** (Select the stock you own from the drop-down list and enter the number of shares to sell):

* **Sold Page** (The sold stock is displayed in the user's history):

* **History Page** (Shows all user actions, such as buy and sell transactions):

* **Add Cash Page**:

* **Added Cash Page**:

* **Change Password** (Allows users to change their password, but the new password cannot be the same as the current one):

## References
* Bootstrap
* W3School
* Stack Overflow