|
20 | 20 |
|
21 | 21 | ## 💡Lessons Learned
|
22 | 22 | - Database design and Create, Read, Update in SQL
|
23 |
| -- Rewrote the entire application to use Flask SQL Alchemy |
24 |
| -- Developed MVP of application with SQLite locally and Deployed with MySQL on [RDS](https://aws.amazon.com/rds/) instance |
25 |
| -- Using Flask as a server-side framework |
| 23 | +- Rewrote the entire application to use [Flask SQL Alchemy](https://flask-sqlalchemy.palletsprojects.com/en/2.x/), an extension of [SQL Alchemy](https://www.sqlalchemy.org/) |
| 24 | +- Developed MVP of application with SQLite locally and Deployed with MySQL |
| 25 | +- Using [Flask](https://flask.palletsprojects.com/en/1.1.x/) as a server-side framework |
26 | 26 | - Python Class/Models and Schemas
|
27 |
| -- Jinja templating |
28 |
| -- Password hashing using Werkzeug |
| 27 | +- [Jinja](https://jinja.palletsprojects.com/en/2.11.x/) templating |
| 28 | +- Password hashing using [Werkzeug](https://werkzeug.palletsprojects.com/en/1.0.x/) |
29 | 29 | - Parsing data from API with python
|
30 | 30 | - Parsing data from SQL queries with python
|
31 | 31 | - Calculations using data from API and database
|
32 | 32 | - Continous integration and continuous deployment with Travis CI
|
33 |
| -- Deploying application to AWS with [Elastic Beanstalk](https://aws.amazon.com/elasticbeanstalk/) instance and SQL database to a separate [RDS](https://aws.amazon.com/rds/) instance |
34 |
| -- Using AWS Cloudfront as Content Delivery Network (CDN) and connecting Google Domains custom domain to AWS CDN |
| 33 | +- Hosting application on AWS with an [EC2](https://aws.amazon.com/ec2/) instance with an [Ubuntu](https://ubuntu.com/) operating system, [Gunicorn](https://gunicorn.org/) WSGI HTTP server, and [Nginx](https://www.nginx.com/) reverse proxy |
| 34 | +- Hosting MySQL database on AWS with a [RDS](https://aws.amazon.com/rds/) instance |
| 35 | +- (Deprecated) Hosting application on AWS with an [Elastic Beanstalk](https://aws.amazon.com/elasticbeanstalk/) instance and MySQL database on AWS with a [RDS](https://aws.amazon.com/rds/) instance |
| 36 | +- Using AWS Cloudfront as a Content Delivery Network (CDN) and connecting Google Domains custom domain to AWS CDN |
35 | 37 |
|
36 | 38 | ## 🛠 Technologies
|
37 |
| -|Graphic Design|Front-End|Back-End|Database|Deployment|Testing| |
38 |
| -|------------- | ------- | ------ | ------ | -------- | -------| |
39 |
| -|Inkscape |HTML5 |Python3 |SQLite and MySQL |[AWS Elastic Beanstalk]() |Pytest| |
40 |
| -|. |CSS3 |[Flask](https://flask.palletsprojects.com/en/1.1.x/) |[SQL Alchemy](https://www.sqlalchemy.org/)|[AWS RDS](https://aws.amazon.com/rds/) |Lighthouse| |
41 |
| -|. |Bootstrap 4|[Werkzeug](https://werkzeug.palletsprojects.com/en/1.0.x/) |[Flask SQL Alchemy](https://flask-sqlalchemy.palletsprojects.com/en/2.x/) |Git |.| |
42 |
| -|. |[Jinja](https://jinja.palletsprojects.com/en/2.11.x/) |. |. |. |.| |
| 39 | +|Graphic Design |Front-End |Back-End |Database |Deployment |Testing | |
| 40 | +| ------------- | ------------- | ------------- | ------------- | ------------- | --------------| |
| 41 | +|Inkscape |HTML5 |Python3 |MySQL |AWS EC2 |Pytest | |
| 42 | +|Freepik |CSS3 |Flask |SQL Alchemy |Ubuntu |Lighthouse | |
| 43 | +|. |Bootstrap 4 |Werkzeug |Flask SQL Alchemy|Gunicorn |. | |
| 44 | +|. |Jinja |. |. |Nginx |. | |
| 45 | +|. |. |. |. |AWS RDS |. | |
43 | 46 |
|
44 | 47 | ## ⚖️ Methodology
|
45 | 48 |
|
@@ -87,36 +90,36 @@ $ python
|
87 | 90 | $ from application import db
|
88 | 91 | $ db.create_all()
|
89 | 92 | ```
|
90 |
| -- To initialize the database with SQL command-line arguemnts (using MySQL syntax and running one `CREATE TABLE` command at a time): |
| 93 | +- To initialize the database with SQL command-line arguemnts (using MySQL syntax) run each `CREATE TABLE` command (one at a time): |
91 | 94 | ```
|
92 | 95 | CREATE TABLE users (
|
93 | 96 | id INTEGER PRIMARY KEY AUTO_INCREMENT,
|
94 | 97 | username VARCHAR(50) UNIQUE,
|
95 | 98 | hash VARCHAR(200) NOT NULL,
|
96 | 99 | cash INTEGER
|
97 |
| -) |
| 100 | +); |
98 | 101 | CREATE TABLE portfolio (
|
99 | 102 | id INTEGER PRIMARY KEY AUTO_INCREMENT,
|
100 | 103 | user_id INTEGER,
|
101 | 104 | symbol VARCHAR(5),
|
102 | 105 | current_shares INTEGER
|
103 |
| -) |
| 106 | +); |
104 | 107 | CREATE TABLE bought (
|
105 | 108 | id INTEGER PRIMARY KEY AUTO_INCREMENT,
|
106 | 109 | buyer_id INTEGER,
|
107 |
| - time VARCHAR, |
| 110 | + time VARCHAR(100), |
108 | 111 | symbol VARCHAR(5),
|
109 | 112 | shares_bought INTEGER,
|
110 | 113 | price_bought FLOAT
|
111 |
| -) |
| 114 | +); |
112 | 115 | CREATE TABLE sold (
|
113 | 116 | id INTEGER PRIMARY KEY AUTO_INCREMENT,
|
114 | 117 | seller_id INTEGER,
|
115 | 118 | time VARCHAR(100),
|
116 | 119 | symbol VARCHAR(5),
|
117 | 120 | shares_sold INTEGER,
|
118 | 121 | price_sold FLOAT
|
119 |
| -) |
| 122 | +); |
120 | 123 | ```
|
121 | 124 |
|
122 | 125 | ## 📣 Attribution
|
|
0 commit comments