Code Monkey home page Code Monkey logo

cs50-8-finance's Introduction

CS50's Finance

finance

Introduction

This application was the 8th week's exercise of Harvard's CS50 - Introduction to Computer Science online course. You can learn more about CS50 at Harvard's CS50.

The exercise proposes the following:

  • Implemented a web application that enables the user can "buy" and "sell" stocks, following the criteria below:
  • Complete the implementation of register in such a way that it allows a user to register for an account via a form.
  • Complete the implementation of quote in such a way that it allows a user to look up a stock’s current price.
  • Complete the implementation of buy in such a way that it enables a user to buy stocks.
  • Complete the implementation of sell in such a way that it enables a user to sell shares of a stock (that he or she owns).
  • Complete the implementation of index in such a way that it displays an HTML table summarizing, for the user currently logged in, which stocks the user owns, the numbers of shares owned, 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 along with a grand total (i.e., stocks' total value plus cash).
  • Complete the implementation of history in such a way that it displays an HTML table summarizing all of a user’s transactions ever, listing row by row each and every buy and every sell.
  • Complete the implementation of check in such a way that it checks whether a username is available.

Created with

This application uses Python, HTML and styling with Bootstrap. It also uses IEX API to get the stocks values in real time and a SQL database to store users information, such as username, a hash of the password, the stocks they bought or sold and the history.

Access

My application is available at cs50-8-finance.herokuapp.

Run

You will need Python and Flask installed on your computer to run this application.

Start by installing Python 3. Here's a guide on the installation. Once you have Python, and clonned this repository, run the following commands:

To install pip, run:

sudo apt install python3-pip

To install Flask, run:

sudo apt install python3-flask

To install this project's dependecies, run:

pip3 install -r requirements.txt

Define the correct file as the default Flask application:

Unix Bash (Linux, Mac, etc.):

export FLASK_APP=application.py

Windows CMD:

set FLASK_APP=application.py

Windows PowerShell:

$env:FLASK_APP = "application.py"

Run Flask and you're good to go!

flask run

cs50-8-finance's People

Contributors

marifribeiro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.