Stock Price Checker Project with testable user stories - Guinea Pigs needed 🐹

Stock Price Checker Project with testable user stories - Guinea Pigs needed 🐹
0

#1

This project will be part of our new Quality Assurance and Information Security section. It was designed by @JosephLivengood.

The goal is for campers to be able to build these projects step by step following user stories. This will make the projects less intimidating and more fun. Oh, and don’t worry - we’ll still have plenty of optional projects where we don’t provide you with any tests. And if you’ve previously built these projects, you don’t need to build them again.

If you’re interested in attempting this, please reply to the thread and let us know you’ve started it. The more people who want to build this, the better, as we can start gathering feedback.

Thanks, and happy coding!

User Stories:

  • Set the content security policies to only allow loading of scripts and css from your server.
  • I can GET /api/stock-prices with form data containing a Nasdaq stock ticker and recieve back an object stockData.
  • In stockData, I can see the stock(string, the ticker), price(decimal in string format), and likes(int).
  • I can also pass along field like as true(boolean) to have my like added to the stock(s). Only 1 like per ip should be accepted.
  • If I pass along 2 stocks, the return object will be an array with both stock’s info. Instead of likes, it will display rel_likes(the difference between the likes on both stocks) on both.
  • A good way to receive current price is the following external API(replacing ‘GOOG’ with your stock): https://finance.google.com/finance/info?q=NASDAQ%3AGOOG
  • All 5 functional tests are complete and passing.

Example usage:

/api/stock-prices?stock=goog
/api/stock-prices?stock=goog&like=true
/api/stock-prices?stock=goog&stock=msft
/api/stock-prices?stock=goog&stock=msft&like=true

Example return:

{"stockData":{"stock":"GOOG","price":"786.90","likes":1}}
{"stockData":[{"stock":"MSFT","price":"62.30","rel_likes":-1},{"stock":"GOOG","price":"786.90","rel_likes":1}]}

Completed passing project: https://gomix.com/#!/project/giant-chronometer
Boilerplate: https://gomix.com/#!/project/fcc-stock
Tester(ISQA_5-Nasdaq Stock Prices): https://pricey-hugger.gomix.me/

This is a smaller project but is very good experience as it involves 2-4 async processes per call making the camper use promises/callbacks before responding!


#2

i am not getting the json response to display anything on the interface. Is this a bug?


#3

Demo ==> https://brusbilis.com/freecodecamp/6-backEnd/stock/stock.html

Code ==> https://github.com/brusbilis/freeCodeCamp/tree/master/6-backEnd/stock

Backend is made with Golang instead of node

Security requirements are implemented in nginx adding to nginx conf

add_header Content-Security-Policy “default-src ‘self’”;


#4

Sorry, but looks like Google dismissed the service and now that links give an error message. What service/api should we use to get the data?


#5

I am working on that project too, I found this article who talks about alternatives, not sure yet if the tests will play nice with it:


#6

I searched around a bit and I suggest this free API which has a plethora of information:

This is the direct link to the documentation about the most useful data for the project:

An example:
https://api.iextrading.com/1.0/stock/aapl/quote


#7

I used Alphavantage.co, but it’s limited to 5 calls per minute.

I also tried using a node package - google-finance-data - which works, but is painfully slow.

Here’s my working version - https://moor-skink.glitch.me - but this project does currently have several issues in its instructions and suggestions. The example doesn’t work at all.


#8

I can also confirm that the glitch example is not working. I guess I will try and use the resources others have posted