StockEye

Design

Version: 1.0
Release Date: March 26, 2021
Last Updated: March 26, 2021
Authors: Campbell Leckie, Yasmine Ali, Leron Bergelson, Brayden Mckay, Anshul Khatri
Editors: Roy Ceyleon, Michael Okenye, Ruth Schmidt, Perikles Tsikrikis, Mohsin Malik, Syed Ahmed

Table of Contents

(1) Introduction

This document is written following the guidelines of the IEEE Recommended Practice for Software Design Descriptions.

The following provides an overview of the StockEye Design.

(1.1) Purpose

This document provides an in-depth description of the overall architecture and system design of the StockEye web application. It outlines the modules, processes, and data dependencies, as well as their detailed design and decomposition.

(1.2) Scope

The goal of this document is to aid developers in the design process and implementation of the StockEye project in order to ensure accuracy and consistency during the development of the StockEye web application.

(1.3) Definitions

Term Definition
API Application Program Interface
Concurrent Process Processes in the software that execute simultaneously and share common data and resources.
JSON Javascript Object Notation
Status Object JSON data returned by the Twitter Stream API encapsulated within a Tweepy object.
User The person, or persons, who operate or interact directly with the application.
View A visual element to display to the user; in this software it is normally in the form of a web page.

(1.4) References

A complete list of all documents and other sources of information referenced.

(2) Decomposition Description

This section describes the decomposition of the system in three different forms:

(2.1) Software Architecture

(2.1.1) Package Diagram
package_diagram
(2.1.2) Subsystems
machine_learning_model tweetstream
TweetStream Package Layering & Encapsulation
tweetstream_layering
Database Schema
database_schema
Package Responsibilities Associated Entities
User
  • Creates user objects that contain a user’s profile information (name, password, etc.) and stores them in the database
  • Performs user authentication
  • UserController allows each user to perform actions on the StockWatch package
  • UserLoginView
  • AccountSettingsView
  • RegistrationView
  • UserController
  • AccountSettingsController
  • RegistrationController
StockWatch
  • Creates stock objects with attributes sentiment, price and name, stores them in the database, and displays them for the user using StockView. Additionally, the user can filter the stocks shown with the attributes listed above.
  • Sentiment attribute on stock object is retrieved from machine learning package.
  • Provides each user with an interface to view stocks, add them to watchlists, and perform actions on them (adding, deleting, or editing stocks).
  • WatchlistView
  • StockView
  • FilterStockView
  • FilterStockController
  • WatchlistController
  • StockController
Machine Learning Model
  • Scan Tweet text for stock ticker.
  • Tokenize tweet text.
  • Normalize words.
  • Denoise data.
  • Determine sentiment from cleaned and tokenized data.
  • Construct Sentiment_Update object
  • Sentiment
TweetStream
  • Initialize connection to the Twitter Stream API and request JSON objects that match a stocks content filter.
  • Observe the Twitter Stream API through Tweepy StreamListener.
  • Construct Tweet objects from attributes within Tweepy Status object.
  • Pass Tweet objects into the Machine Learning Model Package.
  • Status
  • Tweet
Database
  • Storing concurrent information in the SQLite database.
  • Proving an interface for querying, modifying and deleting entries in the database.
  • user
  • stock
  • watchlist

(2.2) Concurrent Process Decomposition

StreamListener

Concurrent process to handle Status objects pushed through the Twitter Stream API. Forwards newly created Tweet objects to the Machine Learning Model for evaluation, ensuring up to date sentiment values within the database.

Interfaces
Interface Identification Purpose
Home View HomeView An interface that greets, and informs the user about StockEye’s functionality.
Login View UserLoginView An interface for the user to enter username or email address and password for login. Additionally, a check box a remember me checkbox with a forgot your password link.
Account Registration View RegistrationView To let the user register for an account with a username, password, and email. A confirm Registration button to confirm the registration. Additionally, a login button is presented if an account already exists.
Profile View AccountSettingsView Allows the user to change their user information on their account, such as the email and password they wish to have linked to their account.

(3) Interface Description

This section provides prototypes and details for the StockEye interface.

(3.1) Module Interface

(3.1.1) HomeView

Field Type Description
Log-in Button Button Triggers drop-down log-in form.
Register Button Button Directs user to Account Registration page.
Trending Link Button Directs user to Trending page.
(3.1.2) TrendingView

(3.1.3) UserLoginView

