HW3 Description
HW3 Description
1. Objectives
● Get familiar with the AJAX and JSON technologies
● Use a combination of HTML5, Bootstrap and Angular on client side
● Use Node.js on server side
● Get familiar with Bootstrap to enhance the user experience using responsive design
● Get hands-on experience of Cloud services hosting NodeJS/Express
● Learn to use popular APIs such as the Finnhub API, Polygon.io API and Highcharts API
● Learn how to manage and access a NoSQL DBMS like MongoDB Atlas, in the cloud
2. Background
2.1 AJAX and JSON
AJAX (Asynchronous JavaScript + XML) incorporates several technologies
● Standards-based presentation using CSS
● Result display and interaction using the Document Object Model (DOM)
● Data interchange and manipulation using XML and JSON
● Asynchronous data retrieval using XMLHttpRequest
● JavaScript binding everything together
JSON, short for JavaScript Object Notation, is a lightweight data interchange format. Its main
application is in AJAX web application programming, where it serves as an alternative to the use
of the XML format for data exchange between client and server. See the class slides on D2L
Brightspace.
2.2 Bootstrap
Bootstrap is a free collection of tools for creating responsive websites and web applications. It
contains HTML and CSS-based design templates for typography, forms, buttons, navigation, and
other interface components, as well as optional JavaScript extensions. To learn more details
about Bootstrap please refer to the lecture material on Responsive Web Design (RWD). We
recommend using Bootstrap 4.6 through 5.3, Angular 12 through 17, and ng-bootstrap 11
through 16 in this assignment. See the RWD class slides on D2L Brightspace for the list of
dependencies between these various versions.
2
2.3 Cloud Services
To learn more about GAE support for Node.js visit this page:
https://cloud.google.com/appengine/docs/standard/nodejs/
To learn more about AWS support for Node.js visit this page:
https://aws.amazon.com/getting-started/projects/deploy-nodejs-web-app/
Microsoft Azure is a cloud computing service created by Microsoft for building, testing,
deploying, and managing applications and services through a global network of
Microsoft-managed data centers. It provides software as a service (SaaS), platform as a service
(PaaS) and infrastructure as a service (IaaS) and supports many different programming
languages, tools, and frameworks, including both Microsoft-specific and third-party software and
systems.
To learn more about Azure support for Node.js visit this page:
https://docs.microsoft.com/en-us/javascript/azure/?view=azure-node-latest
3
2.4 Angular
Angular is a toolset for building the framework most suited to your application development. It is
fully extensible and works well with other libraries. Every feature can be modified or replaced to
suit your unique development workflow and feature needs. Angular combines declarative
templates, dependency injection, end-to-end tooling, and integrated best practices to solve
development challenges. Angular empowers developers to build applications that live on the web,
mobile, or the desktop.
For this homework, Angular 12+ (Angular 12, through 17) can be used, but Angular 12 is
recommended. Please note Angular 12+ will need familiarity with Typescript and
component-based programming.
https://angular.io/
2.5 Node.js
https://Node.js.org/en/
Also, Express.js is strongly recommended. Express.js is a minimal and flexible Node.js web
application framework that provides a robust set of features for web and mobile applications. It is
in fact the standard server framework for Node.js.
http://expressjs.com/
Important Note: All APIs calls should be done through your Node.js server
4
3. High-Level Description
In this exercise you will create a webpage that allows users to search for stocks using the
Finnhub API and display the results on the search page. The application evolves from the
previous homework.
A user will first open a page as shown below in Figure 1, where the user can enter a stock ticker
symbol and select from a list of matching stock symbols using “autocomplete.” A quote on a
matched stock symbol can be performed. The description of the Search Box is given in Section
3.1. Instructions on how to use the API are given in Section 4. All implementation details and
requirements will be explained in the following sections.
When a user initially opens your web page, the initial search page should look like in Figure 1.
5
3.1 Search Page / Homepage
3.1.1 Design
You must replicate the Search Bar displayed in Figure 1 using a Bootstrap form. The Search
Bar contains three components.
1. Stock Ticker: This is a text box, which enables the user to search for valid stocks by
entering keywords and/or accepting a suggestion of all possible tickers. Notice the
“helper” text inside the search box.
2. Search Button: The “Search” button (which uses the widely used search icon), when
clicked, will read the value from the textbox and send the request to the backend server.
On a successful response, details for that stock will be displayed.
3. Clear button: The ‘clear’ (cross marked) button, would clear out the currently searched
results page and show the initial search page.
3.1.3 Autocomplete
A Search Bar allows a user to enter a keyword (Stock ticker symbol) to retrieve information.
Based on the user input, the text box should display a list of all the matching company’s ticker
symbols with the company’s name (see Figure 2). The autocomplete JSON data is retrieved from
the Finnhub Search API (refer to Section 4.1.4).
The autocomplete response is filtered using the criteria: type= ‘Common Stock’, Symbol doesn’t
contain ‘.’(dot)
https://finnhub.io/api/v1/search?q=<COMPANY_NAME>&token=<API_TOKEN>
# or
6
https://finnhub.io/api/v1/search?q=<SYMBOL>&token=<API_TOKEN>
For example:
https://finnhub.io/api/v1/search?q=apple&token=<API_TOKEN>
The autocomplete function should be implemented using Angular Material. Refer to Section
5.3 for more details.
After the user executes a search for a ticker, a page should route to /search/<ticker> path
(example: /search/AMZN). The following components need to be displayed on successful
search:
● Symbol, company name, trading Exchange (such as NASDAQ), and a Buy button on top
left, The Sell button should appear alongside the Buy button only when the portfolio
has purchased stocks of a company. See Figure 3.3;
● Last price, change, percent change, and date/time, on top right. The change items should
be preceded by appropriately colored arrows;
● Company Logo and Indication of open / closed market in the top-center;
● Summary, Top News, Charts and Insights tabs.
IMPORTANT NOTE: If the user navigates to the watchlist route or the portfolio route, and
navigates back to the search results page, the previously searched stock results should remain on
7
the search/<ticker> route. Also, results data should be retrieved from a state/service and not be
fetched from a new search API call.
8
Figure 3.3: Search Details page overview (Dynamic Sell button when the portfolio has
purchased stock of the company)
● When the user clicks on the star icon, the white star turns yellow, and that ticker should
be stored in MongoDB Atlas. A self-closing alert should be displayed at the top and that
stock should be visible on the Watchlist Page (see Section 3.3).
● When the user clicks on the Buy button, a modal window should open. which will display
the details (stock symbol, current price, money in wallet, input for quantity of shares to
buy and total price for the shares), as shown in Figure 3.5. Note that:
o The Buy button should be disabled if the user inputs a quantity < 1 or the quantity
field is empty or the quantity leading to total more than money in wallet (see
Figure 3.5);
o The Buy button will be enabled once the user enters a number greater than 0 and
suitable quantity up to total equals (or less than) money in the wallet (see Figure
3.4).
● The Sell option is available on the homepage only when there is at least 1 quantity of
stock available in the portfolio. Upon clicking the Sell button, similar behavior as the buy
transaction should be implemented, along with the constraint being able to sell only the
stocks owned.
● Error messages should be shown for an attempt to buy more than the possible quantity
of stocks using the money in wallet/attempt to sell more than the number of stocks owned
in Portfolio. See Figure 3.5 for reference.
● A self-closing transaction alert message should be shown for both buy and sell
transactions as in Figure 3.4a.
9
Figure 3.4: Buy Button enabled for valid input
10
Figure 3.5: Buy button disabled for invalid input
For details and screenshots of similar sell transactions, refer to Section 3.4 (Portfolio). As
described, the page contains two major panels:
1) Stock Details: This panel displays all the values mentioned in Table 3.1. Last Timestamp
should be only displayed beside the Market status if “Market is Close.”
2) Material Tabs – This component helps users see different stock data on the same page,
and the content of the tabs is detailed in the following sections.
IMPORTANT NOTE: All numerical values should be rounded off to 2 decimal places.
Data mentioned in the Stock Details section and Summary Tab, should auto-update
every 15 seconds, when the stock market is open.
11
3.2.2 Summary Tab
o Details, as follows:
▪ Calculate if the market is open, using the timestamp key in Table 3.2. The
value of ‘t’ is the last timestamp at which the stock details are available.
Assume the market is closed if more than 5 minutes has elapsed from this
‘t’ value. Assume the market is open, if otherwise.
▪ If the market is open: display all the fields mentioned in Table 3.2 and
Table 3.3, as shown in Figure 3.2.
▪ If the market is closed: Display all the fields mentioned in Table 3.2 and
Table 3.3, as shown in Figure 3.1.
o About the Company: values from Table 3.3.
o Chart for the last Working Day:
▪ See Section 4.1.2 to obtain hourly stock price data using resolution ‘5’ and
show variation for the last 6 hours.
▪ If the market is open: show stock price variation from current time.
▪ If the market is closed: show stock price variation from when the market
was closed. (i.e., last working day).
12
Important Note: The list of company peers should be clickable links which should navigate to
the search results of that ticker.
13
Figure 3.6: Top News Tab overview
This tab uses HighCharts to display historical stock market data on the related stock. In
particular:
14
o See Figure 3.8 for reference using Section 4.1.3 implementation.
o For more details regarding Highcharts see Section 5.5.
o Display SMA and Volume by Price charts for data of the last 2 years.
This tab uses a table that contains fields as mentioned in Table 3.5 and HighCharts to display
recommendation trends and company earnings data on the related stock. In particular:
o See Figure 3.9 for reference using Section 4.1.7 and Section 4.1.9.
o Aggregate the response data from Section 4.1.7 for all MSPR data and display it
in the table.
o For more details regarding Highcharts see Section 5.5.
16
IMPORTANT NOTE: Display an error message, as shown below, if the user did not enter
any input in the search box or no data is found for the entered input. Use the company profile
response to determine no data.
This menu will display all the stocks that are added to the watchlist by the user. This watchlist
will be maintained in MongoDB Atlas. For more details on MongoDB Atlas, see section 5.4 and
Figure 3.11.
● If the change is positive, the color of the ‘c’, ‘d’ and ‘dp’ keys should be green
● If the change is negative, the color of the ‘c’, ‘d’ and ‘dp’ keys should be red
● If there is no change, the color of the ‘c’, ‘d’ and ‘dp’ keys should be black.
● When clicking on the close button on the right-top corner of the card (the “x”), it should
remove the stock from the watchlist and display an updated watchlist.
● When clicking on the card, it should open the details route of that ticker (stock).
● If the watchlist is empty, it should display the alert as shown in Figure 3.12.
‘c’, ‘d’ and ‘dp’ key should be used from Table 4.3.
Upon clicking any area of the watchlist card, the user should be navigated to the search details
page of that stock. Initially a loading “spinner” is displayed until the watchlist is pulled from the
database.
17
Figure 3.11: Watchlist menu page
This menu will display all the stocks that have been bought by the user (i.e., the current portfolio
of the user). This portfolio will be maintained in the MongoDB Atlas. For more details on
MongoDB Atlas, see Section 5.4 and Figure 3.13.
18
To simulate real-world stock trading and allow the user to incur profits/losses, a wallet feature
should be implemented. Initialize the cash balance in the wallet to be $25,000.00 using
MongoDB Atlas. Users will use this cash balance to trade stocks.
Update the money spent and gained during buy and sell transactions, accordingly. The initial
price of stock when buying it, and the current change in price should be used to update the
balance in the wallet for profit and loss. Initially a loading spinner is displayed until the portfolio
is pulled from the database.
In particular:
● If the current rate is greater than the rate at which user bought it, then color of the
‘Change’, ‘Current Price’ and ‘Current Total’ keys should be green;
● If the change is negative, the color of the ‘Change’, ‘Current Price’ and ‘Current Total’
keys should be red;
● If there is no change, the color of the ‘Change’, ‘Current Price’ and ‘Current Total’ keys
should be black;
● When clicking on the Buy button, a modal should open as shown in Figure 3.15. The
Buy button inside the modal should be disabled if the quantity entered by the user is not
valid, as shown in Figure 3.14. Valid input should be (a) greater than 0, with (b) quantity
that produces a total less than available cash in the wallet and (c) must be non-empty;
● When clicking on the Sell button, a modal should open as shown in Figure 3.17 and
3.18. The Sell button inside the modal should be disabled if the quantity entered by the
user is not valid. Input is Valid if, 0<input<=Quantity and must be non-empty. Quantity is
described in Table 3.6;
● When clicked on card’s header part, it should open the search details route of that ticker
(stock);
● If the portfolio is empty, it should display the alert as shown in Figure 3.14.
‘c’ key should be used from Table 4.3 for ‘Current Price’. ‘Current Change’ and ‘Current
Total’ should be calculated as shown in Table 3.5.
Alerts should be displayed for successful buy and sell transactions, which should auto-close.
20
Figure 3.14: Portfolio Empty Alert
21
Figure 3.16: Input is invalid in Modal for Buying Stock
22
Figure 3.18: Input is invalid in Modal for Selling Stock
Figure 3.19: Auto closing alert message for buying more stocks from portfolio section
23
Figure 3.20: Auto closing alert message for selling stocks from portfolio section
The following are a few snapshots of the web app opened with Google Chrome is simulating a
mobile device.
24
25
26
You must watch the video carefully to see how the page looks on mobile devices. All functions
must work on mobile devices.
One easy way to test for mobile devices is to use Google Chrome Responsive Design Mode and
Safari Develop – User Agent menu. An iPhone 12 Pro is used in the video.
3.5 Navbar
The Navigation bar must be present on top of the page, and visible at all times, as shown in all
the figures above. You can use Bootstrap to create a navbar. It consists of following menu
options:
1. Search
2. Watchlist
3. Portfolio
3.6 Footer
The Footer must be present at the end of each page, as shown in above figures. It should contain
following line:
“Powered by <a href=” https://finnhub.io”>Finnhub.io</a>”
27
4. API’s description
In this assignment, we will use the Finnhub API. A comprehensive reference about this API is
available at:
https://finnhub.io/docs/api/introduction
Reference: https://finnhub.io/docs/api/company-profile2
For Company’s Description, use the following API. For more details refer Figure 4.1:
https://finnhub.io/api/v1/stock/profile2?symbol=<TICKER>&token=<API_Key >
An example URL constructed from the parameters will look like this:
https://finnhub.io/api/v1/stock/profile2?symbol=AAPL&token=<API_Key >
Response:
Response Keys Details
country Country Name
currency Currency Symbol
exchange Company’s Exchange
name Company’s Name
ticker Company’s Symbol
ipo Company’s Start Date
marketCapitalization Company’s MarketCap
shareOutstanding Company’s Shares
logo Company’s Logo
phone Company’s Contact No.
weburl Company’s Website Url
finnhubIndustry Company’s Industry
Table 4.1: Details regarding Company’s Description API call
28
Figure 4.1: Response received for Company’s Description API call
You should extract the content of Time Series Data from the returned JSON object to construct a
chart which is responsible for displaying (close) price and volume. The chart is provided by
HighCharts. Find more information about HighCharts at:
https://www.highcharts.com/demo
https://www.highcharts.com/demo/stock/area
https://www.highcharts.com/demo/stock/candlestick-and-volume
The historical data for the ticker can be obtained from Polygon.io “Aggregate (Bars)” Service.
https://polygon.io/docs/stocks/get_v2_aggs_ticker__stocksticker__range__multiplier___timespa
n___from___to
API Sample:
GET: /v2/aggs/ticker/{stocksTicker}/range/{multiplier}/{timespan}/{from}/{to}
https://api.polygon.io/v2/aggs/ticker/AAPL/range/1/day/2023-01-09/2023-07-09?adjusted=true&
sort=asc&apiKey=ctO8iVF_Gi19afBovU1ZSr6UIxqt8Fr3
29
When constructing the HTTP request required to obtain the Company Stock Chart, you need to
provide 6 values:
1. The first value, the stockTicker the user entered in the form.
2. The second value, the multiplier, is the size of the timespan multiplier. Should be a 1.
3. The third value, the timespan, should be day.
4. The fourth value, the from date, is the start of the aggregate time window. Either a date
with the format YYYY-MM-DD or a millisecond timestamp. This should be 6 months
and 1 day prior to the current date. You can use Python DateUtils’s “relativedelta” to
calculate the date. Please refer to
https://dateutil.readthedocs.io/en/stable/relativedelta.html for more details.
5. The fifth value, to, is the end of the aggregate time window. Either a date with the format
YYYY-MM-DD or a millisecond timestamp. It should be the current date (Today’s date).
6. The sixth value, the query string, should contain
“adjusted=true&sort=asc&apiKey=YOUR_KEY”, where the apiKey is your Api Key that
you created. Do not use the limit parameter, as it will conflict with the from/to dates.
Limit will default to 5,000, which is enough for 6 months of data.
Note: The Service only accepts dates in UNIX timestamps so you will need to convert dates to
UNIX epoch time.
The response of this HTTP request is a JSON-formatted object. Figure 4.2 shows a sample
response from the request. You need to parse this JSON object and extract some fields as
required.
Figure 4.2: Sample JSON response from Polygon.io API’s Aggregate (Bars) Endpoint
30
The data obtained from the API can then be mapped to the HighCharts dataset using the
mapping below.
Note: Map each returned array element for each attribute, by its index. For example, for date
(timestamp) t[0], close price is c[0] and volume is v[0].
For mapping the Stock price data to data for HighCharts, create an array of data points (x1, y1)
where x1 will be the date and y1 will be the corresponding close stock price for that day. This
array will then act as an input dataset for your HighCharts. Please refer to links in Assignment 2
for more details.
Similarly create another array of points (x2, y2) where x2 will be the date and y1 will be the
volume for that day. This array will be the second input for your HighCharts. Since you will be
plotting Stock Price vs Date and Volume vs Date you will have two different datasets and two
y-axis and a single x-axis.
Initially, the chart shows the historical stock price (in blue line with filling the area below, two
digits after decimal) and volume (in gray bar) for the past six months by an interval of one day.
Figure 4.3 shows an example of the Stock Price/Volume chart.
31
Figure 4.3: An Example of Chart showing Stock Price/Volume for 6 months
The title of the chart for showing price/volume is “Stock Price <Ticker> (YYYY-MM-DD)”,
where “YYYY-MM-DD” is today’s date. The subtitle of the chart should be “Source:
Polygon.io” and should hyperlink to the Polygon.io website: https://polygon.io/. The title of the
Y-axis is “Stock Price” when showing the stock price and the other Y-axis is “Volume”.
The X-axis changes on the basis of the zoom level 6 months, 3 months, 1 month, 15 days, and 7
days. Please refer to Section 3 for references on how to change the chart data on the basis of the
zoom level. Figure 4.4 shows an example of the Stock Price/Volume chart for 15 days zoom
level. Ensure that the volume bars are small enough to not overlap the quote line chart.
32
Figure 4.4: An Example of Chart showing Stock Price/Volume for 15 days
Reference: https://finnhub.io/docs/api/quote
For Company’s Latest Price, use the following API. For more details refer to Figure 4.5:
https://finnhub.io/api/v1/quote?symbol=<TICKER>&token=<API_KEY>
An example URL constructed from the parameters will look similar to this:
https://finnhub.io/api/v1/quote?symbol=MSFT&token=<API_KEY>
Response: We receive an array of objects, where each object contains following keys. We only
need the following keys from the response.
33
dp percentage change in price
h high price of the day.
l low price of the day.
o open price of the day.
pc Previous close price
t Timestamp of last stock data
Table 4.2: Details regarding Company’s Latest Price API call.
Market Status must be open if the difference between current Timestamp (current Timestamp will
be created using new Date() in javascript) and ‘timestamp’ key is less than 60 seconds.
Figure 4.5: Response received for Company’s Latest Price API call
4.1.4 Autocomplete
Reference: https://finnhub.io/docs/api/symbol-search
For Autocomplete, use the following API. For more details refer Figure 4.6:
https://finnhub.io/api/v1/search?q=<QUERY>&token=<API_KEY>
https://finnhub.io/api/v1/search?q=AMZ&token=<API_KEY>
Response objects:
We receive a response in the form of an array of objects. From those objects we only need the
following keys:
34
Response Keys Details
count number of results
result array of search result
description symbol description
displaySymbol display symbol name
symbol unique symbol used to identify this symbol
used in /stock/candle endpoint.
type security type
Table 4.3: Details regarding Autocomplete Response. API call
Reference: https://finnhub.io/docs/api/company-news
For Company’s News, use the following API. For more details refer to Figure 4.7.
https://finnhub.io/api/v1/company-news?symbol=<TICKER>&from=<DATE>&to=<DA
TE>&token=<API_KEY>
https://finnhub.io/api/v1/company-news?symbol=MSFT&from=2021-09-01&to=2021-09
-09&token=<API_KEY>
Response objects:
Reference: https://finnhub.io/docs/api/recommendation-trends
For Company’s Recommendation Trends, use the following API. For more details refer to
Figure 4.8.
36
https://finnhub.io/api/v1/stock/recommendation?symbol=<TICKER>&token=<API_KE
Y>
An example URL constructed from the parameters will look similar to this:
https://finnhub.io/api/v1/stock/recommendation?symbol=MSFT&token=<API_KEY>
Response objects:
37
4.1.7 Company’s Insider Sentiment
Reference: https://finnhub.io/docs/api/insider-sentiment
For Company’s Insider Sentiment, use the following API. For more details refer Figure 4.9:
https://finnhub.io/api/v1/stock/insider-sentiment?symbol=<TICKER>&from=2022-01-01
&token=<API_KEY>
An example URL constructed from the parameters will look similar to this:
https://finnhub.io/api/v1/stock/insider-sentiment?symbol=MSFT&token=<API_KEY>
Response objects:
38
Figure 4.9: Response received for Company’s Insider Sentiment API call
Reference: https://finnhub.io/docs/api/company-peers
For Company’s Peers, use the following API. For more details refer Figure 4.10:
https://finnhub.io/api/v1/stock/peers?symbol=<TICKER>&token=<API_KEY>
An example URL constructed from the parameters will look similar to this:
https://finnhub.io/api/v1/stock/peers?symbol=MSFT&token=<API_KEY>
Response array:
39
Figure 4.10: Response received for Company’s Peers API call
Reference: https://finnhub.io/docs/api/company-earnings
NOTE: If any of the response values are null values for response keys, replace null values
to 0. Sample null response received from Finnhub API (Figure 4.11.1) which should be
handled and replaced with 0.
For Company’s Earnings, use the following API. For more details refer Figure 4.9.1 and
Figure 4.11.2:
https://finnhub.io/api/v1/stock/earnings?symbol=<TICKER>&token=<API_KEY>
https://finnhub.io/api/v1/stock/earnings?symbol=MSFT&token=<API_KEY>
Response objects:
40
Figure 4.11.1: Null Response received for Company’s Earnings API call
41
4.2 Social Networks
4.2.2 Facebook
5. Implementation Hints
ng-bootstrap will work with both Bootstrap 4 and 5, but with a specific version of Angular.
Check compatibility and dependencies at:
https://ng-bootstrap.github.io/#/getting-started
Alerts - https://ng-bootstrap.github.io/#/components/alert/examples
Modal - https://ng-bootstrap.github.io/#/components/modal/examples
Bootstrap provides a complete mechanism to make web pages responsive for different mobile
devices. In this exercise, you will get hands-on experience with responsive design using the
Bootstrap Grid System.
5.3 Angular
● Angular Set up –
https://angular.io/
● Angular Routing –
https://angular.io/guide/routing-overview
Once you set up an account in MongoDB Atlas, you will have to create a project to store your
databases. In a project you will create a database to store collections which hold the watchlist
and protfolio information data in NoSQL format. Below are the steps to set up a project and
create a database.
Follow these steps create a project in which you can store databases for your application.
43
Follow these steps to create a deployment for the project by creating a cluster and providing user
access and network access for the same. This would allow your application, running on a
different server, to connect to MongoDB Atlas in the cloud.
Follow these steps to create a database and a collection in that database. MongoDB stores data
records as documents (specifically in BSON format) which are gathered in collections. A
database stores one or more collections of documents.
Follow these steps to provide the instructions on how to connect to your MongoDB database
from your application.
44
Once you have set up the database and the collection, you can connect to the database by adding
the MongoDB node driver to your application. For more information how to add the driver and
run queries on the database, refer to MongoDB Node Driver — Node.js
5.5 highcharts-angular
https://www.npmjs.com/package/highcharts-angular
https://www.tutorialspoint.com/angular_highcharts/angular_highcharts_quick_guide.htm
https://github.com/highcharts/highcharts-angular
https://www.highcharts.com/docs/chart-and-series-types/column-chart#stacked-column-c
hart
https://www.highcharts.com/docs/chart-and-series-types/spline-chart
https://www.highcharts.com/demo/stock/sma-volume-by-price
5.6 Icons
Reference: https://fontawesome.com/search
● https://icons.getbootstrap.com/icons/caret-up-fill/
● https://icons.getbootstrap.com/icons/caret-down-fill/
● https://icons.getbootstrap.com/icons/star/
● https://icons.getbootstrap.com/icons/star-fill/
45
● https://icons.getbootstrap.com/icons/x/
● https://fontawesome.com/icons/facebook-square?s=brands
● https://fontawesome.com/icons/twitter?s=brands
Since this assignment is implemented with Node.js on Cloud Services, you should select Nginx
as your proxy server (if available), which should be the default option.
6. Files to Submit
In your course homework page on GitHub Pages, you should update the Assignment #3 link to
refer to your new initial web page for this exercise. Your files must be hosted on the same
service: Google Cloud, AWS or Azure. Graders will verify that this link is indeed pointing to one
of the cloud services. Additionally, you need to provide an additional link to the URL of the
cloud service where the AJAX call is made with sample parameter values. When this link is
followed, JSON is expected as the output.
Also, submit your source code file to D2L Brightspace. Submit a single ZIP file that includes
both the front-end and back-end code, plus any additional files needed to build your app. The
timestamp of the ZIP file will be used to verify if you have used any “grace days.”
**IMPORTANT**:
● All explanations and clarifications provided in Piazza related to this homework are part
of the homework description and grading guidelines. So please review all Piazza threads,
before finishing the assignment. If there is a conflict between Piazza and this description
and/or the grading guidelines, Piazza always rules.
● You should not call any of the Finnhub or Polygon.io APIs directly from JavaScript,
bypassing the NodeJS proxy. Implementing any one of them in “client” JavaScript
instead of NodeJS will result in a 4-point penalty.
● Appearance of all views, tables, and charts should be similar to the snapshots in this
document and the reference videos as much as possible.
46