- Finance: Web application via which you can manage portfolios of stocks. This tool allows you to check real stocks’ actual prices and portfolios’ values, it will also let you buy (okay, “buy”) and sell (okay, “sell”) stocks by querying IEX Stock Quote API for stocks’ prices.
- I wrote all the code in the templates directory. I wrote most of the code in application.py. Some of the code in helpers.py was provided by instructor
- I styled the application myself, with illustrations provided by Freepik. Landing page and favicon cloned after Robinhood
- Database design and Create, Read, Update in SQL
- Rewrote the entire application to use Flask SQL Alchemy
- Developed MVP of application with SQLite locally and Deployed with MySQL on RDS instance
- Using Flask as a server-side framework
- Python Class/Models and Schemas
- Jinja templating
- Password hashing using Werkzeug
- Parsing data from API with python
- Parsing data from SQL queries with python
- Calculations using data from API and database
- Continous integration and continuous deployment with Travis CI
- Deploying application to AWS with Elastic Beanstalk instance and SQL database to a separate RDS instance
- Using AWS Cloudfront as Content Delivery Network (CDN) and connecting Google Domains custom domain to AWS CDN
| Graphic Design | Front-End | Back-End | Database | Deployment | Testing |
|---|---|---|---|---|---|
| Inkscape | HTML5 | Python3 | SQLite and MySQL | AWS Elastic Beanstalk | Pytest |
| . | CSS3 | Flask | SQL Alchemy | AWS RDS | Lighthouse |
| . | Bootstrap 4 | Werkzeug | Flask SQL Alchemy | Git | . |
| . | Jinja | . | . | . | . |
- Login, sign-up
- Security to prevent certain transactions using error codes 400-404
- Create, Read, and Update for stocks
- In your terminal, navigate to the root project directory and run the following commands
- To install the dependencies
$ pipenv install -r requirements.txt - You'll need to register for an API key in order to be able to query IEX’s data
- Register for an account
- Enter your email address and a password, and click “Create account”
- On the next page, scroll down to choose the Start (free) plan
- Once you’ve confirmed your account via a confirmation email, sign in to iexcloud.io
- Click API Tokens
- Copy the key that appears under the Token column (it should begin with pk_) into the
<value>in the next step
- Create a .env file and paste the following into it:
API_KEY=<value> - Activate the virtual environment
$ pipenv shell - To start the web server, execute (without debugging):
$ python application.py - Alternatively, execute (with debugging):
$ export FLASK_APP=application.py $ flask run - Lastly, create a SQL database named
finances.db - To initialize the SQL database within application.py, add
db.create_all()belowInitialize Schemas. Once the code runs and the you've verified the database exists, removedb.create_all() - To initialize the SQL database in the python shell, execute:
$ python $ from application import db $ db.create_all() - To initialize the database with SQL command-line arguemnts:
CREATE TABLE users ( id INTEGER PRIMARY KEY AUTOINCREMENT, username VARCHAR(50) UNIQUE, hash VARCHAR(200) NOT NULL, cash INTEGER ) CREATE TABLE portfolio ( id INTEGER PRIMARY KEY AUTOINCREMENT, user_id INTEGER, symbol VARCHAR(5), current_shares INTEGER ) CREATE TABLE bought ( id INTEGER PRIMARY KEY AUTOINCREMENT, buyer_id INTEGER, time VARCHAR, symbol VARCHAR(5), shares_bought INTEGER, price_bought FLOAT ) CREATE TABLE sold ( id INTEGER PRIMARY KEY AUTOINCREMENT, seller_id INTEGER, time VARCHAR(100), symbol VARCHAR(5), shares_sold INTEGER, price_sold FLOAT ) - Stock prices pulled from IEX Stock Quote API
- Feather icon made by Freepik from Flaticon
- Illustrations by Freepik Storyset
Copyright Notice and Statement: currently not offering any license. Permission only to view and download. Refer to choose a license for more info.