Field Type Description
User-name Input Text A user’s username or email address.
User-password Input Text Password to the user’s account.
Lost-password Button Directs user to a page where they can enter their email address. They are then sent a code which they can use to create a new password.
(3.1.4) RegistrationView

Field Type Description
User-name Input Text A user’s username or email address.
User-password Input Password Text Password to the user’s account.
Confirm-password Input Password Text Password entered must be the same as User-password for registration to be successful.
User-email Input Text A user’s email address.
Confirm-registration Button If registration is successful, new user object is created.
Log-in-button Button Directs user to UserLoginView.
(3.1.5) AccountSettingsView

Field Type Description
User-Email Input Text A user’s new email.
User-Password Input Text A user’s new password.
Change-Email Button Updates user email.
Change-Password Button Updates user password.
(3.1.6) WatchlistView

Field Type Description
Select-Watchlist Drop-down Menu Displays list of existing user Watchlists.
Manage-Watchlist Button Directs user to the ManageWatchlistView for the selected Watchlist.
(3.1.7) ManageWatchlistView

Field Type Description
Create-Watchlist Button Creates a new watchlist.
Delete-Watchlist Button Deletes delected watchlist.
Select-Watchlist Toggle Box Selects the watchlist being clicked on.
Watchlist-Name Text Displays name of the watchlist.
(3.1.8) EditWatchlistView

Field Type Description
Edit-Watchlist Button Directs users to the manage watchlist page.
Cancel-Watchlist Button Cancels any changes made to the watchlist.
Save-Watchlist Button Changes made to the watchlist are saved.
Select-Stock Toggle Box Selects the stock being clicked on.
SelectAll Button Selects all the stocks on the watchlist.
DeleteSelected Button Deletes the stock(s) that are selected.
AddSymbol Button Add a new stock.
Change-Watchlist Drop-down Menu Showing available watchlists for users to move to.
Stock-Price Text Displays the current price of the stock.
Stock-Change Text Displays the percentage the stock price has changed.
Stock-Symbol Text Displays the symbol of the stock.
Stock-Description Text Displays the name of the stock.
(3.1.9) StockView

Field Type Description
Stock-Name Text The name of the stock.
Stock-Sentiment Text Sentiment value of the stock.
Stock-Price Text Price of the stock.
Add-to-Watchlist Button Add stock to a selected Watchlist.
Select-Watchlist Drop-down Menu Displays list of existing Watchlists.
(3.1.10) FilterStockView

Field Type Description
Filter-by-Price Button + Input text Filters stocks from minimum to maximum price.
Filter-by-Sentiment Button + Input Text Filters stocks by sentiment type (positive, negative, neutral).
Filter-by-StockName Button + Input Text Filters stocks by their name.

(4) Detailed Design

(4.1) Module Detailed Design

Function Description
setUsername()
  • Stores user created string as a username in the user database.
setPassword()
  • Stores user created string as a password in the user database.
  • Links password to the unique email address.
confirmPassword()
  • Confirms re-entered password matches first password.
setEmail()
  • System checks if email already exists.
  • If not, the system stores the user created string as an email address in the database and links it to the new username and profile.
  • If it does already exist, user will be notified that changes to email address must be made to continue.
addSymbol()
  • Creates a new entry in the database watchlist table relating a user, watchlist, and stock.

(4.2) Documentation

(4.2.1) Front End

Languages: HTML, CSS, Javascript

Illustrations: Undraw.co

Iconography: Iconify (Figma extension)

Visual Framework: ReactJS

(4.2.2) Back End

Languages: Python

Hosting: Heroku

Web Application Framework: Django

Web Application Libraries: Tweepy, NLTK (Natural Language Toolkit)

Database: SQLite

(5) Change History

The StockEye Design is a living document, changing as the project progresses. While Google Docs is used to track the editing history, the StockEye Design includes references to major changes of the document within itself.

Date Description of Change(s) Contributor(s)
March 24, 2021 Initial draft of Design completed
  • Cambell Leckie
  • Yasmin Ali
  • Leron Bergelson
  • Brayden Mckay
  • Anshul Khatri
March 25, 2021 Final draft of Design completed
  • Cambell Leckie
  • Yasmin Ali
  • Leron Bergelson
  • Brayden Mckay
  • Anshul Khatri
  • Syed Ahmed
  • Perikles Tsikrikis
  • Michael Okenye
  • Ruth Schmidt
  • Roy Ceyleon

Return to Menu Return to Top