Source Code: GitHub
Summary
A stock forecasting Dash dashboard with a backend MySQL database; the database was setup in AWS RDS as well as a local MySQL server. The final project features the local database simply to avoid unnecessary costs. Below is a high level view of the programming layout.
App.py has the main plotly app code. The database.py file has the code necessary to create and update the MySQL database. The utils.py file has some utilities for querying the stock data. Other files are supplementary and either used for debugging or have a future use.
Dash App Design
The dashboard was built using the dash framework, which features a high level api for html, and css design within Python. The main dashboard features three tabs: a stock history page, stock forecasting page, and a recent articles page with additional information regarding a stock. The stock forecasting page was created with the vision of incorporating the Time Series Prediction portfolio project; this still has not been done. Below is a screenshot of what the dashboard looks like.
The dashboard can be updated by changing the tabs at the top of the page. The company news, earnings, volume, and stock price data will update accordingly to the selected options. The next portion will go into detail on the database design.
Database Design
The database was designed using MySQL and SQLAlchemy with Python. The schema was a simple 5 table schema that features information related to stocks. The database schema relationships can be visualized below.
More tables could have been added or connected with relationships, but the primary purpose of this was to demonstrate some competency of executing SQLAlchemy commands. The tables that were loaded into the main app script had additional processing to ensure all values on the dashboard would update together to display the correct information.
Conclusion
More functionality could have been added but this was more of a proof of concept and display of competency using these packages. If I were to invest more time, it would be for an actual project that I’d be using.